REE Cuts Rails Test Time in Half
Ruby Enterprise Edition (REE)
I spent the night after work switching our build/stage server to Ruby Enterprise Edition. I switched both our Hudson based builds and our Passenger staging servers.
REE is well known for it’s superior garbage collection and memory management, but I was shocked to see how much faster it executed in Ruby CPU-bound contexts. We saw about a 55% drop in runtime, taking our average build times from 55min to 30min.
Build/Test Times Cut Almost in Half
Performance Drill-down
- Unit Tests: From 1036s to 579s (to run 3880 tests)
- Functional Tests: From 844s to 448s (to run 860 tests)
- Cucumber Tests: From 498s to 255s (to run 1078 steps)
The nginx/REE/Passenger stack is known as the best of breed production Rails stack, but I can’t believe how much of a benefit we’ve gotten from introducing the same components into our build and staging systems.
This effort was initially a functional testing pass to verify our system performed correctly under REE, I never expected to achieve such massive performance gains on it’s own merits.
Tips/Tricks & Gotchas
- RVM is the best way to test/incrementally introduce a new ruby interpreter
- If you’re using bundler w/ file-system bundles (via –path) you need to completely rebuild them when you switch Ruby interpreters
- If you have a previous Passenger Apache module installer, you need to rebuild/reinstall the REE based Apache module
Footnotes:
Original Ruby Version
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
REE Version
ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02