Skip to content

Instantly share code, notes, and snippets.

@unak
Created April 4, 2016 15:49
Show Gist options
  • Save unak/de325d50bed23363da1eee192939acb3 to your computer and use it in GitHub Desktop.
Save unak/de325d50bed23363da1eee192939acb3 to your computer and use it in GitHub Desktop.
the former is normal trunk, the latter is multi-delete patched
D:\> type bench.rb
require 'benchmark'
REPEAT = 10_000_000
Benchmark.bm do |x|
x.report do
REPEAT.times do
[1,2,3,4,5].delete(1)
end
end
end
D:\> ruby\miniruby.rb -Iruby/lib bench.rb
user system total real
5.055000 0.000000 5.055000 ( 5.060912)
D:\> ruby\miniruby.rb -Iruby/lib bench.rb
user system total real
4.945000 0.000000 4.945000 ( 4.977151)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment