buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Spiewak <djspie...@gmail.com>
Subject Re: JRuby AOT Compilation for All-in-One
Date Wed, 07 Apr 2010 20:39:30 GMT
> Instead of AOT compilation, what we could look into is bundler (
>> http://github.com/carlhuda/bundler).  This will allow us to create a
>> static
>> bundle which directly references all of the gems we need without actually
>> loading rubygems.  This would be hugely advantageous in terms of startup
>> performance, and could bring us to within spitting distance of Buildr on
>> MRI.
>>
>
> Loading rubygems is what makes buildr on JRuby slow?  I thought it was JVM
> startup time.


If it were just JVM startup time, you would see Ant and Maven taking just as
long to get rolling, and that just doesn't happen.

According to the JRuby team, the far-and-away top sources of slow startup
performance are Rubygems and client vs server mode JVM (in that order).
Apparently in the JRuby trunk with the JVM in -client mode, jruby -e "puts
'a'" can run in less than half a second.  Compare that to the five-ish
seconds required to get run `buildr --help`.

The whole -client JVM thing is something we can solve easily with our
all-in-one distribution since we're already using a custom startup script.
We can also add some of the unsafe optimizations I've found to be sound for
Buildr, which also helps both startup and overall performance.  However,
neither of those address the largest source of startup performance woes:
Rubygems.


>
>  Unfortunately, it would also mean that gem dependencies and Buildr
>> plugins packaged as gems would not work with the all-in-one distribution.
>> Is this a worthwhile tradeoff?  I imagine most people who would go for the
>> all-in-one are not going to be interested in gem-based dependencies for
>> precisely the same reasons.
>>
>
> I disagree with this.  At least some of people who want to use the
> all-in-one will be people who have acquired a bunch of source code that says
> "you need buildr to build this."  If the all-in-one doesn't allow
> extensions, then the people who provide said source code will have to say
> "you need buildr to build this, but not the one that's easy to install.
>  Sorry."
>

Extensions are fine, you just wouldn't be able to get them via Rubygems.  At
least, not if we do this naively.  We may be able to set things up so that
we only load Rubygems if we actually need it for a project-defined extension
or dependency.  Otherwise, if it's just vanilla Buildr, we can leave
Rubygems untouched.  This would in a sense be the best of both worlds: most
projects would get super fast Buildr startup time, while the ones that
really need Rubygems could still use it.  We might even see some performance
boost due to the fact that the JVM will be more warmed up by the time it
gets to the point where we would determine Rubygems as necessary.

Daniel

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message