Skip to content

Instantly share code, notes, and snippets.

@jruby
Created October 13, 2009 21:14
Show Gist options
  • Save jruby/209558 to your computer and use it in GitHub Desktop.
Save jruby/209558 to your computer and use it in GitHub Desktop.
~/projects/rubinius/benchmark/tiers/0 ➔ cat bm_vm2_method.duby
import java.lang.System
def m
nil
end
def run
i=0
while i<6000000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m;
end
nil
end
i = 0
while i < 50
time = System.currentTimeMillis
run
puts System.currentTimeMillis - time
i+= 1
end
~/projects/rubinius/benchmark/tiers/0 ➔ cat bm_vm2_method.rb
def m
nil
end
def Bench.run
i=0
while i<6000000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m;
end
end
~/projects/rubinius/benchmark/tiers/0 ➔ ../../../../duby/bin/duby bm_vm2_method.duby
8
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment