Last active
December 24, 2015 21:29
-
-
Save cheald/6865939 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
require 'bson' | |
100_000.times { | |
buffer = BSON::ByteBuffer.new | |
buffer.prepend! "string" | |
} | |
100_000.times { | |
buffer = BSON::ByteBuffer.new "string" | |
buffer.prepend! "string" | |
} | |
# Now pass an array. This blows up because it ends up | |
# passing an array to the `case String` branch which | |
# causes #prepend! to attempt string operations on an Array. | |
buffer = BSON::ByteBuffer.new([0,0,0,0]) | |
buffer.prepend! "string" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment