Skip to content

fix: benchmarkMode=time respect minSamples#165

Open
gusanthiago wants to merge 5 commits into
RafaelGSS:mainfrom
gusanthiago:bugfix/adjust-minSamples
Open

fix: benchmarkMode=time respect minSamples#165
gusanthiago wants to merge 5 commits into
RafaelGSS:mainfrom
gusanthiago:bugfix/adjust-minSamples

Conversation

@gusanthiago

@gusanthiago gusanthiago commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Hello guys, this PR should close issue #130

Proposed Changes

  • Time mode now honors minSamples: each sample is one independent execution of the benchmark function, collected until minSamples is reached per round.
  • totalTime reports the mean execution time across all collected samples (not averaged per repeatSuite round).
  • iterations reflects the total number of samples collected (minSamples × repeatSuite).
  • Added tests covering minSamples alone and combined with repeatSuite.
  • Updated README, index.d.ts, examples/time-mode.js.

Test plan

  • npm test -- test/time-mode.js — new tests pass:
  • node --allow-natives-syntax examples/time-mode.js
Screenshot 2026-06-21 at 23 21 04

@gusanthiago gusanthiago marked this pull request as ready for review June 22, 2026 02:31
@H4ad H4ad self-assigned this Jun 26, 2026
Comment thread CHANGELOG.md Outdated
Comment thread index.d.ts Outdated
@gusanthiago gusanthiago force-pushed the bugfix/adjust-minSamples branch from 80ab0d0 to 417a737 Compare June 28, 2026 18:30
@gusanthiago gusanthiago requested a review from RafaelGSS June 28, 2026 18:47
@gusanthiago gusanthiago force-pushed the bugfix/adjust-minSamples branch from ccf9bdd to b560216 Compare June 28, 2026 19:03
@H4ad H4ad removed their assignment Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants