I have a machine that was provisioned several months ago. RVM was used to install ruby 1.9.3-p125 as well as 1.9.3-p125-perf. When I compared raw ruby performance to another identical machine the older machine smoked them.

For example:

With in-block needle calculation
Rehearsal ----------------------------------------------
detect       3.790000   0.000000   3.790000 (  3.800895)
each         2.410000   0.000000   2.410000 (  2.420860)
any          3.960000   0.000000   3.960000 (  3.972099)
include      1.440000   0.000000   1.440000 (  1.442862)
------------------------------------ total: 11.600000sec


With in-block needle calculation
Rehearsal ----------------------------------------------
detect      10.740000   0.000000  10.740000 ( 10.769366)
each         6.080000   0.010000   6.090000 (  6.106323)
any         10.600000   0.000000  10.600000 ( 10.641606)
include      4.160000   0.000000   4.160000 (  4.171530)
------------------------------------ total: 31.590000sec

I attempted to reinstall 1.9.3-p125 with rvm on the fast machine and that ruby is now slow. It's as if something changed in RVM, or I installed some package that made compiled versions of ruby perform significantly worse.

I know this is a tough question to answer, but what things should I look into in order to track down why the performance has suffered so much?


I just attempted to install with ruby-build and the version installed was fast. Something rvm is doing to build it in my environment is slow.


The problem has to do with some of the defaults that RVM uses. Two things make a big difference, --disable-shared and --patch cflags.patch

cflags.patch only exists for 1.9.3-p194 and p286 and is automatically added now.

rvm get head && rvm reinstall 1.9.3-p194 --disable-shared --debug

You should see cflags.patch get applied.

If you want the falcon patch too you need to do:

rvm get head && rvm reinstall 1.9.3-p194-perf --patch cflags.patch --patch falcon.diff --disable-shared --debug

Information from: https://github.com/wayneeseguin/rvm/issues/1240

  • the second patch arg is ignored, it should be: --patch cflags.patch,falcon.diff – knoopx Nov 7 '12 at 14:54
  • @knoopx, that doesn't actually appear to be true. Running with --debug shows both patches applied. I wasn't able to get the comma to work when I tried it last. – Aaron Jensen Nov 8 '12 at 18:27
  • My RVM head (1.16.18) works this way: gist.github.com/4045173 – knoopx Nov 9 '12 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.