Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Ruby 1.9.3-p194 with DTrace probes, Perf Patches, and backported COW-friendly GC


This script installs a patched version of ruby 1.9.3-p194 with DTrace probes, boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches and to Aaron Patterson for the DTrace instrumentation.


You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

Ok, let's do this!

curl | sh ; rbenv global 1.9.3-p194-dtrace

Warning: ruby*::vm_exec_core:function-* seem to be broken, causing SystemStackErrors in the ruby process you instrument.

build_package_combined_patch() {
local package_name="$1"
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make probes.h
make -j 8
make install
} >&4 2>&1
install_package "yaml-0.1.4" ""
# You can see the source for this package at
install_package "ruby-1.9.3-p194-perf-dtrace" "" combined_patch
curl$ > /tmp/$VERSION-dtrace
rbenv install /tmp/$VERSION-dtrace
Copy link

avescodes commented Oct 3, 2012


I'm getting a peculiar error trying to run your "let's do this" command.

Output is

Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/ryan/.rbenv/versions/1.9.3-p194-dtrace
/usr/local/bin/ruby-build: line 84: pushd: ruby-1.9.3-p194-perf-dtrace: No such file or directory


Inspect or clean up the working tree at /var/folders/m5/m0m3b1g57jld72xq8r390s780000gn/T/ruby-build.20121003113313.90111
Results logged to /var/folders/m5/m0m3b1g57jld72xq8r390s780000gn/T/ruby-build.20121003113313.90111.log

Last 10 log lines:
x build/benchmark/other-lang/loop2.rb
x build/benchmark/other-lang/
x build/benchmark/other-lang/
x build/benchmark/other-lang/tak.rb
x build/benchmark/other-lang/tak.scm
x build/bcc32/configure.bat
x build/bcc32/Makefile.sub
x build/bcc32/mkexports.rb
x build/bcc32/README.bcc32
x build/bcc32/setup.mak

Looks like libyaml compiled, then it blows up when starting to decompress ruby.

Copy link

avescodes commented Oct 3, 2012

Seems like the tar for ruby extracts to build instead of ruby-1.9.3-p194-perf-dtrace as ruby-build is expecting.

Copy link

jeremy commented Oct 11, 2012

Changing the ruby-build definition to

install_package "build" "" combined_patch


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment