ReviewOS

stacks/bun-router

bench(router): record built import graphs in runtime diagnostics

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

Problem

The runtime import diagnostic records startup time and settled RSS, but its JSON artifact does not record the built static graph that produced those measurements. The 0.1.19 runtime work changed both the number of reachable files and their byte size, and that evidence currently has to be reconstructed manually from dist/.

Expected

The same diagnostic artifact should record, for the package root and runtime entries:

  • every statically reachable built JavaScript file,
  • the byte size of each file,
  • total reachable files and bytes,
  • the runtime delta and percent change against the root.

This is deterministic build evidence. It should sit alongside, but remain distinct from, the hosted-machine startup and RSS diagnostics.

Validation

Build and run the diagnostic on exact Bun 1.4.2, verify the recorded totals against the files on disk, then retain a clean exact-revision hosted artifact.

8 days ago

Implemented in 429dc0c.

The diagnostic now follows Bun's parsed static import statements from each built entry and records every reachable file, per-file bytes, total files and bytes, and the runtime delta against the package root.

The clean exact-revision hosted run used latest stable Bun 1.4.2 and completed 30 alternating fresh-process pairs: https://github.com/stacksjs/bun-router/actions/runs/35571734078

Raw artifact: https://github.com/stacksjs/bun-router/actions/runs/35571734078/artifacts/10626456618

Recorded build evidence:

  • root: 372,317 bytes across 4 files
  • runtime: 114,700 bytes across 2 files
  • runtime reduction: 257,617 bytes or 69.19%

Recorded process diagnostics:

  • median import: 11.426182 ms root, 5.0419315 ms runtime, 55.87% lower, runtime lower in 30 of 30 pairs
  • median settled RSS: 30,447,616 bytes root, 27,172,864 bytes runtime, 3,274,752 bytes or 10.76% lower, runtime lower in 30 of 30 pairs

The artifact records clean source before and after at the exact commit. These process measurements remain hosted-runner diagnostics; the static graph values are deterministic build evidence. Local exact Bun 1.4.2 typechecks, pickier lint, and a 15-pair diagnostic also passed. I will close this issue after the exact main CI run is green.

8 days ago

The exact benchmark revision passed the full main CI workflow: https://github.com/stacksjs/bun-router/actions/runs/35571715757

The hosted artifact contains clean source provenance, the complete built graphs, and all 60 process samples. The diagnostic reporting work is complete.

Sign in to comment on this issue.