Skip to content

Commit cdca587

Browse files
umarovjasnell
authored andcommitted
benchmark: added a test benchmark for worker
Wrote a sequential benchmark test for worker. This is to make sure the benchmark for work runs properly. PR-URL: #23475 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 1408e32 commit cdca587

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
if (!common.enoughTestMem)
6+
common.skip('Insufficient memory for Worker benchmark test');
7+
8+
// Because the worker benchmarks can run on different threads,
9+
// this should be in sequential rather than parallel to make sure
10+
// it does not conflict with tests that choose random available ports.
11+
12+
const runBenchmark = require('../common/benchmark');
13+
14+
runBenchmark('worker',
15+
[
16+
'n=1',
17+
'sendsPerBroadcast=1',
18+
'workers=1',
19+
'payload=string'
20+
],
21+
{
22+
NODEJS_BENCHMARK_ZERO_ALLOWED: 1
23+
});

0 commit comments

Comments
 (0)