GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: add trailing commas in `benchmark/async_hooks` · nodejs/node@f006b2f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark
    • .eslintrc.yaml
    • async_hooks
      • async-local-storage-run.js
      • async-resource-vs-destroy.js
      • gc-tracking.js
      • http-server.js
      • promises.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.