Skip to content

Commit

Permalink
fix: call garbage collector before each benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
jerome-benoit committed Sep 29, 2024
1 parent f84c010 commit 21bdbf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ const executeBenchmarks = async (
opts = {},
groupOpts = {}
) => {
gc()
let once = false
for (const benchmark of benchmarks) {
once = true
overrideBenchmarkDefaults(benchmark, opts)
try {
gc()
benchmark.stats = await measure(
benchmark.fn,
benchmark.before,
Expand Down

0 comments on commit 21bdbf3

Please sign in to comment.