Skip to content

Instantly share code, notes, and snippets.

@stormbrew
Created March 9, 2011 21:58
Show Gist options
  • Save stormbrew/863096 to your computer and use it in GitHub Desktop.
Save stormbrew/863096 to your computer and use it in GitHub Desktop.
Benchmark of faster version of Hash#reject.
graham-battys-macbook:rubinius-master graham (perf-hash)$ bin/rbx benchmark/bin/benchmark -tx -tr benchmark/core/hash/bench_reject.rb
=== bin/rbx ===
reject string 91940.6 (±14.1%) i/s - 445500 in 5.020721s (cycle=2750)
reject numbers 220166.2 (±7.9%) i/s - 1092648 in 4.999565s (cycle=10308)
reject! string 94992.6 (±7.4%) i/s - 476934 in 5.052189s (cycle=5482)
reject! numbers 199148.9 (±6.9%) i/s - 995456 in 5.025582s (cycle=11312)
=== ruby ===
reject string 51115.8 (±12.1%) i/s - 252488 in 5.011600s (cycle=3412)
reject numbers 63331.0 (±12.9%) i/s - 311360 in 5.005070s (cycle=3892)
reject! string 98969.8 (±11.5%) i/s - 492195 in 5.039376s (cycle=5181)
reject! numbers 221659.9 (±20.0%) i/s - 1072786 in 5.028255s (cycle=7502)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment