Post by Peter Cooper on September 3rd, 2006

A Complete Guide to Using RubyInline for Optimization

Eric Hodel has put together a great guide to optimizing Ruby code with RubyInline and ruby-prof, a code profiler.

Here's how I optimized png.rb to make PNG saving over 100 times faster using RubyInline. This is a good model to follow to make any ruby program faster.

The basic steps are to optimizing code are:

1. Profile
2. Find the method taking the most time
3. Try one change to make it faster
4. Profile
5. Check for improvement
* No improvement? Not enough improvement? Remove your change, go to step 3
* Improvement? Go to step 1

[Post to Twitter] Tweet This

One Response to “A Complete Guide to Using RubyInline for Optimization”

  1. #1
    AdSense Money Maker Says:

    AdSense Money Maker

    Do you know how to make money from AdSense automatically? You don't!? I'll teach you how!