Created
June 23, 2011 05:12
-
-
Save sagmor/1041943 to your computer and use it in GitHub Desktop.
Patched Ruby 1.9.2 for faster load and GC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby 1.9 Fast require: | |
# https://gist.github.com/1008945 | |
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > load.patch | |
# Ruby 1.9.2 GC Patch: | |
# https://gist.github.com/856296 | |
curl https://raw.github.com/gist/856296/a19ac26fe7412ef398bd9f57e61f06fef1f186fe/patch-1.9.2-gc.patch > gc.patch | |
rvm install 1.9.2-p180 --patch load.patch,gc.patch | |
rm gc.patch load.patch | |
# Config GC on RVM | |
# from http://metaskills.net/2011/03/09/gc-tune-ruby-1.9.2-with-rvm/ | |
mkdir $rvm_path/hooks | |
cat <<EOF > $rvm_path/hooks/after_use | |
case "\$rvm_ruby_string" in | |
*ree*|*1.9.2-p180*) | |
export RUBY_HEAP_MIN_SLOTS=1000000 | |
export RUBY_HEAP_SLOTS_INCREMENT=1000000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=1000000000 | |
export RUBY_HEAP_FREE_MIN=500000 | |
export RUBY_FREE_MIN=$RUBY_HEAP_FREE_MIN | |
;; | |
*) | |
unset RUBY_HEAP_MIN_SLOTS RUBY_HEAP_SLOTS_INCREMENT RUBY_HEAP_SLOTS_GROWTH_FACTOR RUBY_GC_MALLOC_LIMIT RUBY_HEAP_FREE_MIN RUBY_FREE_MIN | |
;; | |
esac | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment