Skip to content

Instantly share code, notes, and snippets.

@ahmadsherif
Created September 26, 2016 17:51
Show Gist options
  • Save ahmadsherif/839cfdf706911192c55fa2253677968c to your computer and use it in GitHub Desktop.
Save ahmadsherif/839cfdf706911192c55fa2253677968c to your computer and use it in GitHub Desktop.
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
2016-09-26 19:49:41 +0200
target 0: ruby-without-fix (ruby 2.4.0dev (2016-09-25 trunk 56239) [x86_64-linux]) at "/opt/ruby-custom/bin/ruby -I./lib -I. -I.ext/common --disable-gem"
target 1: built-ruby (ruby 2.4.0dev (2016-09-25 trunk 56240) [x86_64-linux]) at "./miniruby -I./lib -I. -I.ext/common --disable-gem"
measure target: real
-----------------------------------------------------------
loop_whileloop2
i = 0
while i< 6_000_000 # benchmark loop 2
i += 1
end
ruby-without-fix 0.1195242420071736
built-ruby 0.12379021302331239
-----------------------------------------------------------
vm2_method
def m
nil
end
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
m; m; m; m; m; m; m; m;
end
ruby-without-fix 1.0930896860081702
built-ruby 1.0818623460363597
-----------------------------------------------------------
vm2_method_missing
class C
def method_missing mid
end
end
obj = C.new
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m;
end
ruby-without-fix 2.296100770996418
built-ruby 2.3422280109953135
-----------------------------------------------------------
vm2_method_with_block
def m
nil
end
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{};
end
ruby-without-fix 1.1243693699943833
built-ruby 1.1302171749994159
-----------------------------------------------------------
raw data:
[["loop_whileloop2", [[0.1195242420071736], [0.12379021302331239]]],
["vm2_method", [[1.0930896860081702], [1.0818623460363597]]],
["vm2_method_missing", [[2.296100770996418], [2.3422280109953135]]],
["vm2_method_with_block", [[1.1243693699943833], [1.1302171749994159]]]]
Elapsed time: 9.314269192 (sec)
-----------------------------------------------------------
benchmark results:
Execution time (sec)
name ruby-without-fix built-ruby
loop_whileloop2 0.120 0.124
vm2_method* 0.974 0.958
vm2_method_missing* 2.177 2.218
vm2_method_with_block* 1.005 1.006
Speedup ratio: compare with the result of `ruby-without-fix' (greater is better)
name built-ruby
loop_whileloop2 0.966
vm2_method* 1.016
vm2_method_missing* 0.981
vm2_method_with_block* 0.998
Log file: bmlog-20160926-194941.2620.tsv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment