Created
October 16, 2009 15:12
-
-
Save seancribbs/211853 to your computer and use it in GitHub Desktop.
This file contains 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
The C oid generation uses bare C types and casting to get around the pack/unpack inefficiencies. | |
Here's 100_000.times { Mongo::ObjectID.new } with each algorithm (using Benchmark.bmbm). | |
Rehearsal -------------------------------------------- | |
Ruby oid 2.610000 0.350000 2.960000 ( 2.976763) | |
C oid 0.950000 0.300000 1.250000 ( 1.251934) | |
----------------------------------- total: 4.210000sec | |
user system total real | |
Ruby oid 2.710000 0.330000 3.040000 ( 3.063867) | |
C oid 0.920000 0.300000 1.220000 ( 1.230964) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment