ReviewOS

stacks/bun-router

bench: make runtime-entry import cost reproducible

#897
Closed chris opened this 8 days ago ·
8 days ago

The new @stacksjs/bun-router/runtime entry in #896 has deterministic graph and behavior coverage, but fresh-process timing and RSS are currently measured by an ignored one-off script. That makes later entry changes hard to compare and leaves the result tied to one developer machine.

Add a checked-in diagnostic that compares the root and runtime entries after the normal production build. Each variant must run in a fresh process, import and verify the same required serving symbols, force GC before the final RSS reading, and run in alternating order for at least 15 pairs. Preserve every raw sample and report medians, paired median ratios, and the number of pairs where runtime is lower.

Add a manual GitHub Actions workflow using the latest stable Bun. It must upload the JSON result as an artifact and clearly label hosted-runner numbers as diagnostic, not publishable rankings. Record the exact Bun version, executable, OS, architecture, commit, and dirty state.

This supports #896 and downstream stacksjs/stacks#2590. It does not replace the local sampled host-load guard or authorize a stable package release.

8 days ago

Implemented and pushed to main in 19c592a.

The checked-in diagnostic runs alternating fresh processes, verifies identical required serving symbols, forces GC before RSS sampling, retains every raw sample, calculates medians and paired ratios, and records Bun, host, commit, and before/after worktree state. The manual workflow uses latest stable Bun and uploads the JSON artifact with a diagnostic-only label.

Validation:

Sign in to comment on this issue.