Created
September 14, 2012 15:15
-
-
Save jonleighton/3722550 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ruby test.rb | |
| Calculating ------------------------------------- | |
| success 51960 i/100ms | |
| failure 4653 i/100ms | |
| ------------------------------------------------- | |
| success 2687778.5 (±3.7%) i/s - 13405680 in 4.996239s | |
| failure 53863.7 (±3.5%) i/s - 269874 in 5.016999s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark/ips' | |
| o = Object.new | |
| id = o.__id__ | |
| Benchmark.ips do |r| | |
| r.report('success') { ObjectSpace._id2ref(id) rescue nil } | |
| r.report('failure') { ObjectSpace._id2ref(6) rescue nil } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment