Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

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 https://raw.github.com/gist/1688857/rbenv.sh | sh ; rbenv global 1.9.3-p327-perf

BONUS!

Putting the following in your shell config (eg. ~/.bash_profile) will make Rails even faster, but will increase its memory footprint. For most applications, this will probably work well for you:

export RUBY_GC_MALLOC_LIMIT=60000000
export RUBY_FREE_MIN=200000

If you have a particularly large rails app (say, >100k lines), this seems to improve it even more:

export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_FREE_MIN=500000
export RUBY_HEAP_MIN_SLOTS=40000

More BONUS!

If you're feeling adventurous, you can set some additional compile flags before you run the command above. These may cause the build to fail. If so, you can try again without the march flag, and it'll probably work. This generally makes my ruby ~1.5% faster. See http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel for more guidance. I had to change it to -march=core2 on my Macbook Air 2011/11".

export CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer"

This has to be run BEFORE you compile ruby.

build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/gist/4136373/falcon-gc.diff | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
}
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
install_package "ruby-1.9.3-p327" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz" combined_patch
VERSION="1.9.3-p327"
curl https://raw.github.com/gist/1688857/2-$VERSION-patched.sh > /tmp/$VERSION-perf
rbenv install /tmp/$VERSION-perf
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Jan 28, 2012

Wow :) it is great :) thank you

Wow :) it is great :) thank you

@teoulas

This comment has been minimized.

Show comment Hide comment
@teoulas

teoulas Jan 28, 2012

Very nice! The difference in rails boot time is significant. Waiting for these patches to land in the next ruby release :)

teoulas commented Jan 28, 2012

Very nice! The difference in rails boot time is significant. Waiting for these patches to land in the next ruby release :)

@dlupu

This comment has been minimized.

Show comment Hide comment
@dlupu

dlupu Jan 28, 2012

Thanks for sharing that. Indeed the speed increase is quite impressive! I've tested the time it take to run some rspec test before and after. Here are the results:

Before: Finished in 402.79 seconds (3521 examples, 3 failures, 39 pending)
After: Finished in 222,82 seconds (3521 examples, 3 failures, 39 pending). WOOW!

However installation of the patch was not as straightforward as you suggested (I'm using rvm). The first error I got:

 sh: cannot create /home/dorian/.rvm/patches/ruby/1.9.3/p0/falcon.patch: Directory nonexistent

The solution was to manually create the folder /home/dorian/.rvm/patches/ruby/1.9.3/p0. The second error I got:

ERROR: Unrecognized command line argument: 'falcon.patch' ( see: 'rvm usage' )

I've fixed that by manualy running the following command:

rvm install 1.9.3-perf --patch $rvm_path/patches/ruby/1.9.3/p0/falcon.patch

Thanks again for your this patch!

Dorian

P.S. I've put the bonus tweaks in /etc/profile (Ubuntu)

dlupu commented Jan 28, 2012

Thanks for sharing that. Indeed the speed increase is quite impressive! I've tested the time it take to run some rspec test before and after. Here are the results:

Before: Finished in 402.79 seconds (3521 examples, 3 failures, 39 pending)
After: Finished in 222,82 seconds (3521 examples, 3 failures, 39 pending). WOOW!

However installation of the patch was not as straightforward as you suggested (I'm using rvm). The first error I got:

 sh: cannot create /home/dorian/.rvm/patches/ruby/1.9.3/p0/falcon.patch: Directory nonexistent

The solution was to manually create the folder /home/dorian/.rvm/patches/ruby/1.9.3/p0. The second error I got:

ERROR: Unrecognized command line argument: 'falcon.patch' ( see: 'rvm usage' )

I've fixed that by manualy running the following command:

rvm install 1.9.3-perf --patch $rvm_path/patches/ruby/1.9.3/p0/falcon.patch

Thanks again for your this patch!

Dorian

P.S. I've put the bonus tweaks in /etc/profile (Ubuntu)

@burke

This comment has been minimized.

Show comment Hide comment
@burke

burke Jan 28, 2012

Thanks @dlupu! I added your changes, so hopefully it'll work right away for the next rvm user to try it.

Owner

burke commented Jan 28, 2012

Thanks @dlupu! I added your changes, so hopefully it'll work right away for the next rvm user to try it.

@jfredett

This comment has been minimized.

Show comment Hide comment
@jfredett

jfredett Jan 28, 2012

I ran into the following

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

at the end of the installation, but otherwise it seemed to go well.

Obligatory benchmarks:

Test Suite on 1.9.3-p0 proper : 2m06s
Rails boot time : 9.1s

Suite on 1.9.3-p0-perf : 1m32s
Rails boot time : 6.5s

Not bad.

I ran into the following

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

at the end of the installation, but otherwise it seemed to go well.

Obligatory benchmarks:

Test Suite on 1.9.3-p0 proper : 2m06s
Rails boot time : 9.1s

Suite on 1.9.3-p0-perf : 1m32s
Rails boot time : 6.5s

Not bad.

@sxua

This comment has been minimized.

Show comment Hide comment
@sxua

sxua Jan 28, 2012

Nice:

$ time rake

before:
real 0m37.919s
user 0m6.474s
sys 0m0.919s

after:
real 0m34.236s
user 0m3.367s
sys 0m0.848s

$ time rails runner "Time.now"

before:
real 0m4.589s
user 0m3.871s
sys 0m0.629s

after:
real 0m2.437s
user 0m1.889s
sys 0m0.534s

sxua commented Jan 28, 2012

Nice:

$ time rake

before:
real 0m37.919s
user 0m6.474s
sys 0m0.919s

after:
real 0m34.236s
user 0m3.367s
sys 0m0.848s

$ time rails runner "Time.now"

before:
real 0m4.589s
user 0m3.871s
sys 0m0.629s

after:
real 0m2.437s
user 0m1.889s
sys 0m0.534s

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Jan 29, 2012

included in rvm:

rvm get head
rvm reinstall 1.9.3-p0-falcon --patch falcon -j 3

mpapis commented Jan 29, 2012

included in rvm:

rvm get head
rvm reinstall 1.9.3-p0-falcon --patch falcon -j 3
@NoICE

This comment has been minimized.

Show comment Hide comment
@NoICE

NoICE Jan 29, 2012

@mpapis

noice-macbook:~% rvm get head
...
ruby-1.9.3-p0-falcon - #fetching 
ruby-1.9.3-p0-falcon - #extracting ruby-1.9.3-p0 to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
ruby-1.9.3-p0-falcon - #extracted to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
Patch 'falcon' not found.
ruby-1.9.3-p0-falcon - #configuring 
...

It completed, but notice that message "Patch 'falcon' not found.".

But it is there...

noice-macbook:~% ls ~/.rvm/patches/ruby/1.9.3/p0/falcon.patch 
/Users/daliborfilus/.rvm/patches/ruby/1.9.3/p0/falcon.patch

running rails runner "puts \"yeah\"" yields the same speed as the base 1.9.3-p0 version...

EDIT:

I did it this way now:


noice-macbook:~/ % export patchdir=$rvm_path/patches/ruby/1.9.3/p0
noice-macbook:~/ % rvm install 1.9.3 -n falcon --patch $patchdir/falcon.patch
...
ruby-1.9.3-p0-falcon - #fetching 
ruby-1.9.3-p0-falcon - #extracting ruby-1.9.3-p0 to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
ruby-1.9.3-p0-falcon - #extracted to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
Applying patch '/Users/daliborfilus/.rvm/patches/ruby/1.9.3/p0/falcon.patch' (located at //Users/daliborfilus/.rvm/patches/ruby/1.9.3/p0/falcon.patch)
ruby-1.9.3-p0-falcon - #autoreconf

So far so good.
The difference: rvm install 1.9.3-p0-falcon --patch falcon -j 3
vs. rvm install 1.9.3 -n falcon --patch $patchdir/falcon.patch

P.S. the second variant preserves your 1.9.3 gems...

NoICE commented Jan 29, 2012

@mpapis

noice-macbook:~% rvm get head
...
ruby-1.9.3-p0-falcon - #fetching 
ruby-1.9.3-p0-falcon - #extracting ruby-1.9.3-p0 to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
ruby-1.9.3-p0-falcon - #extracted to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
Patch 'falcon' not found.
ruby-1.9.3-p0-falcon - #configuring 
...

It completed, but notice that message "Patch 'falcon' not found.".

But it is there...

noice-macbook:~% ls ~/.rvm/patches/ruby/1.9.3/p0/falcon.patch 
/Users/daliborfilus/.rvm/patches/ruby/1.9.3/p0/falcon.patch

running rails runner "puts \"yeah\"" yields the same speed as the base 1.9.3-p0 version...

EDIT:

I did it this way now:


noice-macbook:~/ % export patchdir=$rvm_path/patches/ruby/1.9.3/p0
noice-macbook:~/ % rvm install 1.9.3 -n falcon --patch $patchdir/falcon.patch
...
ruby-1.9.3-p0-falcon - #fetching 
ruby-1.9.3-p0-falcon - #extracting ruby-1.9.3-p0 to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
ruby-1.9.3-p0-falcon - #extracted to /Users/daliborfilus/.rvm/src/ruby-1.9.3-p0-falcon
Applying patch '/Users/daliborfilus/.rvm/patches/ruby/1.9.3/p0/falcon.patch' (located at //Users/daliborfilus/.rvm/patches/ruby/1.9.3/p0/falcon.patch)
ruby-1.9.3-p0-falcon - #autoreconf

So far so good.
The difference: rvm install 1.9.3-p0-falcon --patch falcon -j 3
vs. rvm install 1.9.3 -n falcon --patch $patchdir/falcon.patch

P.S. the second variant preserves your 1.9.3 gems...

@NoICE

This comment has been minimized.

Show comment Hide comment
@NoICE

NoICE Jan 29, 2012

5.5 secs instead of 8.8 secs for rails runner "puts \"omfg\""
rspec . 15.1 seconds instead of 18.2 seconds
(of course I ran those at least 3 times each, to warm file system caches)

Thanks all involved, it's nice to see ruby faster and faster :)

NoICE commented Jan 29, 2012

5.5 secs instead of 8.8 secs for rails runner "puts \"omfg\""
rspec . 15.1 seconds instead of 18.2 seconds
(of course I ran those at least 3 times each, to warm file system caches)

Thanks all involved, it's nice to see ruby faster and faster :)

@alextakitani

This comment has been minimized.

Show comment Hide comment
@alextakitani

alextakitani Jan 29, 2012

Not working with Xcode 4.2 on Lion, any tricks to make ir work or should I just install GCC?

Not working with Xcode 4.2 on Lion, any tricks to make ir work or should I just install GCC?

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Jan 29, 2012

in rvm you can read rvm requirements it should show you what to do

mpapis commented Jan 29, 2012

in rvm you can read rvm requirements it should show you what to do

@alextakitani

This comment has been minimized.

Show comment Hide comment
@alextakitani

alextakitani Jan 29, 2012

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Jan 29, 2012

are you sure you run rvm reinstall ? using --force is applying patch again, which will fail (can not apply the same patch two times)

mpapis commented Jan 29, 2012

are you sure you run rvm reinstall ? using --force is applying patch again, which will fail (can not apply the same patch two times)

@alextakitani

This comment has been minimized.

Show comment Hide comment
@alextakitani

alextakitani Jan 29, 2012

Well I'll try later with clang but worked with osx-gcc. Thanks!

Well I'll try later with clang but worked with osx-gcc. Thanks!

@mindreframer

This comment has been minimized.

Show comment Hide comment
@mindreframer

mindreframer Jan 29, 2012

BTW, it breaks the ruby-debug gem:

/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_current_thread (LoadError)
Referenced from: /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
.... such a shame....

BTW, it breaks the ruby-debug gem:

/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_current_thread (LoadError)
Referenced from: /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
.... such a shame....

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Jan 29, 2012

@mindreframer My patch didn't touch _ruby_current_thread . Could you check, if https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p0/debug.diff is applied?

@mindreframer My patch didn't touch _ruby_current_thread . Could you check, if https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p0/debug.diff is applied?

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Jan 29, 2012

there is another patch for ruby-debug:

rvm reinstall 1.9.3-falcon --patch falcon,debug --force-autoconf -j 3

do not forget to reinstall the gem after reisntalling ruby

mpapis commented Jan 29, 2012

there is another patch for ruby-debug:

rvm reinstall 1.9.3-falcon --patch falcon,debug --force-autoconf -j 3

do not forget to reinstall the gem after reisntalling ruby

@mindreframer

This comment has been minimized.

Show comment Hide comment
@mindreframer

mindreframer Jan 29, 2012

@mpapis:
Well, reinstalled with debug patch and then installed ruby-debug19 (after removing it, just installing over current didn't work).... still an error:

/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_threadptr_data_type (LoadError)
Referenced from: /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
...

Some other suggestions?

specs:
osx 10.6.6
macbook pro 2.7 GHz i7
latest rvm...

@mpapis:
Well, reinstalled with debug patch and then installed ruby-debug19 (after removing it, just installing over current didn't work).... still an error:

/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_threadptr_data_type (LoadError)
Referenced from: /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@musdom/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
...

Some other suggestions?

specs:
osx 10.6.6
macbook pro 2.7 GHz i7
latest rvm...

@mindreframer

This comment has been minimized.

Show comment Hide comment
@mindreframer

mindreframer Jan 29, 2012

just tried it with a clean gemset...
irb:

require 'ruby-debug'
LoadError: dlopen(/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_threadptr_data_type
Referenced from: /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle

just tried it with a clean gemset...
irb:

require 'ruby-debug'
LoadError: dlopen(/Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_threadptr_data_type
Referenced from: /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/roman/.rvm/gems/ruby-1.9.3-p0-falcon@global/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Jan 29, 2012

there is a thread related to the debug problem: https://gist.github.com/1329273

mpapis commented Jan 29, 2012

there is a thread related to the debug problem: https://gist.github.com/1329273

@mindreframer

This comment has been minimized.

Show comment Hide comment
@mindreframer

mindreframer Jan 29, 2012

@mpapis:
Thx a lot!

this solved it for now:

wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem

gem install linecache19-0.5.13.gem
## with rvm: 
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p0-falcon
## with rbenv (this is a guess): 
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rbenv/source/ruby-1.9.3-p0-falcon

@mpapis:
Thx a lot!

this solved it for now:

wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem

gem install linecache19-0.5.13.gem
## with rvm: 
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p0-falcon
## with rbenv (this is a guess): 
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rbenv/source/ruby-1.9.3-p0-falcon
@kandalf

This comment has been minimized.

Show comment Hide comment
@kandalf

kandalf Jan 29, 2012

For the RVM script, line 5 (rvm use 1.9.3-perf) wont work on the stable branch.
It should be changed to:
rvm 1.9.3-perf
which will work in stable and, at least, a few older versions.
The rest works great.

Thanks!

kandalf commented Jan 29, 2012

For the RVM script, line 5 (rvm use 1.9.3-perf) wont work on the stable branch.
It should be changed to:
rvm 1.9.3-perf
which will work in stable and, at least, a few older versions.
The rest works great.

Thanks!

@mscottford

This comment has been minimized.

Show comment Hide comment
@mscottford

mscottford Jan 30, 2012

When running against rvm, I got an error that "RVM is not a function, selecting rubies with 'rvm use ...' will not work." My guess is that piping the script to run in bash instead of sh would fix that, since rvm is loaded in my .bash_profile.

When running against rvm, I got an error that "RVM is not a function, selecting rubies with 'rvm use ...' will not work." My guess is that piping the script to run in bash instead of sh would fix that, since rvm is loaded in my .bash_profile.

@shanlalit

This comment has been minimized.

Show comment Hide comment
@shanlalit

shanlalit Jan 30, 2012

I'm getting -
pool_alloc.inc.h:55:2: error: #error no memalign function

On OS X 10.5.8

I'm getting -
pool_alloc.inc.h:55:2: error: #error no memalign function

On OS X 10.5.8

@joevandyk

This comment has been minimized.

Show comment Hide comment
@joevandyk

joevandyk Jan 30, 2012

One of my Rails apps, boot time (measured with ./bin/rails runner 'puts 3'

1.9.3-perf:  5.1 seconds
1.9.3-p0:    8.1 seconds
1.9.2-p290: 18.2 seconds

One of my Rails apps, boot time (measured with ./bin/rails runner 'puts 3'

1.9.3-perf:  5.1 seconds
1.9.3-p0:    8.1 seconds
1.9.2-p290: 18.2 seconds
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Jan 30, 2012

@shanlalit It seems that there is no memalign-like function in OS X before 10.6 :(

Could you check, if ruby-trunk builds on your platform? If not, than that is a reason to make a bug report at https://bugs.ruby-lang.org/projects/ruby-trunk/issues .

Additional request: could you change DEFAULT_POOL_SIZE to 4096 in pool_alloc.inc.h and then change line 55 from #error no memalign function to res = valloc(size); ?

@shanlalit It seems that there is no memalign-like function in OS X before 10.6 :(

Could you check, if ruby-trunk builds on your platform? If not, than that is a reason to make a bug report at https://bugs.ruby-lang.org/projects/ruby-trunk/issues .

Additional request: could you change DEFAULT_POOL_SIZE to 4096 in pool_alloc.inc.h and then change line 55 from #error no memalign function to res = valloc(size); ?

@doitian

This comment has been minimized.

Show comment Hide comment
@doitian

doitian Jan 31, 2012

should autoconf be autoreconf?

I use it in Arch Linux and some stdlib are missed, including socket.rb . It is fixed after reinstalling by changing autoconf to autoreconf

UPDATED: install though rbenv

doitian commented Jan 31, 2012

should autoconf be autoreconf?

I use it in Arch Linux and some stdlib are missed, including socket.rb . It is fixed after reinstalling by changing autoconf to autoreconf

UPDATED: install though rbenv

@kandalf

This comment has been minimized.

Show comment Hide comment
@kandalf

kandalf Jan 31, 2012

I use it on Arch Linux too and, with RVM, was straightforward. Except for the 'rvm use' issue I described above.

kandalf commented Jan 31, 2012

I use it on Arch Linux too and, with RVM, was straightforward. Except for the 'rvm use' issue I described above.

@gucki

This comment has been minimized.

Show comment Hide comment
@gucki

gucki Jan 31, 2012

Will this be included upstream/ in the next official ruby release?

gucki commented Jan 31, 2012

Will this be included upstream/ in the next official ruby release?

@shanlalit

This comment has been minimized.

Show comment Hide comment
@shanlalit

shanlalit Jan 31, 2012

@funny-falcon I didn't tried ruby-trunk.

I am still getting error as below, after following your suggestions.
32 pool_alloc.inc.h:55:2: error: #error no memalign function

Then I tried to re-install with the patch -
curl https://raw.github.com/gist/1688857/rvm.sh | sh
this results in two errors

  1. In .rvm/log/ruby-1.9.3-p0-perf/patch.apply.falcon.patch.log
[2012-02-01 00:27:42] patch -F 25 -p1 -N -f <"//Users/lalitshandilya/.rvm/patches/ruby/1.9.3/p0/falcon.patch" patching file common.mk Hunk #1 FAILED at 629. Hunk #2 FAILED at 693. 2 out of 2 hunks FAILED -- saving rejects to file common.mk.rej patching file configure.in Hunk #1 FAILED at 1406. 1 out of 1 hunk FAILED -- saving rejects to file configure.in.rej patching file gc.c Hunk #1 succeeded at 20 with fuzz 3. Hunk #2 succeeded at 36 with fuzz 3. Hunk #3 succeeded at 365 with fuzz 2 (offset 48 lines). Hunk #4 succeeded at 392 with fuzz 3 (offset 48 lines). Hunk #5 succeeded at 454 with fuzz 3 (offset 60 lines). Hunk #6 succeeded at 491 with fuzz 3 (offset 60 lines). Hunk #7 succeeded at 572 with fuzz 3 (offset 60 lines). Hunk #8 succeeded at 3687 with fuzz 1 (offset 2760 lines). patching file internal.h Hunk #1 succeeded at 108 with fuzz 3. patching file load.c Hunk #1 succeeded at 4 with fuzz 3. Hunk #2 succeeded at 620 with fuzz 2 (offset 601 lines). Hunk #3 FAILED at 630. Hunk #4 succeeded at 795 with fuzz 2 (offset 648 lines). Hunk #5 FAILED at 820. Hunk #6 FAILED at 847. Hunk #7 succeeded at 953 with fuzz 2 (offset 679 lines). Hunk #8 FAILED at 1124. Hunk #9 succeeded at 1749 with fuzz 1 (offset 799 lines). Hunk #10 FAILED at 1981. 5 out of 10 hunks FAILED -- saving rejects to file load.c.rej The next patch would create the file pool_alloc.h, which already exists! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file pool_alloc.h.rej The next patch would create the file pool_alloc.inc.h, which already exists! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file pool_alloc.inc.h.rej patching file ruby.c Hunk #1 FAILED at 209. Hunk #2 FAILED at 216. Hunk #3 FAILED at 337. Hunk #4 FAILED at 436. Hunk #5 FAILED at 449. Hunk #6 succeeded at 1079 with fuzz 2 (offset -267 lines). 5 out of 6 hunks FAILED -- saving rejects to file ruby.c.rej patching file st.c Hunk #1 succeeded at 7 with fuzz 3. Hunk #2 succeeded at 28 with fuzz 3. Hunk #3 FAILED at 65. Hunk #4 FAILED at 167. Hunk #5 FAILED at 243. Hunk #6 FAILED at 261. Hunk #7 FAILED at 338. Hunk #8 FAILED at 351. Hunk #9 FAILED at 392. Hunk #10 FAILED at 468. Hunk #11 FAILED at 504. Hunk #12 FAILED at 670. Hunk #13 FAILED at 714. Hunk #14 FAILED at 758. Hunk #15 FAILED at 784. Hunk #16 FAILED at 803. Hunk #17 FAILED at 827. Hunk #18 FAILED at 872. Hunk #19 FAILED at 898. Hunk #20 FAILED at 921. Hunk #21 FAILED at 949. Hunk #22 FAILED at 963. Hunk #23 FAILED at 1018. Hunk #24 FAILED at 1026. Hunk #25 succeeded at 1039 with fuzz 3. Hunk #26 FAILED at 1061. Hunk #27 FAILED at 1084. Hunk #28 FAILED at 1109. Hunk #29 FAILED at 1142. 26 out of 29 hunks FAILED -- saving rejects to file st.c.rej patching file vm.c Hunk #1 succeeded at 1575 with fuzz 3. patching file vm_core.h Hunk #1 succeeded at 298 with fuzz 3.

and 2. In .rvm/log/ruby-1.9.3-p0-perf/make.log

[2012-02-01 00:28:24] make
CC = /usr/bin/gcc-4.2
LD = ld
LDSHARED = /usr/bin/gcc-4.2 -dynamiclib
CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I. -I.ext/include/i386-darwin9.8.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/lalitshandilya/.rvm/rubies/ruby-1.9.3-p0-perf/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,Init* -Wl,-unexported_symbol,threadptr -Wl,-u,_objc_msgSend
SOLIBS =
compiling dmyencoding.c
compiling miniprelude.c
In file included from miniprelude.c:8:
vm_core.h:302: error: duplicate member 'load_path_expanded_cache'
vm_core.h:303: error: duplicate member 'load_path_expanded_cache'
make: *** [miniprelude.o] Error 1

Does it gives you any other clues on what's going on?

@funny-falcon I didn't tried ruby-trunk.

I am still getting error as below, after following your suggestions.
32 pool_alloc.inc.h:55:2: error: #error no memalign function

Then I tried to re-install with the patch -
curl https://raw.github.com/gist/1688857/rvm.sh | sh
this results in two errors

  1. In .rvm/log/ruby-1.9.3-p0-perf/patch.apply.falcon.patch.log
[2012-02-01 00:27:42] patch -F 25 -p1 -N -f <"//Users/lalitshandilya/.rvm/patches/ruby/1.9.3/p0/falcon.patch" patching file common.mk Hunk #1 FAILED at 629. Hunk #2 FAILED at 693. 2 out of 2 hunks FAILED -- saving rejects to file common.mk.rej patching file configure.in Hunk #1 FAILED at 1406. 1 out of 1 hunk FAILED -- saving rejects to file configure.in.rej patching file gc.c Hunk #1 succeeded at 20 with fuzz 3. Hunk #2 succeeded at 36 with fuzz 3. Hunk #3 succeeded at 365 with fuzz 2 (offset 48 lines). Hunk #4 succeeded at 392 with fuzz 3 (offset 48 lines). Hunk #5 succeeded at 454 with fuzz 3 (offset 60 lines). Hunk #6 succeeded at 491 with fuzz 3 (offset 60 lines). Hunk #7 succeeded at 572 with fuzz 3 (offset 60 lines). Hunk #8 succeeded at 3687 with fuzz 1 (offset 2760 lines). patching file internal.h Hunk #1 succeeded at 108 with fuzz 3. patching file load.c Hunk #1 succeeded at 4 with fuzz 3. Hunk #2 succeeded at 620 with fuzz 2 (offset 601 lines). Hunk #3 FAILED at 630. Hunk #4 succeeded at 795 with fuzz 2 (offset 648 lines). Hunk #5 FAILED at 820. Hunk #6 FAILED at 847. Hunk #7 succeeded at 953 with fuzz 2 (offset 679 lines). Hunk #8 FAILED at 1124. Hunk #9 succeeded at 1749 with fuzz 1 (offset 799 lines). Hunk #10 FAILED at 1981. 5 out of 10 hunks FAILED -- saving rejects to file load.c.rej The next patch would create the file pool_alloc.h, which already exists! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file pool_alloc.h.rej The next patch would create the file pool_alloc.inc.h, which already exists! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file pool_alloc.inc.h.rej patching file ruby.c Hunk #1 FAILED at 209. Hunk #2 FAILED at 216. Hunk #3 FAILED at 337. Hunk #4 FAILED at 436. Hunk #5 FAILED at 449. Hunk #6 succeeded at 1079 with fuzz 2 (offset -267 lines). 5 out of 6 hunks FAILED -- saving rejects to file ruby.c.rej patching file st.c Hunk #1 succeeded at 7 with fuzz 3. Hunk #2 succeeded at 28 with fuzz 3. Hunk #3 FAILED at 65. Hunk #4 FAILED at 167. Hunk #5 FAILED at 243. Hunk #6 FAILED at 261. Hunk #7 FAILED at 338. Hunk #8 FAILED at 351. Hunk #9 FAILED at 392. Hunk #10 FAILED at 468. Hunk #11 FAILED at 504. Hunk #12 FAILED at 670. Hunk #13 FAILED at 714. Hunk #14 FAILED at 758. Hunk #15 FAILED at 784. Hunk #16 FAILED at 803. Hunk #17 FAILED at 827. Hunk #18 FAILED at 872. Hunk #19 FAILED at 898. Hunk #20 FAILED at 921. Hunk #21 FAILED at 949. Hunk #22 FAILED at 963. Hunk #23 FAILED at 1018. Hunk #24 FAILED at 1026. Hunk #25 succeeded at 1039 with fuzz 3. Hunk #26 FAILED at 1061. Hunk #27 FAILED at 1084. Hunk #28 FAILED at 1109. Hunk #29 FAILED at 1142. 26 out of 29 hunks FAILED -- saving rejects to file st.c.rej patching file vm.c Hunk #1 succeeded at 1575 with fuzz 3. patching file vm_core.h Hunk #1 succeeded at 298 with fuzz 3.

and 2. In .rvm/log/ruby-1.9.3-p0-perf/make.log

[2012-02-01 00:28:24] make
CC = /usr/bin/gcc-4.2
LD = ld
LDSHARED = /usr/bin/gcc-4.2 -dynamiclib
CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I. -I.ext/include/i386-darwin9.8.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/lalitshandilya/.rvm/rubies/ruby-1.9.3-p0-perf/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,Init* -Wl,-unexported_symbol,threadptr -Wl,-u,_objc_msgSend
SOLIBS =
compiling dmyencoding.c
compiling miniprelude.c
In file included from miniprelude.c:8:
vm_core.h:302: error: duplicate member 'load_path_expanded_cache'
vm_core.h:303: error: duplicate member 'load_path_expanded_cache'
make: *** [miniprelude.o] Error 1

Does it gives you any other clues on what's going on?

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Jan 31, 2012

@shanlalit : you should remove ~/.rvm/src/ruby-1.9.3-p0-perf before trying to reinstall it.

I recommend you install https://gist.github.com/1484985 untill I fix issue with missed memalign - the main startup improvement is gained from this patch.

patchdir=$rvm_path/patches/ruby/1.9.3/p0
mkdir -p $patchdir
curl https://raw.github.com/gist/1484985/cached_lp_sorted_lf.patch > $patchdir/falcon.patch
rvm install 1.9.3 -n perf --patch $patchdir/falcon.patch
rvm use 1.9.3-perf

@shanlalit : you should remove ~/.rvm/src/ruby-1.9.3-p0-perf before trying to reinstall it.

I recommend you install https://gist.github.com/1484985 untill I fix issue with missed memalign - the main startup improvement is gained from this patch.

patchdir=$rvm_path/patches/ruby/1.9.3/p0
mkdir -p $patchdir
curl https://raw.github.com/gist/1484985/cached_lp_sorted_lf.patch > $patchdir/falcon.patch
rvm install 1.9.3 -n perf --patch $patchdir/falcon.patch
rvm use 1.9.3-perf
@le0pard

This comment has been minimized.

Show comment Hide comment
@le0pard

le0pard Feb 2, 2012

All good, but tests not runing:

$ rake --trace
** Invoke default (first_time)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
stack level too deep
/Users/leo/.rvm/gems/ruby-1.9.3-p0-perf@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => default => spec => db:test:prepare => db:abort_if_pending_migrations => environment

How to fix this?

le0pard commented Feb 2, 2012

All good, but tests not runing:

$ rake --trace
** Invoke default (first_time)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
stack level too deep
/Users/leo/.rvm/gems/ruby-1.9.3-p0-perf@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => default => spec => db:test:prepare => db:abort_if_pending_migrations => environment

How to fix this?

@le0pard

This comment has been minimized.

Show comment Hide comment
@le0pard

le0pard Feb 2, 2012

ok, all right, if I run all rake tasks with 'bundle exec'. Infinite loop only without bundler :)

le0pard commented Feb 2, 2012

ok, all right, if I run all rake tasks with 'bundle exec'. Infinite loop only without bundler :)

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 2, 2012

@le0pard , so tell me: is it bug of patch, or you have same error without patch?

@le0pard , so tell me: is it bug of patch, or you have same error without patch?

@le0pard

This comment has been minimized.

Show comment Hide comment
@le0pard

le0pard Feb 2, 2012

@funny-falcon

$ rvm use ruby-1.9.3-p0-perf
Using /Users/leo/.rvm/gems/ruby-1.9.3-p0-perf
$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
stack level too deep
/Users/leo/.rvm/gems/ruby-1.9.3-p0-perf@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => db:migrate => environment
$ bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump

le0pard commented Feb 2, 2012

@funny-falcon

$ rvm use ruby-1.9.3-p0-perf
Using /Users/leo/.rvm/gems/ruby-1.9.3-p0-perf
$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
stack level too deep
/Users/leo/.rvm/gems/ruby-1.9.3-p0-perf@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => db:migrate => environment
$ bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 2, 2012

@le0pard I emailed to you. Lets work on this error.

@le0pard I emailed to you. Lets work on this error.

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 2, 2012

It seems to be not error of patch. Following reproduce error:

rvm install 1.9.3 -n test -j 2
rvm 1.9.3-test
gem install sqlite3 rails
rails new myapp
cd myapp
rake --trace

And get following error: https://gist.github.com/1725184
As you can see there, error is reproduced even with default 1.9.3-p0 installation by rvm.
Error is not exposed when nondefault gemset is used.

As I don't know which bug is it, I created reports both in rvm and ruby:
wayneeseguin/rvm#741
http://bugs.ruby-lang.org/issues/5960

It seems to be not error of patch. Following reproduce error:

rvm install 1.9.3 -n test -j 2
rvm 1.9.3-test
gem install sqlite3 rails
rails new myapp
cd myapp
rake --trace

And get following error: https://gist.github.com/1725184
As you can see there, error is reproduced even with default 1.9.3-p0 installation by rvm.
Error is not exposed when nondefault gemset is used.

As I don't know which bug is it, I created reports both in rvm and ruby:
wayneeseguin/rvm#741
http://bugs.ruby-lang.org/issues/5960

@mleszcz

This comment has been minimized.

Show comment Hide comment
@mleszcz

mleszcz Feb 3, 2012

My rake parallel:spec went down from 68 to 38sec!!!!!!!!!! That's 44% cut off! Fantastic! THANK YOU!

mleszcz commented Feb 3, 2012

My rake parallel:spec went down from 68 to 38sec!!!!!!!!!! That's 44% cut off! Fantastic! THANK YOU!

@laurynas

This comment has been minimized.

Show comment Hide comment
@laurynas

laurynas Feb 3, 2012

I had the same problem when installing with RVM v1.9.2

Error running 'patch -F 25 -p1 -N -f

Upgraded RVM to the latest (v1.10.2):

rvm get latest

Then did:

rvm reinstall 1.9.3-falcon --patch falcon,debug --force-autoconf -j 3

Compiled and works great!!

laurynas commented Feb 3, 2012

I had the same problem when installing with RVM v1.9.2

Error running 'patch -F 25 -p1 -N -f

Upgraded RVM to the latest (v1.10.2):

rvm get latest

Then did:

rvm reinstall 1.9.3-falcon --patch falcon,debug --force-autoconf -j 3

Compiled and works great!!

@laurynas

This comment has been minimized.

Show comment Hide comment
@laurynas

laurynas Feb 3, 2012

API spec tests ~30% faster!

laurynas commented Feb 3, 2012

API spec tests ~30% faster!

@dashbitla

This comment has been minimized.

Show comment Hide comment
@dashbitla

dashbitla Feb 4, 2012

This is really cool. Would love to see this as a default in the Ruby by default.
Is this patch gonna be part of the Ruby next minor version?

This is really cool. Would love to see this as a default in the Ruby by default.
Is this patch gonna be part of the Ruby next minor version?

@jfelchner

This comment has been minimized.

Show comment Hide comment
@jfelchner

jfelchner Feb 4, 2012

time bundle exec rake environment

Before:
14.60s user 1.26s system 100% cpu 15.861 total

After:
5.11s user 1.10s system 99% cpu 6.212 total

60.8% speedup!!!!!!

After adding the additional memory tweaks:
4.02s user 1.18s system 99% cpu 5.205 total

67.1% speedup!!!!!!!!!!!!!!!

time bundle exec rake environment

Before:
14.60s user 1.26s system 100% cpu 15.861 total

After:
5.11s user 1.10s system 99% cpu 6.212 total

60.8% speedup!!!!!!

After adding the additional memory tweaks:
4.02s user 1.18s system 99% cpu 5.205 total

67.1% speedup!!!!!!!!!!!!!!!

@jasonrudolph

This comment has been minimized.

Show comment Hide comment
@jasonrudolph

jasonrudolph Feb 6, 2012

Average result of time bundle exec rake on current Rails project over 3 runs

OS X Lion on SSD

real 21.459 # before
real 17.303 # after

Ubuntu 11.04 on EC2

real 36.302 # before
real 21.961 # after

Average result of time bundle exec rake on current Rails project over 3 runs

OS X Lion on SSD

real 21.459 # before
real 17.303 # after

Ubuntu 11.04 on EC2

real 36.302 # before
real 21.961 # after
@kurko

This comment has been minimized.

Show comment Hide comment
@kurko

kurko Feb 14, 2012

Weird. On one project, 2404 examples with patched Ruby: 13m2.045s. Unpatched: 13m2.262s :(

On another project with 1000 examples, I got a 9% better performance, though.

kurko commented Feb 14, 2012

Weird. On one project, 2404 examples with patched Ruby: 13m2.045s. Unpatched: 13m2.262s :(

On another project with 1000 examples, I got a 9% better performance, though.

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 14, 2012

@kurko , I suppose, those tests produce heavy DB load, don't they?

@kurko , I suppose, those tests produce heavy DB load, don't they?

@mediafinger

This comment has been minimized.

Show comment Hide comment
@mediafinger

mediafinger Feb 14, 2012

Wow, incredible increase in start-up speed: saved me up to 40%! Thanks for sharing!

Before:

~/testproject (develop ✗) > rbfu @1.9.3-p0 time rake Activated Ruby 1.9.3-p0 (from command line) real 0m16.005s user 0m11.464s sys 0m2.446s

After:

~/testproject (develop ✗) > rbfu @1.9-patch time rake Activated Ruby 1.9-patch. (from command line) real 0m10.887s user 0m8.033s sys 0m1.702s


Btw. I am using rbfu https://github.com/hmans/rbfu (a simpler alternative to rbenv / rvm) to manage my Ruby versions. As an rbfu user you simply install your Rubies via the ruby-build script. To spare others the hassle, I added a script for that:

https://gist.github.com/1830994

Wow, incredible increase in start-up speed: saved me up to 40%! Thanks for sharing!

Before:

~/testproject (develop ✗) > rbfu @1.9.3-p0 time rake Activated Ruby 1.9.3-p0 (from command line) real 0m16.005s user 0m11.464s sys 0m2.446s

After:

~/testproject (develop ✗) > rbfu @1.9-patch time rake Activated Ruby 1.9-patch. (from command line) real 0m10.887s user 0m8.033s sys 0m1.702s


Btw. I am using rbfu https://github.com/hmans/rbfu (a simpler alternative to rbenv / rvm) to manage my Ruby versions. As an rbfu user you simply install your Rubies via the ruby-build script. To spare others the hassle, I added a script for that:

https://gist.github.com/1830994

@jrmehle

This comment has been minimized.

Show comment Hide comment
@jrmehle

jrmehle Feb 16, 2012

patch 125 is out. Does it include these performance improvements?
http://www.ruby-lang.org/en/news/2012/02/16/ruby-1-9-3-p125-is-released/

jrmehle commented Feb 16, 2012

patch 125 is out. Does it include these performance improvements?
http://www.ruby-lang.org/en/news/2012/02/16/ruby-1-9-3-p125-is-released/

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 16, 2012

No. Official ruby-1.9.3 will not add any "new features", only bug fixes - that is official position of ruby-core.
But TCS build will be released at the monday, which will be include this patches, (probably) backport of ruby-trunk's COW-friendly GC,
and improvements for Windows:

https://github.com/thecodeshop/ruby/wiki/FAQ#wiki-rbenv
https://github.com/thecodeshop/ruby/wiki/FAQ#wiki-rvm
https://github.com/thecodeshop/ruby/wiki/Downloads

No. Official ruby-1.9.3 will not add any "new features", only bug fixes - that is official position of ruby-core.
But TCS build will be released at the monday, which will be include this patches, (probably) backport of ruby-trunk's COW-friendly GC,
and improvements for Windows:

https://github.com/thecodeshop/ruby/wiki/FAQ#wiki-rbenv
https://github.com/thecodeshop/ruby/wiki/FAQ#wiki-rvm
https://github.com/thecodeshop/ruby/wiki/Downloads

@joevandyk

This comment has been minimized.

Show comment Hide comment
@joevandyk

joevandyk Feb 16, 2012

You could make the argument that severely inefficient code is a bug. :/

What is "TCS build"?

You could make the argument that severely inefficient code is a bug. :/

What is "TCS build"?

@mediafinger

This comment has been minimized.

Show comment Hide comment
@mediafinger

mediafinger Feb 16, 2012

Guess TCS stands for "The Code Shop" ;-)

Thanks for patching our beloved Ruby, so we can make love with it even faster!

Guess TCS stands for "The Code Shop" ;-)

Thanks for patching our beloved Ruby, so we can make love with it even faster!

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Feb 16, 2012

@funny-falcon we need to find a way to provide equivalent patchlevels with rvm like: tcs-1.9.3-p125

mpapis commented Feb 16, 2012

@funny-falcon we need to find a way to provide equivalent patchlevels with rvm like: tcs-1.9.3-p125

@JDutil

This comment has been minimized.

Show comment Hide comment
@JDutil

JDutil Feb 16, 2012

Should this also work for 1.9.3-p125 by simply changing the p0 references or have these patches made it into the latest 1.9.3 release?

JDutil commented Feb 16, 2012

Should this also work for 1.9.3-p125 by simply changing the p0 references or have these patches made it into the latest 1.9.3 release?

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 17, 2012

@JDutil , no, it will not. I will release updated patch as separate gist and will ask @burke to update this one.
And any way it will be available for rvm users as rvm install tcs

@JDutil , no, it will not. I will release updated patch as separate gist and will ask @burke to update this one.
And any way it will be available for rvm users as rvm install tcs

@luismreis

This comment has been minimized.

Show comment Hide comment
@luismreis

luismreis Feb 18, 2012

To run this on a recent rvm - which already knows p125 - and xcode 4.3's command_line_tools_for_xcode_.dmg installed, i.e. without gcc, you will need to change the line "rvm install..." to:

rvm install 1.9.3-p0 -n perf --patch $patchdir/falcon.patch --with-gcc=clang

To run this on a recent rvm - which already knows p125 - and xcode 4.3's command_line_tools_for_xcode_.dmg installed, i.e. without gcc, you will need to change the line "rvm install..." to:

rvm install 1.9.3-p0 -n perf --patch $patchdir/falcon.patch --with-gcc=clang
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 18, 2012

Updated patch https://raw.github.com/gist/1859082/performance_and_backport_gc.patch - refer it appropriately.
@burke, could you update your recipe?

Updated patch https://raw.github.com/gist/1859082/performance_and_backport_gc.patch - refer it appropriately.
@burke, could you update your recipe?

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Feb 18, 2012

@luismreis no need to use --with-gcc=clang as of this commit on rvm head: rvm/rvm@e075857

@funny-falcon patch available in rvm head & stable as of this commit: rvm/rvm@a0b0a66

so to get ruby-1.9.3-p125-perf it is enough to write:

rvm get head
rvm install 1.9.3-perf --patch falcon

mpapis commented Feb 18, 2012

@luismreis no need to use --with-gcc=clang as of this commit on rvm head: rvm/rvm@e075857

@funny-falcon patch available in rvm head & stable as of this commit: rvm/rvm@a0b0a66

so to get ruby-1.9.3-p125-perf it is enough to write:

rvm get head
rvm install 1.9.3-perf --patch falcon
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 18, 2012

@mpapis, thank you :) you are blazingly fast! :)

@mpapis, thank you :) you are blazingly fast! :)

@luismreis

This comment has been minimized.

Show comment Hide comment
@luismreis

luismreis Feb 18, 2012

@mpapis Awesome!

@mpapis Awesome!

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Feb 19, 2012

1.9.3-perf built without issue on Mac OS X Lion after an rvm cleanup all.

What is required to get the debugger installed under -perf?

1.9.3-perf built without issue on Mac OS X Lion after an rvm cleanup all.

What is required to get the debugger installed under -perf?

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Feb 19, 2012

This is great thank you! How can we all get the ruby-core team to reconsider their position and add this to 1.9.3?

ghost commented Feb 19, 2012

This is great thank you! How can we all get the ruby-core team to reconsider their position and add this to 1.9.3?

@burke

This comment has been minimized.

Show comment Hide comment
@burke

burke Feb 19, 2012

@funny-falcon : I changed the patch and bumped all the p0 references up to p125 -- thanks for the quick update!

Owner

burke commented Feb 19, 2012

@funny-falcon : I changed the patch and bumped all the p0 references up to p125 -- thanks for the quick update!

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 20, 2012

@martinstreicher you should apply debug patch as well:

rvm remove 1.9.3-perf
rm -R ~/.rvm/src/ruby-1.9.3-p125-perf
rvm install 1.9.3-perf --patch falcon,debug

Also look up at https://gist.github.com/1688857#gistcomment-79449

@martinstreicher you should apply debug patch as well:

rvm remove 1.9.3-perf
rm -R ~/.rvm/src/ruby-1.9.3-p125-perf
rvm install 1.9.3-perf --patch falcon,debug

Also look up at https://gist.github.com/1688857#gistcomment-79449

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Feb 20, 2012

I am guessing that 1.9.3-perf has the falcon patch already? On my machine, rvm install 1.9.3-perf --patch falcon,debug says 'falcon patch not found.' Let me try an rvm get head.

I am guessing that 1.9.3-perf has the falcon patch already? On my machine, rvm install 1.9.3-perf --patch falcon,debug says 'falcon patch not found.' Let me try an rvm get head.

@kandalf

This comment has been minimized.

Show comment Hide comment
@kandalf

kandalf Feb 20, 2012

kandalf commented Feb 20, 2012

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Feb 20, 2012

@tycooon

This comment has been minimized.

Show comment Hide comment
@tycooon

tycooon Feb 21, 2012

Im running OS X Lion 10.7.2 and I get rvm requires autoreconf to install the selected ruby interpreter however autoreconf was not found in the PATH.
I have Xcode command line tools installed but it seems there is no autoreconf on my system. Any ideas?

tycooon commented Feb 21, 2012

Im running OS X Lion 10.7.2 and I get rvm requires autoreconf to install the selected ruby interpreter however autoreconf was not found in the PATH.
I have Xcode command line tools installed but it seems there is no autoreconf on my system. Any ideas?

@ralph

This comment has been minimized.

Show comment Hide comment
@ralph

ralph Feb 21, 2012

@tycooon I hope this helps: https://gist.github.com/1868805
autotools are not installed by the Xcode command line utils :(

ralph commented Feb 21, 2012

@tycooon I hope this helps: https://gist.github.com/1868805
autotools are not installed by the Xcode command line utils :(

@burke

This comment has been minimized.

Show comment Hide comment
@burke

burke Feb 21, 2012

I had to revert the gist to p0 because ruby-debug wouldn't compile under p125, even with pull request #47. I think it has to do with ruby_core_source fetching an incompatible version of the code. The error is an incompatible type for rb_iseq_compile_with_option at line 29 of ruby_debug.c on gem install ruby-debug.

I will try to dig into this at some point in the next few days, but if anyone has a quick fix I can apply, it would be appreciated.

Owner

burke commented Feb 21, 2012

I had to revert the gist to p0 because ruby-debug wouldn't compile under p125, even with pull request #47. I think it has to do with ruby_core_source fetching an incompatible version of the code. The error is an incompatible type for rb_iseq_compile_with_option at line 29 of ruby_debug.c on gem install ruby-debug.

I will try to dig into this at some point in the next few days, but if anyone has a quick fix I can apply, it would be appreciated.

@sekrett

This comment has been minimized.

Show comment Hide comment
@sekrett

sekrett Feb 24, 2012

Then you should also update the command to:
rvm get head && rvm install 1.9.3-p0-perf --patch falcon

sekrett commented Feb 24, 2012

Then you should also update the command to:
rvm get head && rvm install 1.9.3-p0-perf --patch falcon

@tubbo

This comment has been minimized.

Show comment Hide comment
@tubbo

tubbo Feb 24, 2012

I am also having issues with ruby-debug19 even after installing 1.9.3-p125 with --patch falcon,debug

Here's the output from Bundler..

Installing ruby-debug-base19 (0.11.25) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/tom/.rvm/rubies/ruby-1.9.3-p125-perf/bin/ruby extconf.rb 
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
/Users/tom/.rvm/gems/ruby-1.9.3-p125-perf@elocal/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for insns.inc... yes
checking for insns_info.inc... yes
checking for eval_intern.h... yes
creating Makefile

make
compiling breakpoint.c
compiling ruby_debug.c
ruby_debug.c:29: error: conflicting types for ‘rb_iseq_compile_with_option’
/Users/tom/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby-1.9.3-p125/vm_core.h:505: error: previous declaration of ‘rb_iseq_compile_with_option’ was here
ruby_debug.c: In function ‘call_at_line_unprotected’:
ruby_debug.c:480: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘filename_cmp’:
ruby_debug.c:544: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c:545: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘debug_event_hook’:
ruby_debug.c:872: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘optional_frame_position’:
ruby_debug.c:1732: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘do_jump’:
ruby_debug.c:2346: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘context_jump’:
ruby_debug.c:2414: warning: comparison between signed and unsigned
ruby_debug.c:2428: warning: comparison between signed and unsigned
make: *** [ruby_debug.o] Error 1


Gem files will remain installed in /Users/tom/.rvm/gems/ruby-1.9.3-p125-perf@elocal/gems/ruby-debug-base19-0.11.25 for inspection.
Results logged to /Users/tom/.rvm/gems/ruby-1.9.3-p125-perf@elocal/gems/ruby-debug-base19-0.11.25/ext/ruby_debug/gem_make.out
An error occured while installing ruby-debug-base19 (0.11.25), and Bundler cannot continue.
Make sure that `gem install ruby-debug-base19 -v '0.11.25'` succeeds before bundling.

tubbo commented Feb 24, 2012

I am also having issues with ruby-debug19 even after installing 1.9.3-p125 with --patch falcon,debug

Here's the output from Bundler..

Installing ruby-debug-base19 (0.11.25) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/tom/.rvm/rubies/ruby-1.9.3-p125-perf/bin/ruby extconf.rb 
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
/Users/tom/.rvm/gems/ruby-1.9.3-p125-perf@elocal/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for insns.inc... yes
checking for insns_info.inc... yes
checking for eval_intern.h... yes
creating Makefile

make
compiling breakpoint.c
compiling ruby_debug.c
ruby_debug.c:29: error: conflicting types for ‘rb_iseq_compile_with_option’
/Users/tom/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby-1.9.3-p125/vm_core.h:505: error: previous declaration of ‘rb_iseq_compile_with_option’ was here
ruby_debug.c: In function ‘call_at_line_unprotected’:
ruby_debug.c:480: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘filename_cmp’:
ruby_debug.c:544: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c:545: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘debug_event_hook’:
ruby_debug.c:872: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘optional_frame_position’:
ruby_debug.c:1732: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘do_jump’:
ruby_debug.c:2346: warning: implicit conversion shortens 64-bit value into a 32-bit value
ruby_debug.c: In function ‘context_jump’:
ruby_debug.c:2414: warning: comparison between signed and unsigned
ruby_debug.c:2428: warning: comparison between signed and unsigned
make: *** [ruby_debug.o] Error 1


Gem files will remain installed in /Users/tom/.rvm/gems/ruby-1.9.3-p125-perf@elocal/gems/ruby-debug-base19-0.11.25 for inspection.
Results logged to /Users/tom/.rvm/gems/ruby-1.9.3-p125-perf@elocal/gems/ruby-debug-base19-0.11.25/ext/ruby_debug/gem_make.out
An error occured while installing ruby-debug-base19 (0.11.25), and Bundler cannot continue.
Make sure that `gem install ruby-debug-base19 -v '0.11.25'` succeeds before bundling.
@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Feb 24, 2012

mpapis commented Feb 24, 2012

@tubbo

This comment has been minimized.

Show comment Hide comment
@tubbo

tubbo Feb 24, 2012

@mpapis even with the debug patch removed, i still get this same error.

tubbo commented Feb 24, 2012

@mpapis even with the debug patch removed, i still get this same error.

@vadim-v

This comment has been minimized.

Show comment Hide comment
@vadim-v

vadim-v Feb 25, 2012

After installing this patched version in addition to improved performance I'm constantly getting this:

RAILS_ENV=test rake db:seed
[BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16) [x86_64-linux]
Segmentation fault

Running Ubuntu 11.10, x64, + rvm. Any ides why this is happening?

vadim-v commented Feb 25, 2012

After installing this patched version in addition to improved performance I'm constantly getting this:

RAILS_ENV=test rake db:seed
[BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16) [x86_64-linux]
Segmentation fault

Running Ubuntu 11.10, x64, + rvm. Any ides why this is happening?

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 25, 2012

@vadim-v yeah, excuse me for that. I found a mistake at the time you were writing comment. I just fixed it at https://gist.github.com/1859082

@vadim-v yeah, excuse me for that. I found a mistake at the time you were writing comment. I just fixed it at https://gist.github.com/1859082

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Feb 25, 2012

Error happens only on very process exit finish, so I hope it were not so harmful.
I've made pull request to rvm with fix, hope it will be merged soon.

Error happens only on very process exit finish, so I hope it were not so harmful.
I've made pull request to rvm with fix, hope it will be merged soon.

@vadim-v

This comment has been minimized.

Show comment Hide comment
@vadim-v

vadim-v Feb 25, 2012

@funny-falcon Thanks for the fix, looking forward to see it merged.

vadim-v commented Feb 25, 2012

@funny-falcon Thanks for the fix, looking forward to see it merged.

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Feb 25, 2012

had it merged few hours ago, it is available in rvm head

mpapis commented Feb 25, 2012

had it merged few hours ago, it is available in rvm head

@vadim-v

This comment has been minimized.

Show comment Hide comment
@vadim-v

vadim-v Feb 26, 2012

works fine for me now, thanks a lot

vadim-v commented Feb 26, 2012

works fine for me now, thanks a lot

@stjernstrom

This comment has been minimized.

Show comment Hide comment
@stjernstrom

stjernstrom Feb 29, 2012

Awesome! Gives me 58-60% boost in startup time.

Before

time -p bundle exec rake environment
  real 6.81
  user 5.93
  sys 0.85

After

time -p bundle exec rake environment
  real 3.75
  user 2.82
  sys 0.91

I have about 280 gems in my Gemfile.lock and around 80 in Gemfile

Awesome! Gives me 58-60% boost in startup time.

Before

time -p bundle exec rake environment
  real 6.81
  user 5.93
  sys 0.85

After

time -p bundle exec rake environment
  real 3.75
  user 2.82
  sys 0.91

I have about 280 gems in my Gemfile.lock and around 80 in Gemfile

@Karunakar

This comment has been minimized.

Show comment Hide comment
@Karunakar

Karunakar Mar 2, 2012

Awesome..

Awesome..

@tycooon

This comment has been minimized.

Show comment Hide comment
@tycooon

tycooon Mar 2, 2012

@ralph thanks, that helped!

tycooon commented Mar 2, 2012

@ralph thanks, that helped!

@kedvictor

This comment has been minimized.

Show comment Hide comment
@kedvictor

kedvictor Mar 5, 2012

$ time bundle exec rspec -f d spec

====== ruby-1.9.2 =============================

Finished in 12.72 seconds
165 examples, 0 failures, 1 pending

real 0m47.060s
user 0m39.926s
sys 0m2.040s

====== ruby-1.9.3-p125-fast ===================

Finished in 6.71 seconds
165 examples, 0 failures, 1 pending

real 0m11.974s
user 0m11.009s
sys 0m0.904s

====== ruby-1.9.3-p125-fast + .bash_profile ===

Finished in 6.19 seconds
165 examples, 0 failures, 1 pending

real 0m11.601s
user 0m10.685s
sys 0m0.888s

Summary:
Real time: 4 times speedup!
.bash_profile: insignificant effect

$ time bundle exec rspec -f d spec

====== ruby-1.9.2 =============================

Finished in 12.72 seconds
165 examples, 0 failures, 1 pending

real 0m47.060s
user 0m39.926s
sys 0m2.040s

====== ruby-1.9.3-p125-fast ===================

Finished in 6.71 seconds
165 examples, 0 failures, 1 pending

real 0m11.974s
user 0m11.009s
sys 0m0.904s

====== ruby-1.9.3-p125-fast + .bash_profile ===

Finished in 6.19 seconds
165 examples, 0 failures, 1 pending

real 0m11.601s
user 0m10.685s
sys 0m0.888s

Summary:
Real time: 4 times speedup!
.bash_profile: insignificant effect

@stjernstrom

This comment has been minimized.

Show comment Hide comment
@stjernstrom

stjernstrom Mar 5, 2012

@kedvictor if i am not completely lost, these patches will decrease the boot/load time of rails only. I bet that the 4 seconds you see is from rails boot.

@kedvictor if i am not completely lost, these patches will decrease the boot/load time of rails only. I bet that the 4 seconds you see is from rails boot.

@emerencia

This comment has been minimized.

Show comment Hide comment
@emerencia

emerencia Mar 5, 2012

I applied these patches and then compiled Ruby under Windows:

Before

sh-3.1$ time rails runner "puts"
real    0m52.477s
user    0m0.000s
sys     0m0.031s

After

sh-3.1$ time rails runner "puts"
real    0m24.150s
user    0m0.015s
sys     0m0.000s

I applied these patches and then compiled Ruby under Windows:

Before

sh-3.1$ time rails runner "puts"
real    0m52.477s
user    0m0.000s
sys     0m0.031s

After

sh-3.1$ time rails runner "puts"
real    0m24.150s
user    0m0.015s
sys     0m0.000s
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Mar 6, 2012

@emerencia , if you work under Windows, you'd better look at TheCodeShop , it includes this patches, as well as some specifically targeted to Windows.

@emerencia , if you work under Windows, you'd better look at TheCodeShop , it includes this patches, as well as some specifically targeted to Windows.

@emerencia

This comment has been minimized.

Show comment Hide comment
@emerencia

emerencia Mar 6, 2012

@funny-falcon Very nice, that's another 3 seconds faster for me:

sh-3.1$ time rails runner "puts"
real    0m20.320s
user    0m0.000s
sys     0m0.015s

Edit: and using Fenix takes off another 5 seconds:

real    0m15.472s
user    0m0.000s
sys     0m0.015s

@funny-falcon Very nice, that's another 3 seconds faster for me:

sh-3.1$ time rails runner "puts"
real    0m20.320s
user    0m0.000s
sys     0m0.015s

Edit: and using Fenix takes off another 5 seconds:

real    0m15.472s
user    0m0.000s
sys     0m0.015s
@timtyrrell

This comment has been minimized.

Show comment Hide comment
@timtyrrell

timtyrrell Mar 6, 2012

I am having an issue when trying to compile some of that ruby debug hokey pokey. I will keep digging into it. (I have tried it with and without the debug patch)

rvm get head
rvm install 1.9.3-perf --patch falcon

gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p125-pref
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-base19-0.11.26.gem:
ERROR: Failed to build gem native extension.

    /Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/bin/ruby extconf.rb --with-ruby-include=/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref

checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

mkmf.log:

have_struct_member: checking for rb_method_entry_t.called_id in method.h... -------------------- no

"/usr/bin/gcc-4.2 -o conftest -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby/backward -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1 -I. -I/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref -I/Users/ttyrrell/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/lib -L/Users/ttyrrell/.rvm/usr/lib -L. -lruby.1.9.1 -lpthread -ldl -lobjc "
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: int main() {return 0;}
/
end */

"/usr/bin/gcc-4.2 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby/backward -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1 -I. -I/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref -I/Users/ttyrrell/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe -c conftest.c"
conftest.c:3:20: error: method.h: No such file or directory
conftest.c:7: error: ‘rb_method_entry_t’ undeclared here (not in a function)
conftest.c:7: error: expected expression before ‘)’ token
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <method.h>
4:
5: /top/
6: int main() {return 0;}
7: int s = (char *)&((rb_method_entry_t
)0)->called_id - (char )0;
/
end */


have_struct_member: checking for rb_control_frame_t.method_id in method.h... -------------------- no

"/usr/bin/gcc-4.2 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby/backward -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1 -I. -I/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref -I/Users/ttyrrell/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe -c conftest.c"
conftest.c:3:20: error: method.h: No such file or directory
conftest.c:7: error: ‘rb_control_frame_t’ undeclared here (not in a function)
conftest.c:7: error: expected expression before ‘)’ token
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <method.h>
4:
5: /top/
6: int main() {return 0;}
7: int s = (char *)&((rb_control_frame_t
)0)->method_id - (char )0;
/
end */


I am having an issue when trying to compile some of that ruby debug hokey pokey. I will keep digging into it. (I have tried it with and without the debug patch)

rvm get head
rvm install 1.9.3-perf --patch falcon

gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p125-pref
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-base19-0.11.26.gem:
ERROR: Failed to build gem native extension.

    /Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/bin/ruby extconf.rb --with-ruby-include=/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref

checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

mkmf.log:

have_struct_member: checking for rb_method_entry_t.called_id in method.h... -------------------- no

"/usr/bin/gcc-4.2 -o conftest -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby/backward -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1 -I. -I/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref -I/Users/ttyrrell/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/lib -L/Users/ttyrrell/.rvm/usr/lib -L. -lruby.1.9.1 -lpthread -ldl -lobjc "
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: int main() {return 0;}
/
end */

"/usr/bin/gcc-4.2 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby/backward -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1 -I. -I/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref -I/Users/ttyrrell/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe -c conftest.c"
conftest.c:3:20: error: method.h: No such file or directory
conftest.c:7: error: ‘rb_method_entry_t’ undeclared here (not in a function)
conftest.c:7: error: expected expression before ‘)’ token
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <method.h>
4:
5: /top/
6: int main() {return 0;}
7: int s = (char *)&((rb_method_entry_t
)0)->called_id - (char )0;
/
end */


have_struct_member: checking for rb_control_frame_t.method_id in method.h... -------------------- no

"/usr/bin/gcc-4.2 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1/ruby/backward -I/Users/ttyrrell/.rvm/rubies/ruby-1.9.3-p125-perf/include/ruby-1.9.1 -I. -I/Users/ttyrrell/.rvm/src/ruby-1.9.3-p125-pref -I/Users/ttyrrell/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe -c conftest.c"
conftest.c:3:20: error: method.h: No such file or directory
conftest.c:7: error: ‘rb_control_frame_t’ undeclared here (not in a function)
conftest.c:7: error: expected expression before ‘)’ token
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <method.h>
4:
5: /top/
6: int main() {return 0;}
7: int s = (char *)&((rb_control_frame_t
)0)->method_id - (char )0;
/
end */


@vadim-v

This comment has been minimized.

Show comment Hide comment
@vadim-v

vadim-v Mar 6, 2012

@timtyrrell Seems like you have typo in last word:

gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p125-pref

should be '...-p125-perf'
and not '...-p125-pref'

vadim-v commented Mar 6, 2012

@timtyrrell Seems like you have typo in last word:

gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p125-pref

should be '...-p125-perf'
and not '...-p125-pref'

@timtyrrell

This comment has been minimized.

Show comment Hide comment
@timtyrrell

timtyrrell Mar 6, 2012

@vadim-v you were right! Works now :)

@vadim-v you were right! Works now :)

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Mar 6, 2012

@burke , I've updated https://gist.github.com/1859082 so that ruby-debug19 now compiles (rb_iseq_compile_with_option was my fault: I've touch Changelog, which forces revision.h to be overwritten, that forces ruby-debug to assume wrong ruby version) . Could you check it?

@burke , I've updated https://gist.github.com/1859082 so that ruby-debug19 now compiles (rb_iseq_compile_with_option was my fault: I've touch Changelog, which forces revision.h to be overwritten, that forces ruby-debug to assume wrong ruby version) . Could you check it?

@burke

This comment has been minimized.

Show comment Hide comment
@burke

burke Mar 6, 2012

@funny-falcon awesome! I'll try it out and update my gist this afternoon. Thanks!

Owner

burke commented Mar 6, 2012

@funny-falcon awesome! I'll try it out and update my gist this afternoon. Thanks!

@kreeger

This comment has been minimized.

Show comment Hide comment
@kreeger

kreeger Mar 22, 2012

On my system (which has Xcode 4.3 and the new separate Xcode command line tools package installed), kastiglione's fork worked for me, and not this one (I'm fairly certain this is because he omits require_gcc from his ruby build script; gcc isn't installed by the command line tools package, and instead is linked to llvm. 1.9.3-p125 is the first Ruby release to officially support LLVM instead of just clang).

kreeger commented Mar 22, 2012

On my system (which has Xcode 4.3 and the new separate Xcode command line tools package installed), kastiglione's fork worked for me, and not this one (I'm fairly certain this is because he omits require_gcc from his ruby build script; gcc isn't installed by the command line tools package, and instead is linked to llvm. 1.9.3-p125 is the first Ruby release to officially support LLVM instead of just clang).

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Mar 22, 2012

@Kreeg, be careful, 1.9.3-p125 was claimed to be supported with LLVM - but still magic errors appear and things might fail randomly. I heard situation has proven for 1.9.3-head.

mpapis commented Mar 22, 2012

@Kreeg, be careful, 1.9.3-p125 was claimed to be supported with LLVM - but still magic errors appear and things might fail randomly. I heard situation has proven for 1.9.3-head.

@kreeger

This comment has been minimized.

Show comment Hide comment
@kreeger

kreeger Mar 22, 2012

@mpapis Yuck. Thanks for the heads-up, I'll keep an eye out.

kreeger commented Mar 22, 2012

@mpapis Yuck. Thanks for the heads-up, I'll keep an eye out.

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Mar 22, 2012

@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis Mar 22, 2012

@martinstreicher no there is no yet, but the one from p125 should work fine (@funny-falcon any news for the patch?):

rvm install 1.9.3-head --patch $rvm_path/patches/ruby/1.9.3/p125/falcon.patch -j 3

mpapis commented Mar 22, 2012

@martinstreicher no there is no yet, but the one from p125 should work fine (@funny-falcon any news for the patch?):

rvm install 1.9.3-head --patch $rvm_path/patches/ruby/1.9.3/p125/falcon.patch -j 3
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Mar 22, 2012

@mpapis, I'm busy at new work a bit, but I'll try to sync all my patches at weekend.

@mpapis, I'm busy at new work a bit, but I'll try to sync all my patches at weekend.

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Mar 22, 2012

@felixbuenemann

This comment has been minimized.

Show comment Hide comment
@felixbuenemann

felixbuenemann Mar 30, 2012

That would be because the method to patch is no longer there:

Wed Feb 22 08:11:06 2012 Narihiro Nakamura authornari@gmail.com

* gc.c : remove gc_clear_mark_on_sweep_slots() and use
  rest_sweep() instead of it, because some dead objects might be
  marked in next the mark phase by false pointers.
  [ruby-core:42672]

That would be because the method to patch is no longer there:

Wed Feb 22 08:11:06 2012 Narihiro Nakamura authornari@gmail.com

* gc.c : remove gc_clear_mark_on_sweep_slots() and use
  rest_sweep() instead of it, because some dead objects might be
  marked in next the mark phase by false pointers.
  [ruby-core:42672]
@jeremyw

This comment has been minimized.

Show comment Hide comment
@jeremyw

jeremyw Apr 4, 2012

For those still having trouble with ruby-debug19, check out @cldwalker's fork (renamed to debugger). I'm using it with the falcon patchset.

https://github.com/cldwalker/debugger

jeremyw commented Apr 4, 2012

For those still having trouble with ruby-debug19, check out @cldwalker's fork (renamed to debugger). I'm using it with the falcon patchset.

https://github.com/cldwalker/debugger

@pjg

This comment has been minimized.

Show comment Hide comment
@pjg

pjg Apr 26, 2012

@funny-falcon any chance for your patch for the official 1.9.3-p194?

pjg commented Apr 26, 2012

@funny-falcon any chance for your patch for the official 1.9.3-p194?

@sj26

This comment has been minimized.

Show comment Hide comment
@sj26

sj26 Apr 27, 2012

Please don't use https://github.com/ruby/ruby/pull/47.diff any more, instead substitute ruby-debug19 with debugger per @jeremyw's suggestion.

sj26 commented Apr 27, 2012

Please don't use https://github.com/ruby/ruby/pull/47.diff any more, instead substitute ruby-debug19 with debugger per @jeremyw's suggestion.

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Apr 27, 2012

@pjg, yes, I'll form it at weekend. In fact, it is in http://github.com/thecodeshop/ruby repository. tcs-ruby_1_9_3 branch contains all peaces united as well as other (not mine) patches which affect performance on Windows platform.
But ultrapacking (for hashes of size 1) isn't there yet. I'll add it at weekend and publish patch then.

@pjg, yes, I'll form it at weekend. In fact, it is in http://github.com/thecodeshop/ruby repository. tcs-ruby_1_9_3 branch contains all peaces united as well as other (not mine) patches which affect performance on Windows platform.
But ultrapacking (for hashes of size 1) isn't there yet. I'll add it at weekend and publish patch then.

@pjg

This comment has been minimized.

Show comment Hide comment
@pjg

pjg Apr 27, 2012

@funny-falcon great! Thank you very much!

pjg commented Apr 27, 2012

@funny-falcon great! Thank you very much!

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Apr 27, 2012

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher Apr 27, 2012

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon May 4, 2012

https://gist.github.com/2593385

curl https://raw.github.com/gist/2593385/perf_and_gc.diff > perf_and_gc.diff
rvm install 1.9.3-falcon --patch ./perf_and_gc.diff -j 3

https://gist.github.com/2593385

curl https://raw.github.com/gist/2593385/perf_and_gc.diff > perf_and_gc.diff
rvm install 1.9.3-falcon --patch ./perf_and_gc.diff -j 3
@mpapis

This comment has been minimized.

Show comment Hide comment
@mpapis

mpapis May 4, 2012

it's now in RVM:

rvm get head && rvm reinstall 1.9.3-p194 --patch falcon

or:

rvm get stable && rvm reinstall 1.9.3-p194 --patch falcon

mpapis commented May 4, 2012

it's now in RVM:

rvm get head && rvm reinstall 1.9.3-p194 --patch falcon

or:

rvm get stable && rvm reinstall 1.9.3-p194 --patch falcon
@sekrett

This comment has been minimized.

Show comment Hide comment
@sekrett

sekrett May 5, 2012

Wow, it is even faster than p125-perf.

sekrett commented May 5, 2012

Wow, it is even faster than p125-perf.

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon May 5, 2012

@sekrett, it could be possibly because plain ruby-p194 faster than p125, this patch remains almost same.

@sekrett, it could be possibly because plain ruby-p194 faster than p125, this patch remains almost same.

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon May 5, 2012

@mpapis, thank you.

@mpapis, thank you.

@martinstreicher

This comment has been minimized.

Show comment Hide comment
@martinstreicher

martinstreicher May 5, 2012

@cvincent

This comment has been minimized.

Show comment Hide comment
@cvincent

cvincent Jun 30, 2012

@funny-falcon this is excellent in my dev environment, thanks! Now is there a method for installing it without rbenv or rvm? I'd like to try it out in a production environment where I use a straight Ruby build without rbenv or rvm.

@funny-falcon this is excellent in my dev environment, thanks! Now is there a method for installing it without rbenv or rvm? I'd like to try it out in a production environment where I use a straight Ruby build without rbenv or rvm.

@mediafinger

This comment has been minimized.

Show comment Hide comment
@mediafinger

mediafinger Jun 30, 2012

Here you find a script to install it without using rbenv or rvm: https://gist.github.com/1830994

You may need to update it to the latest version.

Here you find a script to install it without using rbenv or rvm: https://gist.github.com/1830994

You may need to update it to the latest version.

@cvincent

This comment has been minimized.

Show comment Hide comment
@cvincent

cvincent Jun 30, 2012

I ended up figuring it out, and wrote a Sprinkle package:

package :ruby193_falcon do
  description "Ruby Virtual Machine"
  version "1.9.3"

  install_steps = [
    "cd /usr/local/build/ruby-1.9.3-p194 && AUTOCONF=/usr/bin/autoconf ./configure > ruby193_falcon-configure.log 2>&1",
    "cd /usr/local/build/ruby-1.9.3-p194 && AUTOCONF=/usr/bin/autoconf make > ruby193_falcon-build.log 2>&1",
    "cd /usr/local/build/ruby-1.9.3-p194 && AUTOCONF=/usr/bin/autoconf make install > ruby193_falcon-install.log 2>&1"
  ]

  source "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz", custom_install: install_steps do
    pre :configure, "wget https://raw.github.com/wayneeseguin/rvm/master/patches/ruby/1.9.3/p194/falcon.diff && patch -p1 < falcon.diff > ruby193_falcon-patch.log 2>&1"
    post :install, "gem update --system"
  end

  requires :ruby_deps

  verify do
    has_executable "ruby"
  end
end

I ended up figuring it out, and wrote a Sprinkle package:

package :ruby193_falcon do
  description "Ruby Virtual Machine"
  version "1.9.3"

  install_steps = [
    "cd /usr/local/build/ruby-1.9.3-p194 && AUTOCONF=/usr/bin/autoconf ./configure > ruby193_falcon-configure.log 2>&1",
    "cd /usr/local/build/ruby-1.9.3-p194 && AUTOCONF=/usr/bin/autoconf make > ruby193_falcon-build.log 2>&1",
    "cd /usr/local/build/ruby-1.9.3-p194 && AUTOCONF=/usr/bin/autoconf make install > ruby193_falcon-install.log 2>&1"
  ]

  source "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz", custom_install: install_steps do
    pre :configure, "wget https://raw.github.com/wayneeseguin/rvm/master/patches/ruby/1.9.3/p194/falcon.diff && patch -p1 < falcon.diff > ruby193_falcon-patch.log 2>&1"
    post :install, "gem update --system"
  end

  requires :ruby_deps

  verify do
    has_executable "ruby"
  end
end
@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Jul 1, 2012

@cvincent Consider adding https://gist.github.com/2981959 to your package: that patch could smooths EventMachin's performance a bit under high load.

@cvincent Consider adding https://gist.github.com/2981959 to your package: that patch could smooths EventMachin's performance a bit under high load.

@cvincent

This comment has been minimized.

Show comment Hide comment
@cvincent

cvincent Jul 1, 2012

@funny-falcon Yeah it looks like "Array as queue" performance improvements would be helpful in general. I know that I certainly use methods like #push, #pop, and #shift all the time. Thanks for all your work on these patches! The improvements in boot time have brought much joy to my day-to-day.

cvincent commented Jul 1, 2012

@funny-falcon Yeah it looks like "Array as queue" performance improvements would be helpful in general. I know that I certainly use methods like #push, #pop, and #shift all the time. Thanks for all your work on these patches! The improvements in boot time have brought much joy to my day-to-day.

@burke

This comment has been minimized.

Show comment Hide comment
@burke

burke Aug 11, 2012

Wow, I totally forgot about this gist. Sorry, I've updated it for p194 now. Thanks again for the patches :)

Owner

burke commented Aug 11, 2012

Wow, I totally forgot about this gist. Sorry, I've updated it for p194 now. Thanks again for the patches :)

@samgranieri

This comment has been minimized.

Show comment Hide comment
@samgranieri

samgranieri Aug 12, 2012

why do we need require_gcc for 1.9.3p-194 in rbenv?

why do we need require_gcc for 1.9.3p-194 in rbenv?

@dogweather

This comment has been minimized.

Show comment Hide comment
@dogweather

dogweather Aug 21, 2012

The RVM recipe worked perfectly for me. Thanks for keeping it updated.

How can we help get this pulled into the master branch?

The RVM recipe worked perfectly for me. Thanks for keeping it updated.

How can we help get this pulled into the master branch?

@julian7

This comment has been minimized.

Show comment Hide comment
@julian7

julian7 Aug 22, 2012

mountain lion + xcode4.4.1 + brew install autoconf + remove require_gcc == win

julian7 commented Aug 22, 2012

mountain lion + xcode4.4.1 + brew install autoconf + remove require_gcc == win

@burke

This comment has been minimized.

Show comment Hide comment
@burke

burke Aug 22, 2012

Thanks @samgranieri and @julian7, I forgot that line was in there. I've updated the gist.

Owner

burke commented Aug 22, 2012

Thanks @samgranieri and @julian7, I forgot that line was in there. I've updated the gist.

@davefp

This comment has been minimized.

Show comment Hide comment
@davefp

davefp Aug 24, 2012

I would change the 'install XCode' to reference the Command Line Tools instead. See my fork here: https://gist.github.com/3453141/76972c7185b579f5542d12cf56eae8d068c908ca

davefp commented Aug 24, 2012

I would change the 'install XCode' to reference the Command Line Tools instead. See my fork here: https://gist.github.com/3453141/76972c7185b579f5542d12cf56eae8d068c908ca

@seangeo

This comment has been minimized.

Show comment Hide comment
@seangeo

seangeo Sep 11, 2012

This patch is available in rvm stable, so if you don't want to live on the edge you can do rvm get stable instead.

seangeo commented Sep 11, 2012

This patch is available in rvm stable, so if you don't want to live on the edge you can do rvm get stable instead.

@funny-falcon

This comment has been minimized.

Show comment Hide comment
@funny-falcon

funny-falcon Sep 14, 2012

@arikfr

This comment has been minimized.

Show comment Hide comment
@arikfr

arikfr Sep 25, 2012

@burke I think you should update your instructions to use RVM stable rather than head, because the patch is already available in RVM stable and at the moment head seems quite unstable. It took me lots of digging and trial and error until I figured that I failed to compile Ruby with this patch because I was on the head version rather stable.

arikfr commented Sep 25, 2012

@burke I think you should update your instructions to use RVM stable rather than head, because the patch is already available in RVM stable and at the moment head seems quite unstable. It took me lots of digging and trial and error until I figured that I failed to compile Ruby with this patch because I was on the head version rather stable.

@whalesalad

This comment has been minimized.

Show comment Hide comment
@whalesalad

whalesalad Sep 27, 2012

VERY cool! Here are my before stats, the base 1.9.3-p194:

mwhalen at Ajax in ~/Sites/askherzl on master!
± time rails r "puts 1"
Connecting to database specified by database.yml
1
rails r "puts 1"  4.23s user 1.19s system 54% cpu 10.009 total

And here is the same command after installing the patch, adding the suggested lines to my ~/.zshrc and re-running bundle:

mwhalen at Ajax in ~/Sites/askherzl on master!
± time rails r "puts 1"
Connecting to database specified by database.yml
1
rails r "puts 1"  2.95s user 0.90s system 58% cpu 6.549 total

That's pretty much an exact 35% increase in performance. Installing gem's feels a great deal quicker as well.

VERY cool! Here are my before stats, the base 1.9.3-p194:

mwhalen at Ajax in ~/Sites/askherzl on master!
± time rails r "puts 1"
Connecting to database specified by database.yml
1
rails r "puts 1"  4.23s user 1.19s system 54% cpu 10.009 total

And here is the same command after installing the patch, adding the suggested lines to my ~/.zshrc and re-running bundle:

mwhalen at Ajax in ~/Sites/askherzl on master!
± time rails r "puts 1"
Connecting to database specified by database.yml
1
rails r "puts 1"  2.95s user 0.90s system 58% cpu 6.549 total

That's pretty much an exact 35% increase in performance. Installing gem's feels a great deal quicker as well.

@dvandersluis

This comment has been minimized.

Show comment Hide comment
@dvandersluis

dvandersluis Sep 28, 2012

Any idea why execution would actually be slower with this patch? Using RVM on a retina MBP:

ruby-1.9.3-p194:

$ time rails runner 'puts 3'
real    0m7.454s
user    0m6.481s
sys 0m0.957s

ruby-1.9.3-p194-perf:

$ time rails runner 'puts 3'
real    0m12.410s
user    0m11.347s
sys 0m1.036s

ruby-1.9.3-p194-perf with exports

$ time rails runner 'puts 3'
real    0m9.609s
user    0m8.344s
sys 0m1.250s

Any idea why execution would actually be slower with this patch? Using RVM on a retina MBP:

ruby-1.9.3-p194:

$ time rails runner 'puts 3'
real    0m7.454s
user    0m6.481s
sys 0m0.957s

ruby-1.9.3-p194-perf:

$ time rails runner 'puts 3'
real    0m12.410s
user    0m11.347s
sys 0m1.036s

ruby-1.9.3-p194-perf with exports

$ time rails runner 'puts 3'
real    0m9.609s
user    0m8.344s
sys 0m1.250s
@guange2015

This comment has been minimized.

Show comment Hide comment
@guange2015

guange2015 Sep 29, 2012

@dvandersluis
the same with you.

@dvandersluis
the same with you.

@ryansch

This comment has been minimized.

Show comment Hide comment
@ryansch

ryansch Oct 1, 2012

Should we be using falcon's new patch now?

ryansch commented Oct 1, 2012

Should we be using falcon's new patch now?

@dvandersluis

This comment has been minimized.

Show comment Hide comment
@dvandersluis

dvandersluis Oct 3, 2012

I tried benchmarking falcon's new patch on top of vanilla 1.9.3-p194 against 1.9.3-p194-perf: (using avgtime):

$ rvm current && avgtime -q -r5 -d -p rails runner "puts 1"
ruby-1.9.3-p194-perf

------------------------
Total time (ms): 46419.8
Repetitions    : 5
Sample mode    : 9320 (1 ocurrences)
Median time    : 9282.5
Avg time       : 9283.95
Std dev.       : 23.6096
Minimum        : 9257.65
Maximum        : 9321.53
95% conf.int.  : [9237.68, 9330.23]  e = 46.2739
99% conf.int.  : [9223.14, 9344.77]  e = 60.8142
EstimatedAvg95%: [9263.26, 9304.65]  e = 20.6943
EstimatedAvg99%: [9256.76, 9311.15]  e = 27.1969
Sorted times   : 
    [9257.65, 9261.26, 9282.5, 9296.83, 9321.53]

$ rvm current && avgtime -q -r5 -d -p rails runner "puts 1"
ruby-1.9.3-p194-falcon-new

------------------------
Total time (ms): 35149.3
Repetitions    : 5
Sample mode    : 6970 (2 ocurrences)
Median time    : 7032.1
Avg time       : 7029.87
Std dev.       : 52.5191
Minimum        : 6970.93
Maximum        : 7113.02
95% conf.int.  : [6926.93, 7132.8]  e = 102.936
99% conf.int.  : [6894.59, 7165.15]  e = 135.28
EstimatedAvg95%: [6983.83, 7075.9]  e = 46.0342
EstimatedAvg99%: [6969.37, 7090.37]  e = 60.4991
Sorted times   : 
    [6970.93, 6977.6, 7032.1, 7055.69, 7113.02]

I tried benchmarking falcon's new patch on top of vanilla 1.9.3-p194 against 1.9.3-p194-perf: (using avgtime):

$ rvm current && avgtime -q -r5 -d -p rails runner "puts 1"
ruby-1.9.3-p194-perf

------------------------
Total time (ms): 46419.8
Repetitions    : 5
Sample mode    : 9320 (1 ocurrences)
Median time    : 9282.5
Avg time       : 9283.95
Std dev.       : 23.6096
Minimum        : 9257.65
Maximum        : 9321.53
95% conf.int.  : [9237.68, 9330.23]  e = 46.2739
99% conf.int.  : [9223.14, 9344.77]  e = 60.8142
EstimatedAvg95%: [9263.26, 9304.65]  e = 20.6943
EstimatedAvg99%: [9256.76, 9311.15]  e = 27.1969
Sorted times   : 
    [9257.65, 9261.26, 9282.5, 9296.83, 9321.53]

$ rvm current && avgtime -q -r5 -d -p rails runner "puts 1"
ruby-1.9.3-p194-falcon-new

------------------------
Total time (ms): 35149.3
Repetitions    : 5
Sample mode    : 6970 (2 ocurrences)
Median time    : 7032.1
Avg time       : 7029.87
Std dev.       : 52.5191
Minimum        : 6970.93
Maximum        : 7113.02
95% conf.int.  : [6926.93, 7132.8]  e = 102.936
99% conf.int.  : [6894.59, 7165.15]  e = 135.28
EstimatedAvg95%: [6983.83, 7075.9]  e = 46.0342
EstimatedAvg99%: [6969.37, 7090.37]  e = 60.4991
Sorted times   : 
    [6970.93, 6977.6, 7032.1, 7055.69, 7113.02]
@aaronjensen

This comment has been minimized.

Show comment Hide comment
@aaronjensen

aaronjensen Nov 6, 2012

There are some issues w/ RVM when installing these. If you rename the ruby (by calling it 1.9.3-perf) or whatever, it won't include the cflags patch. So you'll actually lose quite a bit of performance doing this. Be sure to include --patch cflags.patch Also it is best to include --disable-shared

There are some issues w/ RVM when installing these. If you rename the ruby (by calling it 1.9.3-perf) or whatever, it won't include the cflags patch. So you'll actually lose quite a bit of performance doing this. Be sure to include --patch cflags.patch Also it is best to include --disable-shared

@caarlos0

This comment has been minimized.

Show comment Hide comment
@caarlos0

caarlos0 Nov 30, 2012

kewl! will surely test it when I get home. Thanks for hard work.

kewl! will surely test it when I get home. Thanks for hard work.

@caarlos0

This comment has been minimized.

Show comment Hide comment
@caarlos0

caarlos0 Nov 30, 2012

kewl! will surely test it when I get home. Thanks for hard work.

kewl! will surely test it when I get home. Thanks for hard work.

@rwz

This comment has been minimized.

Show comment Hide comment
@rwz

rwz Nov 30, 2012

BUILD FAILED

Inspect or clean up the working tree at /var/folders/50/nmb34mx94js1fd1z_s5fl8pr0000gn/T/ruby-build.20121130224625.6476
Results logged to /var/folders/50/nmb34mx94js1fd1z_s5fl8pr0000gn/T/ruby-build.20121130224625.6476.log

Last 10 log lines:
ossl_x509store.c:520: warning: ‘X509_STORE_CTX_set_flags’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:464)
ossl_x509store.c: In function ‘ossl_x509stctx_set_purpose’:
ossl_x509store.c:532: warning: ‘X509_STORE_CTX_set_purpose’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:460)
ossl_x509store.c: In function ‘ossl_x509stctx_set_trust’:
ossl_x509store.c:544: warning: ‘X509_STORE_CTX_set_trust’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:461)
ossl_x509store.c: In function ‘ossl_x509stctx_set_time’:
ossl_x509store.c:561: warning: ‘X509_STORE_CTX_set_time’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:466)
linking shared-object dl/callback.bundle
linking shared-object openssl.bundle
make: *** [build-ext] Error 2

rwz commented Nov 30, 2012

BUILD FAILED

Inspect or clean up the working tree at /var/folders/50/nmb34mx94js1fd1z_s5fl8pr0000gn/T/ruby-build.20121130224625.6476
Results logged to /var/folders/50/nmb34mx94js1fd1z_s5fl8pr0000gn/T/ruby-build.20121130224625.6476.log

Last 10 log lines:
ossl_x509store.c:520: warning: ‘X509_STORE_CTX_set_flags’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:464)
ossl_x509store.c: In function ‘ossl_x509stctx_set_purpose’:
ossl_x509store.c:532: warning: ‘X509_STORE_CTX_set_purpose’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:460)
ossl_x509store.c: In function ‘ossl_x509stctx_set_trust’:
ossl_x509store.c:544: warning: ‘X509_STORE_CTX_set_trust’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:461)
ossl_x509store.c: In function ‘ossl_x509stctx_set_time’:
ossl_x509store.c:561: warning: ‘X509_STORE_CTX_set_time’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:466)
linking shared-object dl/callback.bundle
linking shared-object openssl.bundle
make: *** [build-ext] Error 2
@cannikin

This comment has been minimized.

Show comment Hide comment
@cannikin

cannikin Nov 30, 2012

Mother of God...

Running this patch against p327 is working. I'm running RVM. Here are my steps (pretty simple):

brew install autoconf automake
curl https://raw.github.com/gist/4136373/falcon-gc.diff > $rvm_path/patches/ruby/1.9.3/p327/falcon.patch
rvm install 1.9.3-p327 -n fast --patch falcon

Then recreate my gemsets and bundle of course.

Benchmarks?

p286:

time rake
...
real    0m48.761s
user    0m41.117s
sys     0m3.561s

time rails runner puts 'foobar'
....
real    0m4.939s
user    0m4.210s
sys     0m0.719s

p327 + patch:

time rake
...
real    0m20.775s
user    0m15.543s
sys     0m2.208s

time rails runner puts 'foobar'
...
real    0m2.610s
user    0m2.047s
sys     0m0.553s

Greatest patch ever!!

Mother of God...

Running this patch against p327 is working. I'm running RVM. Here are my steps (pretty simple):

brew install autoconf automake
curl https://raw.github.com/gist/4136373/falcon-gc.diff > $rvm_path/patches/ruby/1.9.3/p327/falcon.patch
rvm install 1.9.3-p327 -n fast --patch falcon

Then recreate my gemsets and bundle of course.

Benchmarks?

p286:

time rake
...
real    0m48.761s
user    0m41.117s
sys     0m3.561s

time rails runner puts 'foobar'
....
real    0m4.939s
user    0m4.210s
sys     0m0.719s

p327 + patch:

time rake
...
real    0m20.775s
user    0m15.543s
sys     0m2.208s

time rails runner puts 'foobar'
...
real    0m2.610s
user    0m2.047s
sys     0m0.553s

Greatest patch ever!!

@duff

This comment has been minimized.

Show comment Hide comment
@duff

duff Dec 1, 2012

This is really great. I ran a few benchmarks against 2 separate apps. We're seeing a 28% - 49% speed increase depending on the test!

duff commented Dec 1, 2012

This is really great. I ran a few benchmarks against 2 separate apps. We're seeing a 28% - 49% speed increase depending on the test!

@davidcelis

This comment has been minimized.

Show comment Hide comment
@davidcelis

davidcelis Dec 6, 2012

The rbenv installation gets build failures on Mountain Lion:

~Code/goodbre.ws master % curl https://raw.github.com/gist/1688857/rbenv.sh | sh ; rbenv global 1.9.3-p327-perf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   138  100   138    0     0    180      0 --:--:-- --:--:-- --:--:--   467
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   448  100   448    0     0   1194      0 --:--:-- --:--:-- --:--:--  1539
Downloading yaml-0.1.4.tar.gz...
-> http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/david/.rbenv/versions/1.9.3-p327-perf

Downloading ruby-1.9.3-p327.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
Installing ruby-1.9.3-p327...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/tt/0zgjrcdd4zn0pvfmmp4s9n600000gq/T/ruby-build.20121206132529.63012
Results logged to /var/folders/tt/0zgjrcdd4zn0pvfmmp4s9n600000gq/T/ruby-build.20121206132529.63012.log

Last 10 log lines:
ossl_x509store.c: In function ‘ossl_x509stctx_set_flags’:
ossl_x509store.c:520: warning: ‘X509_STORE_CTX_set_flags’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:464)
ossl_x509store.c: In function ‘ossl_x509stctx_set_purpose’:
ossl_x509store.c:532: warning: ‘X509_STORE_CTX_set_purpose’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:460)
ossl_x509store.c: In function ‘ossl_x509stctx_set_trust’:
ossl_x509store.c:544: warning: ‘X509_STORE_CTX_set_trust’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:461)
ossl_x509store.c: In function ‘ossl_x509stctx_set_time’:
ossl_x509store.c:561: warning: ‘X509_STORE_CTX_set_time’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:466)
linking shared-object openssl.bundle
make: *** [build-ext] Error 2

The rbenv installation gets build failures on Mountain Lion:

~Code/goodbre.ws master % curl https://raw.github.com/gist/1688857/rbenv.sh | sh ; rbenv global 1.9.3-p327-perf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   138  100   138    0     0    180      0 --:--:-- --:--:-- --:--:--   467
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   448  100   448    0     0   1194      0 --:--:-- --:--:-- --:--:--  1539
Downloading yaml-0.1.4.tar.gz...
-> http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/david/.rbenv/versions/1.9.3-p327-perf

Downloading ruby-1.9.3-p327.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
Installing ruby-1.9.3-p327...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/tt/0zgjrcdd4zn0pvfmmp4s9n600000gq/T/ruby-build.20121206132529.63012
Results logged to /var/folders/tt/0zgjrcdd4zn0pvfmmp4s9n600000gq/T/ruby-build.20121206132529.63012.log

Last 10 log lines:
ossl_x509store.c: In function ‘ossl_x509stctx_set_flags’:
ossl_x509store.c:520: warning: ‘X509_STORE_CTX_set_flags’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:464)
ossl_x509store.c: In function ‘ossl_x509stctx_set_purpose’:
ossl_x509store.c:532: warning: ‘X509_STORE_CTX_set_purpose’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:460)
ossl_x509store.c: In function ‘ossl_x509stctx_set_trust’:
ossl_x509store.c:544: warning: ‘X509_STORE_CTX_set_trust’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:461)
ossl_x509store.c: In function ‘ossl_x509stctx_set_time’:
ossl_x509store.c:561: warning: ‘X509_STORE_CTX_set_time’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:466)
linking shared-object openssl.bundle
make: *** [build-ext] Error 2
@davidcelis

This comment has been minimized.

Show comment Hide comment
@davidcelis

davidcelis Dec 6, 2012

Looks like the problem was that my CONFIGURE_OPTS weren't getting picked up. If you're getting build failures on OSX, install it with the following so that it gets compiled correctly with support for the right OpenSSL and Readline libs:

brew install openssl readline
curl https://raw.github.com/gist/1688857/2-$VERSION-patched.sh > /tmp/1.9.3-p327-perf
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`" rbenv install /tmp/1.9.3-p327-perf

Looks like the problem was that my CONFIGURE_OPTS weren't getting picked up. If you're getting build failures on OSX, install it with the following so that it gets compiled correctly with support for the right OpenSSL and Readline libs:

brew install openssl readline
curl https://raw.github.com/gist/1688857/2-$VERSION-patched.sh > /tmp/1.9.3-p327-perf
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`" rbenv install /tmp/1.9.3-p327-perf
@davidcelis

This comment has been minimized.

Show comment Hide comment
@davidcelis

davidcelis Dec 6, 2012

Boy I sure wish that gist comments were editable. That should have been:

brew install openssl readline
curl https://raw.github.com/gist/1688857/2-1.9.3-p327-patched.sh > /tmp/1.9.3-p327-perf
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`" rbenv install /tmp/1.9.3-p327-perf

Boy I sure wish that gist comments were editable. That should have been:

brew install openssl readline
curl https://raw.github.com/gist/1688857/2-1.9.3-p327-patched.sh > /tmp/1.9.3-p327-perf
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`" rbenv install /tmp/1.9.3-p327-perf
@jeroenj

This comment has been minimized.

Show comment Hide comment
@jeroenj

jeroenj Jan 2, 2013

Is this patch still relevant for 1.9.3-p362?

As expected applying it to p362 doesn't work.

jeroenj commented Jan 2, 2013

Is this patch still relevant for 1.9.3-p362?

As expected applying it to p362 doesn't work.

@kaspergrubbe

This comment has been minimized.

Show comment Hide comment
@kaspergrubbe

kaspergrubbe Jan 6, 2013

I got issues when compiling, and I would see this:

checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: C compiler cannot create executables

I tracked down the issue to the "-march=native"-flag. When removed or changed to "-march=nocona" (on my Late 2008 Macbook with a Intel Core 2 Duo running Mountain Lion) it worked just fine.

I hope others won't hit this bug by reading this, because it has costed me some time tracking it down.

I got issues when compiling, and I would see this:

checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: C compiler cannot create executables

I tracked down the issue to the "-march=native"-flag. When removed or changed to "-march=nocona" (on my Late 2008 Macbook with a Intel Core 2 Duo running Mountain Lion) it worked just fine.

I hope others won't hit this bug by reading this, because it has costed me some time tracking it down.

@agis

This comment has been minimized.

Show comment Hide comment
@agis

agis Feb 6, 2013

Mountain Lion+RVM users follow instructions by @cannikin.

agis commented Feb 6, 2013

Mountain Lion+RVM users follow instructions by @cannikin.

@NielsKSchjoedt

This comment has been minimized.

Show comment Hide comment
@NielsKSchjoedt

NielsKSchjoedt Feb 24, 2013

And if you are getting Error running 'make ' you might have to append --with-gcc=gcc so the line looks like: ``rvm install 1.9.3-p327 -n fast --patch falcon --with-gcc=gcc`

And if you are getting Error running 'make ' you might have to append --with-gcc=gcc so the line looks like: ``rvm install 1.9.3-p327 -n fast --patch falcon --with-gcc=gcc`

@krohrbaugh

This comment has been minimized.

Show comment Hide comment
@krohrbaugh

krohrbaugh May 14, 2013

ruby-build has S3-based mirrors for the various dependencies, which you can make use of in this gist, for times when sites like pyyaml.org go down.

To do so, change line 14 and 15 of 2-1.9.3-p327-patched.sh to be:

install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p327" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz#96118e856b502b5d7b3a4398e6c6e98c" combined_patch

(I'm simply pulling these out of ruby-build's relevant manifest files here.)

That will attempt to download from the source and then fall-back to the S3 mirror if needed.

ruby-build has S3-based mirrors for the various dependencies, which you can make use of in this gist, for times when sites like pyyaml.org go down.

To do so, change line 14 and 15 of 2-1.9.3-p327-patched.sh to be:

install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p327" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz#96118e856b502b5d7b3a4398e6c6e98c" combined_patch

(I'm simply pulling these out of ruby-build's relevant manifest files here.)

That will attempt to download from the source and then fall-back to the S3 mirror if needed.

@umtrey

This comment has been minimized.

Show comment Hide comment
@umtrey

umtrey Nov 21, 2013

This hasn't been touched in a while, but with the new gist links, things will likely break. I've made a version of the rbenv definition file that should work, for the time being.
https://gist.github.com/umtrey/7592062

umtrey commented Nov 21, 2013

This hasn't been touched in a while, but with the new gist links, things will likely break. I've made a version of the rbenv definition file that should work, for the time being.
https://gist.github.com/umtrey/7592062

@m-shirshendu

This comment has been minimized.

Show comment Hide comment
@m-shirshendu

m-shirshendu Dec 10, 2013

To get rid of the following error:

regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]

In addition to https://gist.github.com/umtrey/7592062, I had to do the following first

brew update
brew tap homebrew/dupes
brew install apple-gcc42
export CC=gcc-4.2

Then rbenv install /tmp/1.9.3-p327-perf

To get rid of the following error:

regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]

In addition to https://gist.github.com/umtrey/7592062, I had to do the following first

brew update
brew tap homebrew/dupes
brew install apple-gcc42
export CC=gcc-4.2

Then rbenv install /tmp/1.9.3-p327-perf

@chuckbergeron

This comment has been minimized.

Show comment Hide comment
@chuckbergeron

chuckbergeron Feb 4, 2014

Thanks @m-shirshendu! That did the trick.

Thanks @m-shirshendu! That did the trick.

@agis

This comment has been minimized.

Show comment Hide comment
@agis

agis Jul 9, 2014

Trying to install with ruby-install I got the following error (Using GCC 4.2):

....
compiling proc.c
compiling file.c
make: *** No rule to make target `pool_alloc.inc.h', needed by `gc.o'.  Stop.
!!! Compiling ruby 1.9.3-p327 failed!

agis commented Jul 9, 2014

Trying to install with ruby-install I got the following error (Using GCC 4.2):

....
compiling proc.c
compiling file.c
make: *** No rule to make target `pool_alloc.inc.h', needed by `gc.o'.  Stop.
!!! Compiling ruby 1.9.3-p327 failed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment