summaryrefslogtreecommitdiff
path: root/deps/node/benchmark/util/splice-one.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/benchmark/util/splice-one.js')
-rw-r--r--deps/node/benchmark/util/splice-one.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/deps/node/benchmark/util/splice-one.js b/deps/node/benchmark/util/splice-one.js
deleted file mode 100644
index 4ca7c856..00000000
--- a/deps/node/benchmark/util/splice-one.js
+++ /dev/null
@@ -1,33 +0,0 @@
-'use strict';
-
-const common = require('../common');
-
-const bench = common.createBenchmark(main, {
- n: [1e5],
- pos: ['start', 'middle', 'end'],
- size: [10, 100, 500],
-}, { flags: ['--expose-internals'] });
-
-function main({ n, pos, size }) {
- const { spliceOne } = require('internal/util');
- const arr = new Array(size);
- arr.fill('');
- let index;
- switch (pos) {
- case 'end':
- index = size - 1;
- break;
- case 'middle':
- index = Math.floor(size / 2);
- break;
- default: // start
- index = 0;
- }
-
- bench.start();
- for (var i = 0; i < n; i++) {
- spliceOne(arr, index);
- arr.push('');
- }
- bench.end(n);
-}