GeezerVison is showing github.com — benchmark: add trailing commas in `benchmark/async_hooks` · nodejs/node@f006b2f
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: benchmark/.eslintrc.yaml -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 |
| 10 | 10 | overrides: | 11 | 11 | - files: | 12 | | - - async_hooks/*.js | 13 | 12 | - buffers/*.js | 14 | 13 | - buffers-fill/*.js | 15 | 14 | - crypto/*.js | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ const common = require('../common.js'); | 3 | 3 | const { AsyncLocalStorage } = require('async_hooks'); | 4 | 4 |
| 5 | 5 | const bench = common.createBenchmark(main, { | 6 | | - n: [1e7] | | 6 | + n: [1e7], | 7 | 7 | }); | 8 | 8 |
| 9 | 9 | async function run(store, n) { | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
| 9 | 9 | createHook, | 10 | 10 | executionAsyncResource, | 11 | 11 | executionAsyncId, | 12 | | - AsyncLocalStorage | | 12 | + AsyncLocalStorage, | 13 | 13 | } = require('async_hooks'); | 14 | 14 | const { createServer } = require('http'); | 15 | 15 |
| @@ -19,7 +19,7 @@ const bench = common.createBenchmark(main, { | 19 | 19 | path: '/', | 20 | 20 | connections: 500, | 21 | 21 | duration: 5, | 22 | | - n: [1e6] | | 22 | + n: [1e6], | 23 | 23 | }); | 24 | 24 |
| 25 | 25 | function buildCurrentResource(getServe) { | @@ -30,7 +30,7 @@ function buildCurrentResource(getServe) { | 30 | 30 |
| 31 | 31 | return { | 32 | 32 | server, | 33 | | - close | | 33 | + close, | 34 | 34 | }; | 35 | 35 |
| 36 | 36 | function getCLS() { | @@ -71,7 +71,7 @@ function buildDestroy(getServe) { | 71 | 71 |
| 72 | 72 | return { | 73 | 73 | server, | 74 | | - close | | 74 | + close, | 75 | 75 | }; | 76 | 76 |
| 77 | 77 | function getCLS() { | @@ -108,7 +108,7 @@ function buildAsyncLocalStorage(getServe) { | 108 | 108 |
| 109 | 109 | return { | 110 | 110 | server, | 111 | | - close | | 111 | + close, | 112 | 112 | }; | 113 | 113 |
| 114 | 114 | function getCLS() { | @@ -160,12 +160,12 @@ function getServeCallbacks(getCLS, setCLS) { | 160 | 160 | const types = { | 161 | 161 | 'async-resource': buildCurrentResource, | 162 | 162 | 'destroy': buildDestroy, | 163 | | - 'async-local-storage': buildAsyncLocalStorage | | 163 | + 'async-local-storage': buildAsyncLocalStorage, | 164 | 164 | }; | 165 | 165 |
| 166 | 166 | const asyncMethods = { | 167 | 167 | 'callbacks': getServeCallbacks, | 168 | | - 'async': getServeAwait | | 168 | + 'async': getServeAwait, | 169 | 169 | }; | 170 | 170 |
| 171 | 171 | function main({ type, asyncMethod, connections, duration, path }) { | @@ -178,7 +178,7 @@ function main({ type, asyncMethod, connections, duration, path }) { | 178 | 178 | bench.http({ | 179 | 179 | path, | 180 | 180 | connections, | 181 | | - duration | | 181 | + duration, | 182 | 182 | }, () => { | 183 | 183 | close(); | 184 | 184 | }); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/async_hooks/gc-tracking.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,9 +8,9 @@ const bench = common.createBenchmark(main, { | 8 | 8 | 'trackingEnabled', | 9 | 9 | 'trackingEnabledWithDestroyHook', | 10 | 10 | 'trackingDisabled', | 11 | | - ] | | 11 | + ], | 12 | 12 | }, { | 13 | | - flags: ['--expose-gc'] | | 13 | + flags: ['--expose-gc'], | 14 | 14 | }); | 15 | 15 |
| 16 | 16 | function endAfterGC(n) { | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/async_hooks/http-server.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ const common = require('../common.js'); | 4 | 4 | const bench = common.createBenchmark(main, { | 5 | 5 | asyncHooks: ['init', 'before', 'after', 'all', 'disabled', 'none'], | 6 | 6 | connections: [50, 500], | 7 | | - duration: 5 | | 7 | + duration: 5, | 8 | 8 | }); | 9 | 9 |
| 10 | 10 | function main({ asyncHooks, connections, duration }) { | @@ -14,11 +14,11 @@ function main({ asyncHooks, connections, duration }) { | 14 | 14 | before() {}, | 15 | 15 | after() {}, | 16 | 16 | destroy() {}, | 17 | | - promiseResolve() {} | | 17 | + promiseResolve() {}, | 18 | 18 | }; | 19 | 19 | if (asyncHooks !== 'all' || asyncHooks !== 'disabled') { | 20 | 20 | hooks = { | 21 | | - [asyncHooks]: () => {} | | 21 | + [asyncHooks]: () => {}, | 22 | 22 | }; | 23 | 23 | } | 24 | 24 | const hook = require('async_hooks').createHook(hooks); | @@ -34,7 +34,7 @@ function main({ asyncHooks, connections, duration }) { | 34 | 34 | bench.http({ | 35 | 35 | connections, | 36 | 36 | path, | 37 | | - duration | | 37 | + duration, | 38 | 38 | }, () => { | 39 | 39 | server.close(); | 40 | 40 | }); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/async_hooks/promises.js +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,25 +6,25 @@ let hook; | 6 | 6 | const tests = { | 7 | 7 | disabled() { | 8 | 8 | hook = createHook({ | 9 | | - promiseResolve() {} | | 9 | + promiseResolve() {}, | 10 | 10 | }); | 11 | 11 | }, | 12 | 12 | enabled() { | 13 | 13 | hook = createHook({ | 14 | | - promiseResolve() {} | | 14 | + promiseResolve() {}, | 15 | 15 | }).enable(); | 16 | 16 | }, | 17 | 17 | enabledWithDestroy() { | 18 | 18 | hook = createHook({ | 19 | 19 | promiseResolve() {}, | 20 | | - destroy() {} | | 20 | + destroy() {}, | 21 | 21 | }).enable(); | 22 | 22 | }, | 23 | 23 | enabledWithInitOnly() { | 24 | 24 | hook = createHook({ | 25 | | - init() {} | | 25 | + init() {}, | 26 | 26 | }).enable(); | 27 | | - } | | 27 | + }, | 28 | 28 | }; | 29 | 29 |
| 30 | 30 | const bench = common.createBenchmark(main, { | @@ -34,7 +34,7 @@ const bench = common.createBenchmark(main, { | 34 | 34 | 'enabledWithDestroy', | 35 | 35 | 'enabledWithInitOnly', | 36 | 36 | 'disabled', | 37 | | - ] | | 37 | + ], | 38 | 38 | }); | 39 | 39 |
| 40 | 40 | const err = new Error('foobar'); | |
|