node/benchmark/buffers
Zach Bjornson 4014ecbfb4 buffer: speed up swap16/32, add swap64
* Speed up buffer.swap16 and swap32 by using builtins. Up to ~6x gain.
  Drop transition point between JS and C++ implementations accordingly.
  Amount of performance improvement not only depends on buffer size but
  also memory alignment.
* Fix tests: C++ impl tests were testing 0-filled buffers so were
  always passing.
* Add similar buffer.swap64 method.
* Make buffer-swap benchmark mirror JS impl.

doc/api/buffer.markdown has an entry of "added: REPLACEME" that should
be changed to the correct release number before tagged.

Because node is currently using a very old version of cpplint.py it
doesn't know that std::swap() has moved from <algorithm> to <utility> in
c++11. So until cpplint.py is updated simply NOLINT the line.
Technically it should be NOLINT(build/include_what_you_use), but that
puts the line over 80 characters causing another lint error.

PR-URL: https://github.com/nodejs/node/pull/7157
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-URL: https://github.com/nodejs/node/pull/7546
2016-07-05 23:13:21 +02:00
..
buffer-base64-decode.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-base64-encode.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-bytelength.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-compare-instance-method.js benchmark: add benchmark for buf.compare() 2016-02-27 20:17:56 -08:00
buffer-compare-offset.js buffer: add Buffer.prototype.compare by offset 2016-04-26 12:15:55 -07:00
buffer-compare.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-concat.js benchmark: add benchmark for Buffer.concat 2016-06-15 17:47:23 -05:00
buffer-creation.js buffer: add Buffer.allocUnsafeSlow(size) 2016-04-26 12:16:07 -07:00
buffer-indexof.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-iterate.js benchmark: use strict mode 2016-02-22 11:09:26 -08:00
buffer-read.js tools,benchmark: increase lint compliance 2016-02-27 20:15:17 -08:00
buffer-slice.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-swap.js buffer: speed up swap16/32, add swap64 2016-07-05 23:13:21 +02:00
buffer-tostring.js buffer: add .from(), .alloc() and .allocUnsafe() 2016-03-16 08:34:02 -07:00
buffer-write.js benchmark,test,lib: remove extra spaces 2016-05-17 08:01:12 -05:00
buffer_zero.js buffer: faster case for create buffer from empty string 2016-03-27 09:14:48 -07:00
dataview-set.js buffer: fix dataview-set benchmark 2016-06-02 22:40:51 +10:00