Making your ruby fly
alisnic.net
alisnic.net
If you're using rbenv, you can pass CFLAGS to it on the command line, like so: `CFLAGS='-O2' rbenv install ...`
time bundle exec parallel_rspec spec/
...
778 examples, 0 failures, 28 pendings
Before - OS X (2.4GHz Core Duo 2): Took 319.461302 seconds
real 5m26.322s
user 6m16.837s
sys 0m7.062s
After - OS X (2.4GHz Core Duo 2): Took 123.58472 seconds
real 2m7.208s
user 2m19.427s
sys 0m5.414s
Before - Ubuntu (1.8GHz AMD Phenom quad core) Took 247.467126561 seconds
real 4m8.867s
user 9m41.552s
sys 0m6.188s
After - Ubuntu (1.8GHz AMD Phenom quad core) Took 90.244449901 seconds
real 1m32.865s
user 3m41.434s
sys 0m6.136sNearly factor of 3 improvement.
I think I'll repost this link next week when more people are in work mode. It could save a lot of time and CPU cycles for a lot of people. It's a shame the default isn't better (not sure if it is RVM issue or the Ruby package itself or if I can configure a user/system default build config).
It is indeed a shame the defaults aren't better. I wonder if there's a reason that it's not default. If not, maybe a pull request is warranted.
Also, a big part of falcon patch is the ruby 2.0 garbage collector, which obviously will be available in ruby 2.0.
`rvm install ruby-1.9.3-p286 --patch falcon -n falcon`