0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00
Commit Graph

12 Commits

Author SHA1 Message Date
Vladimir Kurchatkin
45d8d9f826 buffer: implement iterable interface
This makes possible to use `for..of` loop with
buffers. Also related `keys`, `values` and `entries`
methods are added for feature parity with `Uint8Array`.

PR-URL: https://github.com/iojs/io.js/pull/525
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-28 16:40:15 +03:00
isaacs
3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
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