Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails initializes extremely slow on ruby 1.9.1

Tags:

I just got my rails 2.3.8 app running on ruby 1.9.1. To get into the console, start the webserver, anything that initializes rails, takes 3 - 4 times longer in ruby 1.9 than in ruby 1.8.7. I'm using ruby version managers so I can easily switch between ruby 1.9 and ruby 1.8.7. The speed difference happens in both production and development. I want to use 1.9 because its must faster once everything is running, but the startup time is so bad the app is timing out on Heroku on the first request.

Any ideas why ruby 1.9 would be 3 - 4 times slower? I can't figure it out for the life of me.

like image 785
Ben Johnson Avatar asked May 26 '10 14:05

Ben Johnson


1 Answers

Try using 1.9.2-head instead of 1.9.1. It is the recommended version for Rails 3, so you may have better luck. Rails 2.3.8 starts up very quick on 1.9.2-head from the tests I just ran locally (with Authlogic installed too, btw).

If you are using RVM, type the following:

rvm install 1.9.2-head
rvm use 1.9.2-head

Edit: I tried 1.9.1 p378 with the same app and the start up time took about 13 seconds compared to 5 seconds on 1.9.2-head. 1.9.2-rc1 is due out this month I believe, so that's good news :)

like image 89
Awgy Avatar answered Oct 12 '22 14:10

Awgy