Post by Peter Cooper on September 3rd, 2006
A Complete Guide to Using RubyInline for Optimization

- Six Quick Optimization Tips for the Ruby Interpreter
- Using RubyInline to Speed Up Code By 10x
- New version of the Ruby profiler, ruby-prof, available


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

Click here to add on del.icio.us
Tweet This









March 28th, 2007 at 9:43 am
AdSense Money Maker
Do you know how to make money from AdSense automatically? You don't!? I'll teach you how!