joyent/node — pull request #6124 by trevnorris (2013-08-26 10:23:55+00:00)
Title: buffer: add NativeBuffer API

Due to a lot of the util.is* checks there was much unnecessary overhead
for the most common use case of Buffer. Which is creating a new Buffer
instance for data from incoming I/O. NativeBuffer is a simple way to
bypass all the unneeded checks and simply hand back a Buffer instance
while setting the length.

I noticed this while running tests on a slimmed down version of a TCP test. It kept spewing out how it couldn't inline all the `util.is*` checks. Which made me wonder why they're being done for the C++ API call anyways.

/cc @bnoordhuis