Skip to content

Commit 2786a43

Browse files
committed
Commented bench.js
1 parent d1e46a8 commit 2786a43

File tree

3 files changed

+15
-36
lines changed

3 files changed

+15
-36
lines changed

scripts/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var scope = {
7272

7373
ALIASES : true, // Include aliases like writeByte, writeShort ..
7474
BUFFERVIEW : false, // Include BufferView as ByteBuffer#view under node
75-
INLINE : true, // Inline whatever possible for maximum performance
75+
INLINE : true, // Inline any assertion code
7676
VERBOSE_MS : false // Include MetaScript details as comments
7777
};
7878

tests/bench.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// a simple benchmark utility comparing performance between the different builds.
2+
3+
// Uint8Array observations (compared to node Buffers)
4+
// - seems to be pretty much equal for byte ops
5+
6+
// DataView observations (compared to Uint8Array):
7+
// - allocation is about 2 times slower
8+
// - writing is about 5 times (int32) to 10 times (varint) slower
9+
// - reading is about 3 times slower
10+
11+
// UTF8 encoding observations (compared to node's string/buffer API)
12+
// - the longer the string, the poorer is read/write performance
13+
// - either utfx doesn't cut it yet, or node's bindings simply outperform everything js here
14+
115
var ByteBuffer = require("../index.js"),
216
prettyHrTime = require("pretty-hrtime");
317

tests/buffer_utfx.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)