Created
December 25, 2009 04:44
-
-
Save manveru/263510 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jruby-1.4.0: jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [amd64-java] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 1.591000 0.000000 1.591000 ( 1.511000) | |
compiled: 0.861000 0.000000 0.861000 ( 0.861000) | |
on the fly right: 0.814000 0.000000 0.814000 ( 0.815000) | |
compiled right: 0.712000 0.000000 0.712000 ( 0.712000) | |
---------------------------------------------- total: 3.978000sec | |
user system total real | |
on the fly: 0.595000 0.000000 0.595000 ( 0.595000) | |
compiled: 0.629000 0.000000 0.629000 ( 0.629000) | |
on the fly right: 0.577000 0.000000 0.577000 ( 0.577000) | |
compiled right: 0.674000 0.000000 0.674000 ( 0.674000) | |
mput-head: ruby 1.9.2dev (2009-12-24 trunk 26168) [x86_64-linux] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 0.740000 0.000000 0.740000 ( 0.784770) | |
compiled: 0.820000 0.010000 0.830000 ( 0.850199) | |
on the fly right: 0.730000 0.010000 0.740000 ( 0.737226) | |
compiled right: 0.810000 0.000000 0.810000 ( 0.820161) | |
---------------------------------------------- total: 3.120000sec | |
user system total real | |
on the fly: 0.740000 0.000000 0.740000 ( 0.740293) | |
compiled: 0.800000 0.010000 0.810000 ( 0.834666) | |
on the fly right: 0.740000 0.000000 0.740000 ( 0.740143) | |
compiled right: 0.820000 0.000000 0.820000 ( 0.851902) | |
rbx-1.0.0-head: rubinius 1.0.0-rc1 (1.8.7 85ac7fb9 2009-11-25) [x86_64-unknown-linux-gnu] | |
An exception occurred running ./regex_compilation.rb | |
Tried to use object of type Object (43) as type String (48) (TypeError) | |
Backtrace: | |
main.__script__ at regex_compilation.rb:1 | |
Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:230 | |
Requirer::Utils.single_load at kernel/delta/requirer.rb:251 | |
Requirer::Utils.load_from_extension at kernel/delta/requirer.rb:336 | |
Rubinius::Loader#script at kernel/loader.rb:376 | |
Rubinius::Loader#main at kernel/loader.rb:485 | |
Object#__script__ at kernel/loader.rb:489 | |
rbx-1.0.0-head: rubinius 1.0.0-rc1 (1.8.7 85ac7fb9 2009-11-25) [x86_64-unknown-linux-gnu] | |
An exception occurred running ./regex_compilation.rb | |
Tried to use object of type Object (43) as type String (48) (TypeError) | |
Backtrace: | |
main.__script__ at regex_compilation.rb:1 | |
Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:230 | |
Requirer::Utils.single_load at kernel/delta/requirer.rb:251 | |
Requirer::Utils.load_from_extension at kernel/delta/requirer.rb:336 | |
Rubinius::Loader#script at kernel/loader.rb:376 | |
Rubinius::Loader#main at kernel/loader.rb:485 | |
Object#__script__ at kernel/loader.rb:489 | |
rbx-1.0.0-rc1: rubinius 1.0.0-rc1 (1.8.7 release 2009-11-25) [x86_64-unknown-linux-gnu] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 4.128489 0.000000 4.128489 ( 4.128501) | |
compiled: 4.125988 0.000000 4.125988 ( 4.126035) | |
on the fly right: 4.520379 0.000000 4.520379 ( 4.520423) | |
compiled right: 4.295659 0.000000 4.295659 ( 4.295721) | |
--------------------------------------------- total: 17.070515sec | |
user system total real | |
on the fly: 3.954355 0.000000 3.954355 ( 3.954392) | |
compiled: 3.899429 0.000000 3.899429 ( 3.899471) | |
on the fly right: 4.380183 0.000000 4.380183 ( 4.380205) | |
compiled right: 4.302424 0.000000 4.302424 ( 4.302442) | |
ree-1.8.7-2009.10: ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2009.10 | |
Rehearsal ------------------------------------------------------- | |
on the fly: 0.660000 0.000000 0.660000 ( 0.672925) | |
compiled: 0.830000 0.000000 0.830000 ( 0.833117) | |
on the fly right: 0.660000 0.010000 0.670000 ( 0.665201) | |
compiled right: 0.820000 0.000000 0.820000 ( 0.823274) | |
---------------------------------------------- total: 2.980000sec | |
user system total real | |
on the fly: 0.660000 0.000000 0.660000 ( 0.660121) | |
compiled: 0.800000 0.000000 0.800000 ( 0.825076) | |
on the fly right: 0.660000 0.010000 0.670000 ( 0.669722) | |
compiled right: 0.810000 0.000000 0.810000 ( 0.815039) | |
ruby-1.8.6-p383: ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 0.830000 0.000000 0.830000 ( 0.872683) | |
compiled: 0.990000 0.010000 1.000000 ( 0.998876) | |
on the fly right: 0.850000 0.000000 0.850000 ( 0.875575) | |
compiled right: 0.910000 0.000000 0.910000 ( 0.910977) | |
---------------------------------------------- total: 3.590000sec | |
user system total real | |
on the fly: 0.850000 0.000000 0.850000 ( 0.843761) | |
compiled: 0.900000 0.010000 0.910000 ( 0.911701) | |
on the fly right: 0.850000 0.000000 0.850000 ( 0.849082) | |
compiled right: 0.900000 0.000000 0.900000 ( 0.902605) | |
ruby-1.8.7-p174: ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 0.730000 0.000000 0.730000 ( 0.741987) | |
compiled: 0.910000 0.010000 0.920000 ( 0.924735) | |
on the fly right: 0.690000 0.000000 0.690000 ( 0.692926) | |
compiled right: 0.890000 0.000000 0.890000 ( 0.961404) | |
---------------------------------------------- total: 3.230000sec | |
user system total real | |
on the fly: 0.700000 0.010000 0.710000 ( 0.732513) | |
compiled: 0.870000 0.000000 0.870000 ( 0.875274) | |
on the fly right: 0.690000 0.000000 0.690000 ( 0.695654) | |
compiled right: 0.870000 0.000000 0.870000 ( 0.869581) | |
ruby-1.9.1-p243: ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 0.810000 0.010000 0.820000 ( 0.888674) | |
compiled: 0.950000 0.000000 0.950000 ( 1.001139) | |
on the fly right: 0.800000 0.010000 0.810000 ( 0.832088) | |
compiled right: 0.940000 0.000000 0.940000 ( 0.998040) | |
---------------------------------------------- total: 3.520000sec | |
user system total real | |
on the fly: 0.810000 0.000000 0.810000 ( 0.849762) | |
compiled: 0.920000 0.000000 0.920000 ( 0.997383) | |
on the fly right: 0.790000 0.000000 0.790000 ( 0.828010) | |
compiled right: 0.930000 0.010000 0.940000 ( 0.994407) | |
ruby-1.9.1-p376: ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux] | |
Rehearsal ------------------------------------------------------- | |
on the fly: 0.960000 0.000000 0.960000 ( 1.033850) | |
compiled: 1.210000 0.000000 1.210000 ( 1.271276) | |
on the fly right: 0.940000 0.000000 0.940000 ( 1.004610) | |
compiled right: 1.200000 0.000000 1.200000 ( 1.263205) | |
---------------------------------------------- total: 4.310000sec | |
user system total real | |
on the fly: 0.960000 0.010000 0.970000 ( 1.020357) | |
compiled: 1.200000 0.000000 1.200000 ( 1.315888) | |
on the fly right: 0.960000 0.000000 0.960000 ( 0.987625) | |
compiled right: 1.190000 0.000000 1.190000 ( 1.220899) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
iterations = 1_000_000 | |
r = /f/ | |
s = 'f' | |
Benchmark.bmbm(20) do |x| | |
x.report("on the fly: "){ iterations.times{ s =~ /f/ }} | |
x.report("compiled: "){ iterations.times{ s =~ r }} | |
x.report("on the fly right:"){ iterations.times{ /f/ =~ s }} | |
x.report("compiled right: "){ iterations.times{ r =~ s }} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment