views:

63

answers:

0

Possible Duplicate:
How to improve jRuby load time?

When developing a site using jruby on rails I find it quite annoying that every time I invoke jrake db:migrate or rails g migration I have to wait a few seconds for the java engine to start...

$ time rails -v
Rails 3.0.0

real    0m6.947s
user    0m10.590s
sys     0m0.230s

Is there a way around this? Maybe I could install regular rails too and use its toolset; that would probably work to some extent except that jrails and rails connect to the database differently. Is there no way to have a java VM running on standby somehow to avoid the expensive startup?

Addendum: maybe it isn't java's or jruby's fault? Maybe it's just rails'?

$ time echo 1+1 | jirb
1+1
2  

real    0m0.930s
user    0m1.090s
sys     0m0.040s

$ time echo 1+1 | rails c
Loading development environment (Rails 3.0.0)
1+1 
2

real    0m14.719s
user    0m22.080s
sys     0m0.600s

14 s is a long time to wait... :(