Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

A Complete Guide to Using RubyInline for Optimization

By Peter Cooper / September 3, 2006

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

Comments

  1. Pingback: AdSense Money Maker

Other Posts to Enjoy

Twitter Mentions