Permalink
Browse files

Added Hash#delete_if benchmark

  • Loading branch information...
1 parent 7b116c6 commit f604d16f7ecac4fc4a0c4a8c631b32df36ae006f @hosiawak hosiawak committed Jan 20, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 benchmark/core/hash/bench_delete_if.rb
@@ -0,0 +1,16 @@
+require 'benchmark'
+require 'benchmark/ips'
+require File.expand_path('../shared_hash.rb', __FILE__)
+
+Benchmark.ips do |x|
+
+ x.report "hsh.delete_if" do |times|
+ i = 0
+ while i < times
+ small_hash = $small_hash.dup
+ small_hash.delete_if { |k,v| v.even? }
+ i += 1
+ end
+ end
+
+end

0 comments on commit f604d16

Please sign in to comment.