repositories
/
benchmarks-js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More linter silencing
[benchmarks-js.git]
/
empty-array.js
diff --git
a/empty-array.js
b/empty-array.js
index 0c5f725e43122a307beae3468f05919a48e130de..a6a8acd84daa66c81fcdc5fa93c93d76e60841e2 100644
(file)
--- a/
empty-array.js
+++ b/
empty-array.js
@@
-1,19
+1,19
@@
const Benchmark = require('benny')
const Benchmark = require('benny')
-const { generateRandom
Integ
erArray } = require('./benchmark-utils')
+const { generateRandom
Numb
erArray } = require('./benchmark-utils')
-let testArray = generateRandom
Integ
erArray(10000)
+let testArray = generateRandom
Numb
erArray(10000)
Benchmark.suite(
'Empty array',
Benchmark.add('length = 0', () => {
testArray.length = 0
}),
Benchmark.suite(
'Empty array',
Benchmark.add('length = 0', () => {
testArray.length = 0
}),
- Benchmark.add('pop loop',
async
() => {
+ Benchmark.add('pop loop', () => {
while (testArray.length > 0) {
testArray.pop()
}
}),
while (testArray.length > 0) {
testArray.pop()
}
}),
- Benchmark.add('splice',
async
() => {
+ Benchmark.add('splice', () => {
testArray.splice(0, testArray.length)
}),
Benchmark.add('shift loop', () => {
testArray.splice(0, testArray.length)
}),
Benchmark.add('shift loop', () => {