Skip to content

Bench: time signing operations with Tinybench and cold starts with Hyperfine, not hand-written timers - #57

Merged
bompus merged 5 commits into
mainfrom
bench/tinybench-runner
Oct 31, 2026
Merged

bompus merged 5 commits into
mainfrom
bench/tinybench-runner

Conversation

@bompus

@bompus bompus commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

The release phases timed with hand-written performance.now() loops; the host's runner choices are Tinybench for JavaScript operations and Hyperfine for whole commands. This moves the phases onto them. It changes the method, so figures from before and after are not directly comparable; the release reruns every arm.

  • bench/timing.mjs (Tinybench 6.2.2, pinned) times a signing call in batches of 1,000, at least 10 batches in about a second after a warm-up of at least 4 batches (Tinybench's defaults of 64 and 16 batches would run slow signers far past their windows). speed.mjs and speed-more.mjs use it.
  • Cold starts (part D) use Hyperfine 2: import-once.mjs replaces import-time.mjs (no in-process timing; exits 1 on a wrong first signature; candidate none is the harness without a library), one hyperfine call per round and runtime over the control and all arms, rows built by hyperfine-rows.mjs. The start-up metric is the arm's command time minus the control's. Part D keeps the 64 MiB swap-drop rejection, and analyze-memory.mjs fails loudly on import rows from the earlier in-process timer instead of dropping them.
  • memory.mjs loses its hand-written wall timer; CPU time, GC and heap counters stay runtime counters, which neither tool reports.
  • run-admitted.sh defaults to the host lock scheduled jobs honor (~/.cache/setupLinuxHost/post-upgrade-bench.lock) instead of a path nothing else checks. The older run-matrix.sh, run-memory.sh and run-more.sh are marked historical.
  • await-cost.mjs and hash-encode.mjs still use hand timers; they are outside the release phases.

Checked: npm run check; part D ran end to end through run-admitted.sh (admitted, 182 rows). Before/after on the same artifact (two full passes, old then new, and two partial repeats in new then old order, so drift is only partly controlled): 78 speed cells differ by a median of 2.0% (71 within 10%); the cells that moved more than 10% were single-pass noise (a second pass of the old timer agrees with the new runner); cold-start figures land within 1.5 ms. Independent review (GPT-6.1 Sol, xhigh) found three defects (old-format rows dropped silently, part D lost its swap rejection, the batch minimums broke the timing windows); all are fixed in the last commit.

@bompus bompus added the author:anthropic Pull request written by a anthropic model label Oct 31, 2026

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 1 finding(s).

Comment thread bench/run-admitted.sh Resolved

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 1 finding(s).

Comment thread bench/run-admitted.sh Resolved

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (SWE-2 Max, max reasoning): 0 finding(s).

Review 3: only high findings and above are posted from here on.

@bompus
bompus merged commit c662f0e into main Oct 31, 2026
7 checks passed
@bompus
bompus deleted the bench/tinybench-runner branch October 31, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:anthropic Pull request written by a anthropic model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant