Session
Use C to Tune Your Rails Application
Jared Richardson, Consultant
Track: Ruby
Date: Thursday, July 26
Time: 1:45pm
- 2:30pm
Location: Portland 255
Ruby and Rails run faster everyday, but we still encounter situations where we need more performance than we can get from today's Ruby VM. Integrating C with Ruby code is a great way to obliterate performance bottlenecks.
You'll leave this session with a good understanding of how to use two technologies to integrate Ruby and C. We'll use the RubyInline as well as create a C extension, and we'll use both from Rails to show how a small amount of C code can make your Rails application sing. Here's a short outline of some of the topics covered:
Why should I use C?
- to access legacy libraries
- to improve performance
How can I use C?
- RubyInline (http://www.zenspider.com/ZSS/Products/RubyInline/)
- C Extensions (http://www.rubycentral.com/book/ext_ruby.html; http://www.jaredrichardson.net/blog/2006/03/25/)
Show me
- We'll take a pre-written Rails app that does a decent amount of server side computation (~10 to 30 seconds)
- First we'll use RubyInline to show the simple case
- Second we'll demonstrate a complete C extension
I don't plan on covering profiling tools that would expose these bottlenecks, but will provide some pointers to resources.





















