diff options
Diffstat (limited to 'deps/node/benchmark/buffers/buffer-read-float.js')
-rw-r--r-- | deps/node/benchmark/buffers/buffer-read-float.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/deps/node/benchmark/buffers/buffer-read-float.js b/deps/node/benchmark/buffers/buffer-read-float.js deleted file mode 100644 index dbccf573..00000000 --- a/deps/node/benchmark/buffers/buffer-read-float.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -const common = require('../common.js'); - -const bench = common.createBenchmark(main, { - type: ['Double', 'Float'], - endian: ['BE', 'LE'], - value: ['zero', 'big', 'small', 'inf', 'nan'], - n: [1e6] -}); - -function main({ n, type, endian, value }) { - type = type || 'Double'; - const buff = Buffer.alloc(8); - const fn = `read${type}${endian}`; - const values = { - Double: { - zero: 0, - big: 2 ** 1023, - small: 2 ** -1074, - inf: Infinity, - nan: NaN, - }, - Float: { - zero: 0, - big: 2 ** 127, - small: 2 ** -149, - inf: Infinity, - nan: NaN, - }, - }; - - buff[`write${type}${endian}`](values[type][value], 0); - - bench.start(); - for (var i = 0; i !== n; i++) { - buff[fn](0); - } - bench.end(n); -} |