benchmark: add benchmark for buf.compare()
authorRich Trott <rtrott@gmail.com>
Fri, 26 Feb 2016 00:26:39 +0000 (16:26 -0800)
committerMyles Borins <mborins@us.ibm.com>
Mon, 21 Mar 2016 19:57:59 +0000 (12:57 -0700)
commit03b20a73b9e4c28acb7ea8b44902738f75cb18a4
tree274b4592d00bb8e3ac3f199ffda2c96a932b8cfc
parentd681bf24b515cdcd240fc01e3cb99efb5a88d567
benchmark: add benchmark for buf.compare()

There is a benchmark for the class method `Buffer.compare()` but not for
the instance method `buf.compare()`. This adds that benchmark.

I used this to confirm a performance regression in an implementation I
was considering. While the implementation was a bust, it does seem like
the benchmark is worthwhile.

The benchmark is nearly identical to the existing `Buffer.compare()`
benchmark except, of course, that it calls `buf.compare()` instead.

PR-URL: https://github.com/nodejs/node/pull/5441
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
benchmark/buffers/buffer-compare-instance-method.js [new file with mode: 0644]