Panasonic Youth rob sanheim writes about software, business, ruby, music, stuff and things



Posted
6 March 2007 @ 2pm

Tagged
Rails, Ruby

Discuss

Rails 1.2.1 is twice as slow as Rails 1.1.6?

This seems very strange to me - look at the performance between Rails 1.1.6 and Rails 1.2.1 in this performance comparison. The rails code is very simple - just set an instance variable in the controller and render it in the rhtml. How could this be so much slower in 1.2.1? The comments are mostly in Russian, so I’d love to hear comments from someone in core on this…


13 Comments

Posted by
Aníbal Rojas
6 March 2007 @ 3pm

We found the same thing, our first look at the stats points to the view as consuming a lot of processing time. But we haven’t had enough time to digg on this issue.


Posted by
Chris
6 March 2007 @ 3pm

This is a comparison between Rails 1.1.6 and 1.2.1 … not 1.6.1 (very distant future release).


Posted by
Rob
6 March 2007 @ 3pm

Chris: You’re right, my latent dyslexia is showing. I’ve updated the post.


Posted by
Skandragon
6 March 2007 @ 3pm

Now you need to update the topic’s title so the main page shows 1.1.6 too :)


Posted by
Rob
6 March 2007 @ 3pm

Skan: It is — look up. The header is 1.1.6.


Posted by
Chris
6 March 2007 @ 4pm

We actually haven’t noticed any speed difference between 1.1.6 and 1.2.1, probably because our app spends all its time in erb (whose speed has nothing to do with Rails proper) and memcached/mysql. What we have noticed is a massive increase in load. Big time.


Posted by
Stewie
6 March 2007 @ 5pm

As if Rails wasn’t already slow enough… am I the only one who thinks the core should focus more on cleaning things up (like ActiveRecord) instead of piling on more and more features?

Without a solid foundation to build on, things will get ugly.


Posted by
Dr Nic
6 March 2007 @ 10pm

In the article that posted the “2-4 times slower” analysis, there is a comment below that suggests the tests were run in development mode, not production mode, and that yes in 1.2+ development mode got a lot slower as it was reloading source a lot more. The blog author hasn’t rerun the tests unfortunately.


Posted by
Rob
6 March 2007 @ 10pm

Nic: I dunno, look at comment #23 from the author there - he claims it was a misprint.

# Alrond Says:
January 30th, 2007 at 12:35 a.m.

2 Jules:
Thanks, it’s a misprint, I have really used production, already corrected :-)

Regardless, someone should attempt to duplicate those results with some performance tests to see what is really going on.


Posted by
Tarmo
7 March 2007 @ 12am

I just made a quick test, generated two rails installations, “rake rails:freeze:edge” them to TAG=rel_1-1-6 and rel_1-2-2, then “rake rails:update”, created the hello_controllerb.rb and index.rhtml files, configured nginx as described in http://docs.planetargon.com/Nginx_Configuration/.

Ran five mongrels in production mode and then the apache benchmark on another box: “ab2 -c 5 -n 1000 http://host:port/hello” a couple of times with each rails version.

Rails 1.1.6 gave around 130 req/sec and Rails 1.2.2 gave around 170 req/sec. Since I did not test for long I’m quite sure those numbers have a margin of error of around +-10, but even then 1.2.2 is still clearly faster with this embarrassingly simplistic benchmark.

Just my 0.02€


Posted by
Tarmo
7 March 2007 @ 12am

I just tried 1.2.1 and it seems to have about the same performance as 1.1.6 so 1.2.2 seems to have got some kind of performance improvements.


Posted by
Stefan Kaes
2 April 2007 @ 12pm

No, the rails 1.2.x branch is not twice as slow as the 1.1.x branch. See http://railsexpress.de/blog/articles/2007/04/01/rails-1-2-performance


Posted by
Rob
2 April 2007 @ 12pm

Stefan: thanks for the detailed report. Good to see that the decrease is much smaller.


Leave a Comment

Zed and Geoffrey, laying it down, httperf style My Command line toolkit for Ruby and Linux