mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
4bb529d972
Apply strict mode to benchmark code. PR-URL: https://github.com/nodejs/node/pull/5336 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
16 lines
399 B
JavaScript
16 lines
399 B
JavaScript
'use strict';
|
|
var common = require('../common.js');
|
|
|
|
var bench = common.createBenchmark(main, {});
|
|
|
|
function main(conf) {
|
|
var N = 64 * 1024 * 1024;
|
|
var b = Buffer(N);
|
|
var s = '';
|
|
for (var i = 0; i < 256; ++i) s += String.fromCharCode(i);
|
|
for (var i = 0; i < N; i += 256) b.write(s, i, 256, 'ascii');
|
|
bench.start();
|
|
for (var i = 0; i < 32; ++i) b.toString('base64');
|
|
bench.end(64);
|
|
}
|