I've been racking my brain on this all day. I don't know where to begin.
Any ideas what might be causing the problem or a way to profile the code
and figure out what is taking so long?
The reason its an issue for me, heroku times out before my app has a
chance to start, displaying an error message that the app times out.
Any help is appreciated. Thanks.
--
Posted via http://www.ruby-forum.com/.
I am seeing a similar issue with startup between Rails 3 with 1.9.2
and Rails 2 with 1.8.7, though I have not investigated whether it is
ruby or rails that is the issue. For example if I do rake db:migrate
with nothing to do it takes 7 seconds on the former but only 2 on the
latter. I see the same effect starting tests and so on. It is a bit
of a pain. I am using rvm and bundler in both cases.
Colin
I have done some further tests and confirmed that it is Ruby 1.9.2
that is causing the problem. I am comparing a Rails 3 app with ruby
1.9.2p0 (2010-08-18 revision 29036) [i686-linux] against ruby 1.8.7
(2010-08-16 patchlevel 302) [i686-linux]. With a small app, as
mentioned above, an empty rake db:migrate takes 7 seconds rather than
2 and Rake test takes 40 seconds on 1.9.2 versus 11 on 1.8.7. This is
on Ubuntu 10.04.
Any suggestions anyone?
Colin
I have now tried this with ruby 1.9.2 p136 and it has not helped.
When I look at the processor utilisation I see that rake is consuming
all my available processor for most of the time. Can anyone confirm
that they are using 1.9.2 with rails 3 (preferably on Ubuntu or
similar) without seeing the slowdown that I have experienced.
Alternatively can anyone suggest where I go from here (apart from
buying a more powerful PC).
Colin
Can I just check that you are confirming that you see a significant
slow down between Ruby 1.8.7 and 1.9.2?
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have 1GByte RAM and while running the test it shows less than half
used and the disk is not rattling. The processor shows 100%
utilisation whilst the test is running, with rake being the process
using most of it.
I have tried making a new rails 3.0.3 app
rails new testruby
then using rvm to switch between 1.8.7 p302 and 1.9.2 p136
On each ruby I ran
time rake db:migrate
a couple of times to let the disk cache settle out then for 1.8.7 I got
real 0m2.111s
user 0m1.804s
sys 0m0.220s
and on 1.9.2
real 0m4.098s
user 0m3.512s
sys 0m0.424s
I also tried rake test and got, on 1.8.7
real 0m3.615s
user 0m3.104s
sys 0m0.316s
and on 1.9.2
real 0m6.487s
user 0m5.320s
sys 0m0.684s
It seems as if 1.9.2 takes about twice as long for some reason.
Colin
I use mongrel. The server startup time is not really an issue for me
in development as starting the server is not something that happens
repeatedly. I don't know whether the response time once the server is
up and running is significantly different between 1.9.2 and 1.8.7, I
had not noticed an obvious difference. It is the test cycle time
particularly that is a pain. I use autotest and when I make a change
I have to wait while the tests get underway, which is tedious.
Colin
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
So you are getting 1.9.2 _faster_ than 1.8.7 for db:migrate?
>
>>
>> I also tried rake test and got, on 1.8.7
>
> I ran rake test and got no output, rake test:benchmark gave the
> following:
>
>> real 0m3.615s
>> user 0m3.104s
>> sys 0m0.316s
>
> Finished in 0.289591 seconds
>
>>
>> and on 1.9.2
>> real 0m6.487s
>> user 0m5.320s
>> sys 0m0.684s
>
> Finished in 0.578807 seconds
>
>>
>> It seems as if 1.9.2 takes about twice as long for some reason.
>>
>> Colin
>
> Paul
>
Done.
http://permalink.gmane.org/gmane.comp.lang.ruby.rails.core/14754
Colin
On ubuntu 10.10 with ruby 1.9.2 and a fresh rails 3.0.3. I created a
cucumber feature with one scenario.
Running cucumber takes about 18 seconds, with 17 seconds spent doing
calls to kernel#require.
See: https://gist.github.com/780747
Now, I installed ruby from ubuntu repos/ppa, which I am not sure it
provided the latest ruby. So I removed everything and installed rvm.
Installed ruby 1.9.2-p136 and had same issue. Then installed ree 1.8.7,
and did not have the issue. It's much faster. I will watch closely the
-core mailing list for a possible resolution, but for now, I will use
ree.
See: https://gist.github.com/781489
Thanks,
-Conrad
Sent from my iPhone
We see a performance loss in 1.9.2 as it exhibits the correct behaviour when calling require, whereas 1.8.7 is reliant on incorrect semantics that are not acceptable for production use. I was never affected by these incorrect semantics, but I suppose ruby-core has to right these things or accept the long term technical debt.
Something called gem_prelude was added to ruby 1.9 as kludge to address some performance issues.
Ryan David explain (from the ruby-core list):
> It (gem_prelude) was created to address a symptom, namely, that rubygems was slow on some systems (and proportional to the number of gems you have installed).
The good news is: a patch was committed (Jan 14) to ruby that should address some of the performance issues we're seeing. Namely, 1.9.2 users will be able to upgrade to rubygems 1.4 which offers some improved performance.
I don't know when we'll see the next ruby release, but I'm encouraged to see some progress. I'm also encouraged to see that there are members of the ruby-core team actively investigating and addressing these issues.
Luke
I was running the test on my laptop (core 2 duo 1.86ghz + 2gb ram +
5400rpm hdd). I might run the same test on my desktop (quad core 3.2 ghz
+ 4gb + 10000 rpm drive).
Also, with rvm, I think I can install ruby from head, see if it improves
the performance problem.
I've installed ruby-head via rvm, and updated my gist. It does seem to
be an improvement! Still lagging behind ree, though.
https://gist.github.com/756616
If require is your bottleneck, you can use the faster_require gem:
https://github.com/rdp/faster_require
-r