Skip to content

Commit

Permalink
benchmark: added a test benchmark for worker
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
umarov authored and MylesBorins committed Oct 30, 2018
1 parent 46f944f commit 99d39f9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/sequential/test-benchmark-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

const common = require('../common');

if (!common.enoughTestMem)
common.skip('Insufficient memory for Worker benchmark test');

// Because the worker benchmarks can run on different threads,
// this should be in sequential rather than parallel to make sure
// it does not conflict with tests that choose random available ports.

const runBenchmark = require('../common/benchmark');

runBenchmark('worker',
[
'n=1',
'sendsPerBroadcast=1',
'workers=1',
'payload=string'
],
{
NODEJS_BENCHMARK_ZERO_ALLOWED: 1
});

0 comments on commit 99d39f9

Please sign in to comment.