How much faster is Ruby on Linux?

Send to friend

In a previous article I compared the performance of Ruby on Windows, built through Microsoft Visual C++ and GCC. The numbers for the MinGW version were very impressive. So the question now becomes, how does its performance compare to that of Ruby on Linux? To quote one person (Alex) who commented on the aforementioned post:

With the new mingw32 substantial speed improvements, think it makes sense now to also test at least the baseline (MRI) on Mac/Linux on the same battery of tests, so we Windows folks could get a better idea of how far behind are we yet and what the different Windows interpreters speed target shall be.

Any sort of performance improvement for something that is notoriously slow on Windows is more than welcome, but would this be enough to fill the gap between Ruby’s performance on Windows and on Linux? How much faster is Ruby on Linux? Let’s find out.

Setup

  • As a reminder, the operating systems used were Windows XP SP3 32bit and Ubuntu 9.04 32 bit.
  • The Ruby implementations tested were ruby 1.8.6 (2009-03-31 patchlevel 368) [i386-mingw32], ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32], Ruby 1.8.6 (built from source on Linux) and Ruby 1.9.1 (built from source on Linux as well). The same identical versions of Ruby were used for both operating systems. I’m aware that these are not the latest available versions for Linux, but we are trying to compare apples to apples.
  • I used the Ruby Benchmark Suite; the times reported are the best out of five runs, with a timeout of 300 seconds per each iteration.

Benchmark results

The following table/image compares the performance of Ruby 1.8.6 on Windows and Linux. A light green background indicates which of the two was faster. The total times exclude tests that raised an error or were not available (N/A) for any of the four implementations, but includes timeouts (they are counted as 300 seconds to provide a lower bound). The ratio column indicates how many times faster Ruby on Linux was:

Ruby 1.8.6 on Windows and Linux

The second table/image below compares Ruby 1.9.1 on Windows and on Linux, using the same criteria as above.

Ruby 1.9.1 on Windows and Linux

Note: The totals shown are different from the ones seen in other posts since the subset of benchmarks included in the totals is different.

Conclusion

According to the geometric mean of the ratios for these tests, it appears that on average Ruby 1.8.6 on Linux is about twice as fast as Ruby 1.8.6 on Windows. Conversely, Ruby 1.9.1 on Linux is about 70% faster than the Windows version.

The Windows implementations use GCC 3.4.5 (a four year old compiler) at the moment, while I built the implementations on Ubuntu with GCC 4.3.3 (which is available by default). This helps, at least in part, to justify the performance gap. Luis Lavena, leader of the Windows port, confirmed to me that a switch to GCC 4.4.x is planned for the future. This should significantly increase performance on Windows yet again, and bump Ruby’s speed on Windows a bit closer to the speed that’s obtainable on Linux.

For the time being, switching to Ruby 1.9.1 on Windows will give you a performance that is better than what’s obtained by those who are still using Ruby 1.8.x on Linux. If it’s possible, switch.

<!-- Social Bookmarks BEGIN -->

<!-- Social Bookmarks END -->

Images: 
My Year of Hustle & the Freckle-aversary | Rails Fire

My Year of Hustle & the Freckle-aversary

New Year’s resolutions, anyone?

Three hundred and sixty five days ago, I was drinking spiked punch and looking forward to Christmas.

Oh, and spending late, late hours in the office, busting tail to launch our time tracking service, Freckle. And working on our JavaScript performance book. (And later came Twistori Desktop for Macs.)

Even though it was December 2008, it was all part of my plan for 2009: my Year of Hustle.

Minus the punch, maybe.

Year of Hoositwhatnow?

Hustle. You know, that verb—like a fly-by-nighty who helps part fools from their money, using only his wits, walnut shells, and one little green pea.

Wait, no. Wrong definition.

In my sexy, twisted dictionary, hustling means taking advantage of every advantage you have, creating awesome goods, and selling ‘em. Shaking your moneymaker, metaphorically speaking. Yes, it involves money, but not sleaze.

My goal for 2009 was to ring in 2010 able to live off my income from products and services exclusively—products and services being something I created, mine mine mine. In fact, I really meant it as anything but exchanging one hour of work for one hour of pay. (The sad mathematics for helping other people get rich off your skillz.)

Since I was golden-handcuffed to consulting at the time, this was no small undertaking. I knew I was in for a lot of trial and error, hypothesis, tests, and analysis. I’d never sold a product or subscription service myself before, much less built one on the side.

Thus, the hustle.

I almost made it.

The results?

One year ago today, we launched Freckle to the world.

Today, even if we never touched it again, Freckle would earn over $60,000 for us in the coming year.

And, a mere 11 months ago, Thomas and I released the beta book of JavaScript Performance Rocks! Since then, we’ve sold over $30,000 worth of ebooks.

We’ve also put on a couple expert-level JavaScript workshops, which have done just fine. We have three more booked for the next year—two, inside megacorps, and one open to the public in Philadelphia at the end of January.

So, yeah, I almost made it.

It’s almost there, but not quite. The Freckle revenue we split with our partners. They’ve more than earned it. The book, of course, is money that Thomas and I share.

It’s not enough to live on. Not yet.

Inside my head, on this anniversary, I’m talking to myself, and the conversation goes something like this:

Voice One: So, self, how’s it feel to fall short of your goals? Your goal for an entire year?

Voice Two: Just fine, self. I made huge progress. It’s clearly a viable approach. All in all, I’m well-pleased by the results.

Voice One: *incomprehensible spluttering signaling the bursting of the Self-Righteous Snark Bubble*

Would I liked to have met my goal? Does a bear shit in the woods and then proceed to frolic with rolls of suspiciously cuddly toilet paper?

Hell yeah.

But I’m not weeping the bitter tears of disappointment because…

This is my philosophy on goals: Goals are not so much for meeting, but for spurring. They’re there to poke you in the ribs with their sharp little metal spokes, and yell “Giddyup!

I did make a lot of progress, stacked against some pretty ridiculous circumstances. (For the record, I recommend neither traveling for 9.5 weeks with limited internet access, nor being sick for nearly three straight months.)

When it comes down to brass tacks—and, let’s face it, it’s either brass tacks or brass monkeyballs, so you know which I’d choose—I take full responsibility for not fulfilling the fuck out of my Year of Hustle.

But the magic of the thing is that I can see that I could have. I could have made it aaaaaaall the way.

I coulda been a contenda.

If only I’d worked more regularly on that ill-fated trip.

If only I’d been less indulgent with my own moodiness.

If only I’d press-ganged my fellow Frecklers into shipping the timer, and invoicing, sooner.

If only I’d spent less money, and taken on less outside paying work.

If only I’d been more rigorous about defending my health, and said “no thanks” to so many conferences (where I caught something that left me shivering and mewling, every damn time).

If only I’d marketed more. Wrote more articles, did more interviews, giveaways, redesigned the blog, sent more useful email tips. And asked for the sale.

Out of overspending, wallowing, globetrotting & constant flu, my biggest regret: Not. Enough. Marketing.

That last one really is the big one. Oh, yeah, I should have worked more diligently on that longass, soul-sucking trip. And fewer conferences looks like a good plan on paper. And, yes, I should have been more of a manager.

But, like I said, Not Enough Marketing is the one that really gets me. Because I know the secret.

The secret is:

I could have doubled what we made, if only I’d marketed some more.

I know it, because, holy crap, look at the results we’ve gotten with almost no marketing. I didn’t send out press releases, email bloggers, or do contests. I haven’t done interviews or guest-written on any popular sites. No promotions, no freebies, no nothing.

I posted to my blog, and I sent out a few emails, and a couple people have posted about us ever so briefly on their blogs.

It’s not nothing, but it’s not much, and it was almost all left to chance.

Because of me.

A dirty-mouthed wise lady once said, spend four times as much time on marketing as creating.

If I’d hewed to her wisdom, I would have reached my goal. And maybe then some.

I’m still pleased!

But whatever! Live and learn. I’m writing this with a smile on my face.

Maybe my projects aren’t earning as much as I would have liked, but look at the results. I have projects to discuss.

Before this push for the Year of Hustle, I had never completed (or really even begun) my own software, and never shipped any kind of product on my own.

Today, I can lay claim to a Software-as-a-Service product, a book (40,000 words), and a Mac app. Not to mention groundwork laid for future endeavors.

I didn’t do all the work, don’t get me wrong. Far from it. I got to spend huge amounts of time collaborating with people I respect and care about love and think are freakin’ awesome.

People like my husband Thomas, the boys at abloom, Dave Martorana, Samo Korosec, and Dana Vachon. To name only a few.

We’re crafting our better futures, and forging our own independence, together.

And I think that’s a pretty fucking great outcome for any year.

Are you gonna be hustlin’ come 2010?”

I asked on Twitter:

raise your tweet-hand if you want to change your life in 2010, by starting your own business or side-project?

And got lots of replies to the order of: Yes, me!

What about you?