Ruby 1.9 loading rails is slow

Hello all,

I've recently started a project and I wanted to give ruby 1.9 + rails
a chance. Well everything works great, so far haven't encountered any
gem that didn't work (so anyone out there you should give it a try).
There's only one minor glitch: on ruby 1.8.7 loading rails environment
takes 1-2 secs, on 1.9.1 it takes ~10 secs. Maybe anyone had similar
problem? I'm on ubuntu 9.10 and I compiled ruby from source (as I've
noticed it works ~20% faster than apt version).

I'm having similar issues.
I've tried on a Windows box, as well as Ubuntu 9.04 and 9.10 (both of
which were VirtualBox with Windows XP as the host, but I tossed all
the RAM I could at them). All three environments have rails 3 loading
at an unacceptable speed (30-60 seconds before the environment is even
loaded). I'm at my wits end on this - although I did not try anything
other than 1.9.1 for this. I'll go build 1.8.7 from source on one of
the ubuntu images and give it a shot.

Hello all,

I’ve recently started a project and I wanted to give ruby 1.9 + rails
a chance. Well everything works great, so far haven’t encountered any

gem that didn’t work (so anyone out there you should give it a try).
There’s only one minor glitch: on ruby 1.8.7 loading rails environment
takes 1-2 secs, on 1.9.1 it takes ~10 secs. Maybe anyone had similar

problem? I’m on ubuntu 9.10 and I compiled ruby from source (as I’ve
noticed it works ~20% faster than apt version).

What do you mean when you say loading Rails? Command-line using webrick or thin? Rails console? Passenger? Also, what version of Rails are you using?

-Conrad

Have you tried ruby 1.9.2-dev?

Rails 3.0.0.beta
And as far as loading rails, I mean anything involving the 'rails'
command. rails console, rails server, rails generate - all 30+
seconds.
Anything involve the rake tasks rails ships with: rake db:migrate,
rake test:units - 30+ seconds.
I honestly haven't even gotten into actually running the server yet -
I've been writing models and test units, but I did test on just
webrick and response time - 30+ seconds.
This is on Windows XP, Ubuntu 9.10 or Ubuntu 9.04 (both ubuntu were on
VirtualBox with XP as the host). I've tried Ruby 1.9.1 and 1.8.7.
1.8.7 just made things vastly worse - 2+ minutes to start some things.

Rails 3.0.0.beta

And as far as loading rails, I mean anything involving the ‘rails’

command. rails console, rails server, rails generate - all 30+

seconds.

Anything involve the rake tasks rails ships with: rake db:migrate,

rake test:units - 30+ seconds.

I honestly haven’t even gotten into actually running the server yet -

I’ve been writing models and test units, but I did test on just

webrick and response time - 30+ seconds.

This is on Windows XP, Ubuntu 9.10 or Ubuntu 9.04 (both ubuntu were on

VirtualBox with XP as the host). I’ve tried Ruby 1.9.1 and 1.8.7.

1.8.7 just made things vastly worse - 2+ minutes to start some things.

Chris, these thing load for me in less than 5 seconds for Mac OS 10.6.2 and Ubuntu 9.10.

Windows 7 Ultimate can get things loaded in less than 20 seconds. BTW, I have the following

system configuration:

Mac Pro:

Mac OS 10.6.2

8-core 2.93 GHz

32 GB RAM

VMWare Fusion 3 - Windows 7 Ultimate (64 bit) and Ubuntu 9.10 (64 bit)

Also, I have scaled things all the way down using 1 and 2 cores and I was able to get the

same results. Again, Rails 3 is currently in Beta. Thus, all the needed optimizations are

not in place and I’m quite sure that there’s a level of debugging logic within the code base.

This debugging logic will most likely be removed and optimizations will be put into place

for the first release candidate (RC).

Good luck,

-Conrad