Skip to content

Instantly share code, notes, and snippets.

@meskallito
Last active January 1, 2016 20:48
Show Gist options
  • Select an option

  • Save meskallito/8198900 to your computer and use it in GitHub Desktop.

Select an option

Save meskallito/8198900 to your computer and use it in GitHub Desktop.
Rubinius vs MRI
flow.task do
2.times do
25_000_000.times {}
end
end
MRI 2.400000 0.000000 2.400000 ( 2.398510)
Rubinius 0.834417 0.000243 0.834660 ( 0.830375)
2.times do
flow.task do
25_000_000.times {}
end
end
MRI 2.410000 0.000000 2.410000 ( 2.413958)
Rubinius 1.441695 0.002414 1.444109 ( 0.669596)
10.times do
flow.task do
25_000_000.times {}
end
end
MRI 12.240000 0.030000 12.270000 ( 12.279808)
Rubinius 9.036620 0.019799 9.056419 ( 2.389200)
flow.task do
10.times do
25_000_000.times {}
end
end
MRI 11.900000 0.010000 11.910000 ( 11.907605)
Rubinius 6.457743 0.003660 6.461403 ( 6.448730)
puts Benchmark.measure {
25_000_000.times {}
25_000_000.times {}
}
MRI 2.530000 0.000000 2.530000 ( 2.531881)
Rubinius 0.846639 0.000494 0.847133 ( 0.840795)
puts Benchmark.measure {
t = Thread.new do
25_000_000.times {}
end
25_000_000.times {}
t.join
}
MRI 2.400000 0.010000 2.410000 ( 2.397585)
Rubinius 1.527682 0.001035 1.528717 ( 0.733810)
puts Benchmark.measure {
t1 = Thread.new do
25_000_000.times {}
end
t2 = Thread.new do
25_000_000.times {}
end
t1.join
t2.join
}
MRI 2.410000 0.000000 2.410000 ( 2.410826)
Rubinius 1.353337 0.003410 1.356747 ( 0.680599)
puts Benchmark.measure {
t = []
10.times do |i|
th = Thread.new do
25_000_000.times {}
end
t[i] = th
end
t.each { |th| th.join }
}
MRI 12.450000 0.020000 12.470000 ( 12.482419)
Rubinius 8.700109 0.015655 8.715764 ( 2.232997)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment