Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created July 11, 2009 00:24
Show Gist options
  • Select an option

  • Save methodmissing/144929 to your computer and use it in GitHub Desktop.

Select an option

Save methodmissing/144929 to your computer and use it in GitHub Desktop.
macbook-pros-computer:callback lourens$ rake bench
(in /Users/lourens/projects/callback)
ruby bench/bench.rb
warning: Insecure world writable dir /Users/lourens in PATH, mode 040753
Rehearsal ---------------------------------------------------------------------------------
Callback{ 'hai' }.call 0.030000 0.000000 0.030000 ( 0.035305)
RubyCallback{ 'hai' }.call 0.060000 0.000000 0.060000 ( 0.063904)
Callback( 'bai', :to_s ).call 0.020000 0.000000 0.020000 ( 0.010352)
RubyCallback( 'bai', :to_s ).call 0.030000 0.000000 0.030000 ( 0.035379)
Callback( 'bai', :gsub ).call( 'b', 'h' ) 0.030000 0.000000 0.030000 ( 0.027821)
RubyCallback( 'bai', :gsub ).call( 'b', 'h' ) 0.060000 0.000000 0.060000 ( 0.065632)
------------------------------------------------------------------------ total: 0.230000sec
user system total real
Callback{ 'hai' }.call 0.030000 0.000000 0.030000 ( 0.033655)
RubyCallback{ 'hai' }.call 0.070000 0.000000 0.070000 ( 0.079470)
Callback( 'bai', :to_s ).call 0.010000 0.000000 0.010000 ( 0.010563)
RubyCallback( 'bai', :to_s ).call 0.030000 0.000000 0.030000 ( 0.037244)
Callback( 'bai', :gsub ).call( 'b', 'h' ) 0.030000 0.000000 0.030000 ( 0.031933)
RubyCallback( 'bai', :gsub ).call( 'b', 'h' ) 0.070000 0.000000 0.070000 ( 0.066135)
ruby bench/raggi_bench.rb
# Calling
Rehearsal ---------------------------------------------
methback: 0.040000 0.000000 0.040000 ( 0.039263)
lambdabk: 0.080000 0.000000 0.080000 ( 0.087485)
callback: 0.120000 0.000000 0.120000 ( 0.119455)
callbak2: 0.050000 0.000000 0.050000 ( 0.052967)
rubyback: 0.200000 0.000000 0.200000 ( 0.200371)
farm: 0.050000 0.000000 0.050000 ( 0.053113)
------------------------------------ total: 0.540000sec
user system total real
methback: 0.040000 0.000000 0.040000 ( 0.036474)
lambdabk: 0.080000 0.000000 0.080000 ( 0.083743)
callback: 0.120000 0.000000 0.120000 ( 0.117640)
callbak2: 0.050000 0.000000 0.050000 ( 0.052316)
rubyback: 0.200000 0.000000 0.200000 ( 0.200124)
farm: 0.050000 0.000000 0.050000 ( 0.052120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment