Skip to content

Commit d80ab83

Browse files
😒 chore(deps): Upgrade dependencies.
And use XO for linting.
1 parent 3917487 commit d80ab83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3780
-1632
lines changed

_benchmark/array.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1+
let t;
2+
let i;
3+
const length = 100000;
14

2-
var t, i, len = 100000;
3-
4-
console.log('number of operations: ', len);
5+
console.log('number of operations:', length);
56

67
console.time('total');
78
console.time('cons');
8-
t = [ ] ;
9-
for (i = 0; i < len; ++i) {
10-
t.unshift( i ) ;
9+
t = [];
10+
for (i = 0; i < length; ++i) {
11+
t.unshift(i);
1112
}
13+
1214
console.timeEnd('cons');
1315

1416
console.time('tail');
15-
for (i = 0; i < len; ++i) {
16-
t.shift( ) ;
17+
for (i = 0; i < length; ++i) {
18+
t.shift();
1719
}
20+
1821
console.timeEnd('tail');
1922

2023
console.time('push');
21-
t = [ ] ;
22-
for (i = 0; i < len; ++i) {
23-
t.push( i ) ;
24+
t = [];
25+
for (i = 0; i < length; ++i) {
26+
t.push(i);
2427
}
28+
2529
console.timeEnd('push');
2630

2731
console.log('split: no time since you cannot splice an array more than once');
2832

2933
console.time('init');
30-
for (i = 0; i < len; ++i) {
31-
t.pop( ) ;
34+
for (i = 0; i < length; ++i) {
35+
t.pop();
3236
}
37+
3338
console.timeEnd('init');
3439
console.timeEnd('total');

0 commit comments

Comments
 (0)