-
-
Save dx7/1083894 to your computer and use it in GitHub Desktop.
Patched Ruby 1.9.2 for faster load and GC
This file contains hidden or 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
# Just run: | |
# bash < <(curl -Ls https://raw.github.com/gist/1083894) | |
# Update and cleanup RVM | |
rvm get head | |
rvm reload | |
rvm cleanup all | |
# Ruby 1.9 Fast require: | |
# https://gist.github.com/1008945 | |
curl -L https://raw.github.com/gist/1008945 > /tmp/load.patch | |
# Ruby 1.9.2 GC Patch: | |
# https://gist.github.com/856296 | |
curl -L https://raw.github.com/gist/856296 > /tmp/gc.patch | |
rvm install 1.9.2-p180 --patch /tmp/load.patch,/tmp/gc.patch -n loadgc | |
rm /tmp/gc.patch /tmp/load.patch | |
# Config GC on RVM | |
# from http://metaskills.net/2011/03/09/gc-tune-ruby-1.9.2-with-rvm/ | |
mkdir -p ~/.rvm/hooks | |
cat <<EOF > ~/.rvm/hooks/after_use | |
case "\$rvm_ruby_string" in | |
*ree*|*loadgc*) | |
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 | |
rvm cleanup all | |
rvm reload | |
echo "Have Fun!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment