4 ms·
wow, 11 sec to run hello world: ``` ~$ time ruby -X+T -e 'puts Truffle.graal?' real 0m3.843s user 0m11.867s ```
by singularity2001 11y ago
wow, 11 sec to run hello world:
```
~$ time ruby -X+T -e 'puts Truffle.graal?'
real 0m3.843s
user 0m11.867s
```
- craigmcnamara 11y agoJRuby has never been fast to boot, but after boot it's very fast to execute.
- ch4s3 11y agoThat is the JVM startup time. If you allow the vm to warm up and and JIT to kick in, you'll see significant gains.
- omaranto 11y agoThe JVM startup time is very small nowadays (seriously, write a Hello World! class in Java to test it if you don't believe me). The culprit is probably JRuby's startup time (and maybe the Truffle + Graal version of JRuby is even slower to startup than regular JRuby).
- ch4s3 11y agoYeah, I'm oversimplifying. However, compared to MRI, the JVM starts up quite slowly. Pile on JRuby et al and you end up with an even slower time to go. I think the JRuby people have been very focused on feature parity, interop, and bug fixes so I'm not sure they've prioritized startup time. For now, I'm happy with that, I don't restart my app that often, basically only on deploys.
- jordanthoms 11y agoStartup is slow right now, but there is a project underway at Oracle Labs which will reduce it to a similar level as MRI.
- mike_hearn 11y agoJVM hello world can be about 50 milliseconds. The issue is the Graal/JRuby overhead. Bear in mind that Graal is a JIT compiler that is itself written in Java. So it has to compile itself before it gets fast at compiling anything else! There is an AOT mode being worked on that should solve that, but it's not open source.