Live data from Hacker News

Rails 3 Performance - Not Good Enough

blog.tstmedia.com

131–140 of 142 posts

Re: Rails 3 Performance - Not Good Enough

#131

Earlier quoted context omitted.

Here's 1.8.7, 1.9.2, and 1.9.3dev running that application's test: https://img.skitch.com/20110515-x4r8414pkei9j3h73d1sy67iud.j... 1.9.2 and 1.9.3 is really slow at starting up bundler/rails/gems.

Ok so first this is not exactly an empty Rails project. The Gemfile.lock has 221 lines, that amount of dependencies is not normal. To compare the application code for http://www.getharvest.com/ a +5 year old rails project with customers et all and it has 245 gem dependencies (including some that are our own). The +3 year old http://www.coopapp.com has 181 dependencies. Both of these start up within 3-4 seconds on my…

Why are you equating lines in Gemfile.lock with the number of dependencies?

There are 28 gems specified in the Gemfile. That's not an unreasonable amount of gems. With dependencies, the total amount of gems being required is 76.

Hell, only using Rails and sqlite-ruby will require 26 gems to be installed.

Re: Rails 3 Performance - Not Good Enough

#132
post #128

Earlier quoted context omitted.

I just tested this on one of my apps (yakkstr.com) and 'rails c' and 'rails s' both startup in about 5 seconds. I'm on 1.8.7 and rails 3, not sure if that makes a difference, but 20-30 seconds doesn't mesh with my experience at all. I'm on a 2.66 GHZ i5 imac, not an SSD.

Would you mind testing out https://github.com/joevandyk/slow-rails and see how long 'rake' takes to run? For me on 1.8.7, it takes about 7-8 seconds. Annoying because the application is empty, it's just 28 gems being loaded. On 1.9.2, it's 20 seconds or so.

I get the same, I hadn't noticed it because I'm still using 1.8.7

Have you tried spork? https://github.com/timcharper/spork

Also, have you opened a ticket or looked to see if there is one already?

Re: Rails 3 Performance - Not Good Enough

#133
post #91
post #61

Earlier quoted context omitted.

You could be criticising any memory managed programming language. No, I'm explicitly criticizing Ruby. I've spent years in Python-land and the average code quality (and btw documentation standard) is much higher over there. Which is not to say Python doesn't have its own problems, but less so in this particular area. say that the average rubyist is much more concerned with good design than, say, your average java dev…

> Good design is a relative term. In ruby I frequently see it interpreted as: Pack as many layers of magic as possible, and then test that with as many layers of testing-frameworks as possible. I have the same feeling sometimes. I wish the Ruby community would not be so concerned with magic and aesthetics, and target clarity.

From experience and observation, I'd say that in most developer communities (include Rubyists) aesthetics and clarity are one and the same..

Re: Rails 3 Performance - Not Good Enough

#134
post #53

I've been a Rails dev for 5 years. I'm frequently considering leaving for another framework because of one thing: bootstrap time. Starting a test or server on my dev machine takes 20-30 seconds. Particularly with tests, this is a huge problem for doing proper TDD, particularly when you are trying to use tests to track down a bug. In that 20-30 seconds, I often console myself that we no longer need to print punch card…

I had a similar issue using Django+PostgreSQL on Ubuntu 11. Running the test suite was taking 10s of seconds in that combination which wasn't too bad but hurt my test->fix->test cycle when debugging PostgreSQL related issues (during normal dev I run the test suite in a in memory SQLite database).

Took a little time to work it out as I am new to PostgreSQL but it was worth it to avoid a pause in the problem solving cycle.

Problem and solution explained on my blog: http://www.roryhart.net/code/slow-create-database-with-postg...

Re: Rails 3 Performance - Not Good Enough

#135
post #64
post #18

Earlier quoted context omitted.

Yeah, 400 ms spent on average just in Ruby on a modern server is really absurd, though. Think about that - half a second, before anything to do with the database. I try to shoot for sub-100ms avg. total, this would probably drive me insane. I don't think I've ever managed to write a PHP page that took more than 100ms on average for the PHP alone on a decent server, and it's not from a lack of abuse.

I have no idea where you get 400ms on average. Here's the log for a blog post page of my site. It's a heavy and big page, it's on ruby 1.8.7 and rails 3, and I haven't done anything to make it faster. I could cache most of it rather easily. Completed 200 OK in 205ms (Views: 168.9ms | ActiveRecord: 23.2ms | Sphinx: 9.6ms) edit: a couple of notes. This is running on a cheap vps and would be faster on a real server. It…

? If you read the article, you can see that after their upgrade, the average time spent in ruby per page is 400ms.

Re: Rails 3 Performance - Not Good Enough

#136
post #53

I've been a Rails dev for 5 years. I'm frequently considering leaving for another framework because of one thing: bootstrap time. Starting a test or server on my dev machine takes 20-30 seconds. Particularly with tests, this is a huge problem for doing proper TDD, particularly when you are trying to use tests to track down a bug. In that 20-30 seconds, I often console myself that we no longer need to print punch card…

Re: your knock on Cucumber – isn't Cucumber explicitly designed to enable human readability so that non-programmers can collaborate on features in quasi-colloquial English? Can you expand on what you dislike about it?

I'm not trolling; I'm genuinely curious about this.

Re: Rails 3 Performance - Not Good Enough

#137
post #34

Earlier quoted context omitted.

Judging by the comments on that commit and the comments in this HN post, I would say that many of the performance regressions are only happening under ruby 1.8.x. By this time, I wonder what the rails developers should spend their time with: making the framework better for people running the current version of the language or fixing performance problems due to shortcomings of the old version? If you can't upgrade to…

I'm finding it's not that people can't upgrade to 1.9.2, it's that many don't want to. I have a pretty decent-sized application running on REE and Rails 2.3.x. I've made my code fully 1.9.2 compatible. My specs take on average 3.5 times longer to run in 1.9.2. Profiling that shows that close to 60% of the time is spent in Kernel#require. Now, it's pretty common for people to say only profile in the production environ…

I see. My two projects are indeed quite small yet (but running the tests already takes quite long).

But: the solution to this problem isn't not upgrading and then demanding support for your outdated environment. The solution is to fix whatever is slow and try to get a patch upstream.

Now I don't know how likely the ruby developers are to accept a patch, but once this becomes too painful for me, I will try and have a look. I might not be able to fix it, but at least I know that I'm not stuck in the past, terrified and unable to move

Re: Rails 3 Performance - Not Good Enough

#138
post #137

Earlier quoted context omitted.

I'm finding it's not that people can't upgrade to 1.9.2, it's that many don't want to. I have a pretty decent-sized application running on REE and Rails 2.3.x. I've made my code fully 1.9.2 compatible. My specs take on average 3.5 times longer to run in 1.9.2. Profiling that shows that close to 60% of the time is spent in Kernel#require. Now, it's pretty common for people to say only profile in the production environ…

I see. My two projects are indeed quite small yet (but running the tests already takes quite long). But: the solution to this problem isn't not upgrading and then demanding support for your outdated environment. The solution is to fix whatever is slow and try to get a patch upstream. Now I don't know how likely the ruby developers are to accept a patch, but once this becomes too painful for me, I will try and have a…

Well, the solution isn't upgrading for the sake of upgrading either. 1.9.2 buys me absolutely nothing and has some major costs associated with it. REE is chugging along like a champ.

I don't really understand why the release of 1.9.2 meant all else had to be dropped. Most other communities continue to support their stable releases. It's not as if 1.9.2 has even displaced 1.8.7 with virtually any of the linux distros either. If your policy is to use security-audited / supported packages, as is the case in many environments, moving to 1.9.2 is a dealbreaker.

Anyway, supporting 1.8.7 and 1.9.2 is trivial in most cases. I'm not demanding support for my environment, which I prefer to think of more as stable and battle-tested than "outdated." But I don't understand actively dropping support for it either.

Re: Rails 3 Performance - Not Good Enough

#139

I just ran a simple test on every version of ActiveRecord that I could get running (standalone), using both Ruby 1.8.7 and 1.9.2, and graphed the numbers. Here is the result: http://jsfiddle.net/2bUb5/

Interesting. I wonder if REE is really the savior for the article author then.

Re: Rails 3 Performance - Not Good Enough

#140
post #133
post #91

Earlier quoted context omitted.

> Good design is a relative term. In ruby I frequently see it interpreted as: Pack as many layers of magic as possible, and then test that with as many layers of testing-frameworks as possible. I have the same feeling sometimes. I wish the Ruby community would not be so concerned with magic and aesthetics, and target clarity.

From experience and observation, I'd say that in most developer communities (include Rubyists) aesthetics and clarity are one and the same..

I'm referring really to functional clarity. Fancy ruby DSLs that invoke method_missing and parse function names make for aesthetically pleasing end user code, but obfuscate the functionality for anyone unfamiliar with the code base.

Aesthetics and clarity are most certainly different in other ways (think pretty sites vs simple clear sites) but that's another discussion.

Post reply on HN