|
May 30: Portland OR:
RailsConf 2008 |
|
Wanted: Lead Java Developer | Développeur principal en Java
at Wright Technology Solutions (Montreal, QC).
See this and other great job listings at
jobs.joelonsoftware.com.
Ruby Performance RevisitedThis item ran on the Joel on Software homepage on Tuesday, September 12, 2006Jack Herrington emailed me, in reference to the issue of Ruby on Rails performance, to write:
David Heinemeier Hansson wrote:
By way of clarification, I'm not concerned with Rails performance, I'm concerned with Ruby performance, and here's why. I've seen lots of comparisons of Ruby's performance with bytecode languages like Java which I would consider slow, and I see a lot of reports of performance claiming Ruby is 10x slower, 50x slower, etc. Besides the random blogobuzz, Ruby comes pretty darn close to dead last in the Computer Language Shootout Benchmarks. Without knowing much about the implementation of Ruby, I would guess that the biggest issue is around late binding and especially duck typing, which prevents type inference or strong typing, which means that function calls will always be slow because you can never get something compiled down to the point where a function call is just a single CALL instruction (on x86)... you always have to be exploring the object, possibly even scanning a hash table to find the function you want to call. Calling methods on objects is really, really, really, really common, especially in pure OO languages, and that bit of the code needs to get down to at least a CALL indirect on the CPU for Ruby to offer the same performance as languages where the type of the object can be determined at compile time and therefore the instruction where you're jumping to can be gotten either at compile time (like in C) or with a single indirection through a single vtable (like in C++). I understand the philosophy that developer cycles are more important than cpu cycles, but frankly that's just a bumper-sticker slogan and not fair to the people who are complaining about performance. Even though our product, FogBugz, seems like something that should be perfect for Ruby on Rails, we have several parts of code where performance is extremely important. In FogBugz 6 there's one place where we need to do literally millions of calculations to display a single chart on a single web page. We have gotten it down to 3 seconds or so in our current development environment with a lot of optimization, but frankly with a duck-typed function call I really don't think we could do it before the web browser gave up and timed out and the sun cooled down a couple of degrees. We also have to scan incoming email messages for spam using Bayesian filtering. This is compute-intensive can take 1 sec. per message. Receiving one email per second is not unreasonable for many of our customers so we are very close to being CPU pegged. That is using a language which we know to be orders of magnitude faster than Ruby at this type of code. We would be absolutely dead on Ruby. Even classic, simple CRUD applications -- the kind of application that basically just shows you a table from a database and gives you operations to add, delete, and edit records -- often discover somewhere down the line that there's something enormously computationally intensive that they want to do, for example, blog software might want to add Bayesian filtering to eliminate spam from comments. This is where you suddenly realize that if your language of choice is 10x slower than the competition, you may be simply unable to add that feature, or you may have to call out to another language (with all the marshalling overhead that implies). This doesn't apply to everyone, but when people say they have performance problems with Ruby or that they just need to be able to run code faster than the core Ruby language engine can run it, it doesn't help to have Ruby advocates singing hymns about developer cycles vs. CPU cycles. Even if you aren't doing compute-intensive things, if you find yourself needing to buy 100 servers instead of 10 servers, you may suddenly revisit the whole developer cycle vs. CPU cycle equation.I understand that there are plans for Ruby to address performance with some kind of bytecode compiler and that will be nice. When these things happen and when Ruby starts getting competitive benchmarks it will be a lot more appropriate for a lot more types of applications. In the meantime I stand by my claim that it's not appropriate for every situation. Discuss at joel.reddit.com
Students: Fog Creek Software has awesome summer internships in New York City. You get free housing, free lunches, lots of free New York activities, and a chance to write great code with great developers. And a competitive salary. Apply today: we only have four open positions and usually get hundreds of applications, which will be considered on a first-come, first-served basis. About the Author: I'm your host, Joel Spolsky, a software developer in New York City. Since 2000, I've been writing about software development, management, business, and the Internet on this site. For my day job, I run Fog Creek Software, makers of FogBugz - the smart bug tracking software with the stupid name, and Fog Creek Copilot - the easiest way to provide remote tech support over the Internet, with nothing to install or configure. Enter your email address to receive a (very occasional) email whenever I write a major new article. You can unsubscribe at any time, of course. |
I'm your host, Joel Spolsky, a software developer in New York City. Since 2000, I've been writing about software development, management, business, and the Internet on this site. More about me.
There's a complete archive of everything going back to 2000. The home page is reserved for minor, ephemeral thoughts, but occasionally I write a longer article. You can sign up to receive email whenever this happens at the bottom of this page. We also have one of those RSS thingamajiggies. If you don't know what that is, consider yourself lucky.
This site has been translated by volunteers around the world into more than thirty languages.
Want to hire great developers? Looking for a job that doesn't suck? Check out the popular job board or the job board for India.
Have feedback? There are several popular discussion boards on this site: Joel on Software
Business of Software Design of Software .NET Questions TechInterview.org CityDesk FogBugz Fog Creek Copilot You can also email me directly, although my mailbox is an official disaster area.
For my day job, I'm the CEO of Fog Creek Software, a bootstrapped software company in New York, NY.
We make FogBugz, a bug tracking system that actually works and can be used to manage everything your development does, from bug tracking to customer email to feature management to project scheduling and so much more. Check out the screenshots or the free online trial.
We also make Fog Creek Copilot, which lets you control someone else's computer (with their permission, of course) over the Internet. It's the best way to fix someone's computer problems remotely. There's nothing to install, it's simple as heck, and it works through any kind of firewall, NAT, or proxy situation with zero configuration. More
If you're in college, Fog Creek Software has a very cool paid internship program (last year's interns developed Copilot in one summer). We also run a Software Management Training Program, an intensive three-year program for college graduates to learn about managing high tech that combines a Masters in Technology Management with extensive hands-on experience in a variety of positions.
Wondering what it's like to develop software at Fog Creek? The documentary Aardvark'd covers the story of the development of Copilot. It's available on DVD.
So far, this site has been made into three books: User Interface Design for Programmers, Joel on Software, and Smart and Gets Things Done. All are excellent ways to catch up on years of the drivel that appears here without going blind reading it on a tiny screen. I’m also the editor of The Best Software Writing, a collection of other people's superb essays about software. Fog Creek co-founder Michael Pryor has his own site on Technical Interview Questions.
© 1999-2008 Joel Spolsky. All Rights Reserved. Linking, quoting and reprinting
|
|
| Home | Email | Bug Tracking Software | Remote Assistance | Complete Archive | ||