Skip to content

Commit

Permalink
!fixup run bench against all strings
Browse files Browse the repository at this point in the history
This fixes v8 over-optimizations against a single string by running all
five of our strings against the function.
  • Loading branch information
brendanashworth committed May 16, 2015
1 parent fc145f2 commit 1278515
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions benchmark/buffers/buffer-bytelength-utf8.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ function main(conf) {
var n = conf.n | 0;
var len = conf.len | 0;

// make a string with them all mixed together
var str = buildStr(len);

bench.start();
for (var i = 0; i < n; i++) {
Buffer.byteLength(chars[0], 'utf8');
Buffer.byteLength(chars[1], 'utf8');
Buffer.byteLength(chars[2], 'utf8');
Buffer.byteLength(chars[3], 'utf8');
Buffer.byteLength(str, 'utf8');
}
bench.end(n);
Expand Down

0 comments on commit 1278515

Please sign in to comment.