Skip to content

Commit 397f4c2

Browse files
committed
fix(benchmarks): Increase MAX_INTERRUPT_ACTIONS and give process more RAM
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 136fe29 commit 397f4c2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test": "node --unhandled-rejections=strict test/selenium-runner.js",
1414
"test:node:fake": "npm run build:test-node && node dist/node-tests/fake-tests.js",
1515
"test:node:fake:full": "npm run build:test-node && node dist/node-tests/fake-tests.js",
16-
"test:node:fake:benchmark": "npm run build:test-node && FLOCCUS_TEST=benchmark FLOCCUS_NODE_INCLUDE_BENCHMARK=true node dist/node-tests/fake-tests.js",
16+
"test:node:fake:benchmark": "npm run build:test-node && NODE_OPTIONS=--max-old-space-size=4096 FLOCCUS_TEST=benchmark FLOCCUS_NODE_INCLUDE_BENCHMARK=true node dist/node-tests/fake-tests.js",
1717
"test:appium": "node --unhandled-rejections=strict test/appium-runner.js",
1818
"lint": "eslint --ext .js,.vue src",
1919
"lint:fix": "eslint --ext .js,.vue src --fix",

src/test/benchmark.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Floccus', function() {
3838
// counts are precomputed once from the PRNG and then cycled through, so the
3939
// interrupt schedule is independent of how many random draws the tree
4040
// manipulations consume in between.
41-
const MAX_INTERRUPT_ACTIONS = 500
41+
const MAX_INTERRUPT_ACTIONS = 1000
4242
let interruptCounts = []
4343
let i = 0
4444
const nextInterruptCount = () => {
@@ -47,7 +47,7 @@ describe('Floccus', function() {
4747
// Allow between 1 action and an increasing bound (growing over stretches of
4848
// 20, then resetting). Draws larger than the remaining plan simply let that
4949
// sync complete uninterrupted, mirroring the old "long timeout" behaviour.
50-
testRandom.int(1, Math.round(1 + (MAX_INTERRUPT_ACTIONS - 1) * (index % 20) / 20))
50+
testRandom.int(1, Math.round(1 + (MAX_INTERRUPT_ACTIONS - 1) * ((index + 1) % 20) / 20))
5151
)
5252
}
5353
return interruptCounts[(i++) % 1000]

0 commit comments

Comments
 (0)