Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c8c9f9

Browse filesBrowse files
aduh95MylesBorins
authored andcommitted
benchmark: add trailing commas in benchmark/async_hooks
PR-URL: #46424 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent d556ccd commit 2c8c9f9
Copy full SHA for 2c8c9f9

File tree

Expand file treeCollapse file tree

6 files changed

+21
-22
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+21
-22
lines changed
Open diff view settings
Collapse file

‎benchmark/.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: benchmark/.eslintrc.yaml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ rules:
99

1010
overrides:
1111
- files:
12-
- async_hooks/*.js
1312
- buffers/*.js
1413
- buffers-fill/*.js
1514
- crypto/*.js
Collapse file

‎benchmark/async_hooks/async-local-storage-run.js‎

Copy file name to clipboardExpand all lines: benchmark/async_hooks/async-local-storage-run.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const common = require('../common.js');
33
const { AsyncLocalStorage } = require('async_hooks');
44

55
const bench = common.createBenchmark(main, {
6-
n: [1e7]
6+
n: [1e7],
77
});
88

99
async function run(store, n) {
Collapse file

‎benchmark/async_hooks/async-resource-vs-destroy.js‎

Copy file name to clipboardExpand all lines: benchmark/async_hooks/async-resource-vs-destroy.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
createHook,
1010
executionAsyncResource,
1111
executionAsyncId,
12-
AsyncLocalStorage
12+
AsyncLocalStorage,
1313
} = require('async_hooks');
1414
const { createServer } = require('http');
1515

@@ -19,7 +19,7 @@ const bench = common.createBenchmark(main, {
1919
path: '/',
2020
connections: 500,
2121
duration: 5,
22-
n: [1e6]
22+
n: [1e6],
2323
});
2424

2525
function buildCurrentResource(getServe) {
@@ -30,7 +30,7 @@ function buildCurrentResource(getServe) {
3030

3131
return {
3232
server,
33-
close
33+
close,
3434
};
3535

3636
function getCLS() {
@@ -71,7 +71,7 @@ function buildDestroy(getServe) {
7171

7272
return {
7373
server,
74-
close
74+
close,
7575
};
7676

7777
function getCLS() {
@@ -108,7 +108,7 @@ function buildAsyncLocalStorage(getServe) {
108108

109109
return {
110110
server,
111-
close
111+
close,
112112
};
113113

114114
function getCLS() {
@@ -160,12 +160,12 @@ function getServeCallbacks(getCLS, setCLS) {
160160
const types = {
161161
'async-resource': buildCurrentResource,
162162
'destroy': buildDestroy,
163-
'async-local-storage': buildAsyncLocalStorage
163+
'async-local-storage': buildAsyncLocalStorage,
164164
};
165165

166166
const asyncMethods = {
167167
'callbacks': getServeCallbacks,
168-
'async': getServeAwait
168+
'async': getServeAwait,
169169
};
170170

171171
function main({ type, asyncMethod, connections, duration, path }) {
@@ -178,7 +178,7 @@ function main({ type, asyncMethod, connections, duration, path }) {
178178
bench.http({
179179
path,
180180
connections,
181-
duration
181+
duration,
182182
}, () => {
183183
close();
184184
});
Collapse file

‎benchmark/async_hooks/gc-tracking.js‎

Copy file name to clipboardExpand all lines: benchmark/async_hooks/gc-tracking.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const bench = common.createBenchmark(main, {
88
'trackingEnabled',
99
'trackingEnabledWithDestroyHook',
1010
'trackingDisabled',
11-
]
11+
],
1212
}, {
13-
flags: ['--expose-gc']
13+
flags: ['--expose-gc'],
1414
});
1515

1616
function endAfterGC(n) {
Collapse file

‎benchmark/async_hooks/http-server.js‎

Copy file name to clipboardExpand all lines: benchmark/async_hooks/http-server.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
44
const bench = common.createBenchmark(main, {
55
asyncHooks: ['init', 'before', 'after', 'all', 'disabled', 'none'],
66
connections: [50, 500],
7-
duration: 5
7+
duration: 5,
88
});
99

1010
function main({ asyncHooks, connections, duration }) {
@@ -14,11 +14,11 @@ function main({ asyncHooks, connections, duration }) {
1414
before() {},
1515
after() {},
1616
destroy() {},
17-
promiseResolve() {}
17+
promiseResolve() {},
1818
};
1919
if (asyncHooks !== 'all' || asyncHooks !== 'disabled') {
2020
hooks = {
21-
[asyncHooks]: () => {}
21+
[asyncHooks]: () => {},
2222
};
2323
}
2424
const hook = require('async_hooks').createHook(hooks);
@@ -34,7 +34,7 @@ function main({ asyncHooks, connections, duration }) {
3434
bench.http({
3535
connections,
3636
path,
37-
duration
37+
duration,
3838
}, () => {
3939
server.close();
4040
});
Collapse file

‎benchmark/async_hooks/promises.js‎

Copy file name to clipboardExpand all lines: benchmark/async_hooks/promises.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ let hook;
66
const tests = {
77
disabled() {
88
hook = createHook({
9-
promiseResolve() {}
9+
promiseResolve() {},
1010
});
1111
},
1212
enabled() {
1313
hook = createHook({
14-
promiseResolve() {}
14+
promiseResolve() {},
1515
}).enable();
1616
},
1717
enabledWithDestroy() {
1818
hook = createHook({
1919
promiseResolve() {},
20-
destroy() {}
20+
destroy() {},
2121
}).enable();
2222
},
2323
enabledWithInitOnly() {
2424
hook = createHook({
25-
init() {}
25+
init() {},
2626
}).enable();
27-
}
27+
},
2828
};
2929

3030
const bench = common.createBenchmark(main, {
@@ -34,7 +34,7 @@ const bench = common.createBenchmark(main, {
3434
'enabledWithDestroy',
3535
'enabledWithInitOnly',
3636
'disabled',
37-
]
37+
],
3838
});
3939

4040
const err = new Error('foobar');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.