Using C to Tune Your Ruby (or Rails) Application
summary
Shows how to rewrite numeric hot spots in C using the ruby-inline gem, traditional C extensions built with mkmf and gcc, and the ruby-to-c translator; demonstrates a factorial benchmark where plain Ruby runs ~2 requests/sec while inline C runs about 50 reqs/sec after compilation and native extensions match that speed. Covers practical gotchas: run sudo make install, place inline code in lib to avoid dev reloads, manage manual frees for C-allocated memory.
AI-written summary · about
chapters (19)
- 0:00Intro
- 7:35Why C
- 15:45Make file
- 16:30Practical tip
- 17:26Sample C
- 28:55Inline C
- 31:12Running the code
- 32:49Who codes it
- 33:24Installation
- 34:04Sample Code
- 34:58Ruby Forge
- 37:15Rails
- 37:55Log
- 38:48Testing
- 45:09Inline Code
- 45:39Reload
- 46:57Rexml vs Livexml
- 48:04Performance Implications
- 49:17Questions








