Commit Graph

10 Commits (f65a5cbcde51ef7da0ff5617dcab1a164b9a217b)

Author SHA1 Message Date
Ben Noordhuis 8ae32a9864 bench: fix buffers/buffer-base64-encode benchmark
The test is supposed to measure the performance of the base64 encoder
so move the Buffer#write() calls out of the benchmark section.

The overhead of the calls isn't terrible (about 1-3%) but having
unrelated activity in a micro-benchmark is never a good idea.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-06-04 14:37:27 -07:00
Raymond Feng 4c672c8a5e benchmark: Add a test to measure Buffer.slice perf
Buffer.slice can be expensive. One regression was reported by https://github.com/joyent/node/issues/7633. The method should be benchmarked.
2014-05-28 11:57:05 -07:00
Sean McArthur 226f98a356 buffer: add compare and equals methods
compare() works like String.localeCompare such that:

    Buffer.compare(a, b) === a.compare(b);

equals() does a native check to see if two buffers are equal.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-28 22:09:48 -07:00
Nick Apperson d4fcb23e38 buffer: improve {read,write}{U}Int* methods
Increase the performance and simplify the logic of Buffer#write{U}Int*
and Buffer#read{U}Int* methods by placing the byte manipulation code
directly inline.

Also improve the speed of buffer-write benchmarks by creating a new
call directly to each method by using Function() instead of calling by
buff[fn].

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-01 17:31:28 -07:00
isaacs 2ed56e5235 bench: Consistency in benchmark filenames 2013-02-19 17:16:55 -08:00
isaacs 3f67a48dd4 bench: Add buffers/dataview_set 2013-02-19 14:14:33 -08:00
isaacs 048f7fd37c bench: Merge fast_buffer_creation and buffer_creation 2013-02-19 14:14:32 -08:00
isaacs 55aa2571a0 bench: Buffer read/write benchmarks 2013-02-19 14:14:32 -08:00
isaacs 419607e8eb bench: Buffer creation 2013-02-19 14:14:32 -08:00
isaacs cc38528acf bench: buffer-base64-encode 2013-02-19 14:14:32 -08:00