buffer: improve {read,write}{U}Int* methods
authorNick Apperson <apperson@gmail.com>
Tue, 25 Mar 2014 14:51:13 +0000 (09:51 -0500)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 2 Apr 2014 00:31:28 +0000 (17:31 -0700)
commitd4fcb23e38e74d21e04b3a17d10e52949b630ec0
treede43d5bf27c9892e374440dc23432faf84173f4b
parentc7214fe355596543d92d7c10b38d78ca65b4abfe
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>
benchmark/buffers/buffer-read.js
benchmark/buffers/buffer-write.js
lib/buffer.js