Skip to content

perf(bench): add install phase timings#381

Merged
jdx merged 1 commit intomainfrom
codex/install-phase-timings
Apr 29, 2026
Merged

perf(bench): add install phase timings#381
jdx merged 1 commit intomainfrom
codex/install-phase-timings

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented Apr 29, 2026

Summary

  • add an opt-in AUBE_BENCH_PHASES_FILE JSONL sink for install phase timings
  • sample aube install-shaped benchmark scenarios after the hyperfine matrix
  • generate markdown and JSON phase timing summaries from the sampled JSONL

Validation

  • cargo fmt --check
  • bash -n benchmarks/bench.sh
  • node --check benchmarks/generate-phase-results.mjs
  • cargo check -p aube
  • smoke-tested benchmarks/generate-phase-results.mjs with sample JSONL

Note

Low Risk
Changes touch core install code, but the new timing collection and file I/O are gated behind AUBE_BENCH_PHASES_FILE, so normal installs should be unaffected aside from minimal added timing calls.

Overview
Adds an opt-in install phase timing sink to aube install: when AUBE_BENCH_PHASES_FILE is set, the installer records per-phase durations (e.g. resolve/fetch/link/scripts/state/sweep) and appends a JSONL summary including counts and an optional AUBE_BENCH_SCENARIO label.

Extends benchmarks/bench.sh to run one extra aube-only sample per install-shaped scenario that writes phase timings, and adds benchmarks/generate-phase-results.mjs to convert the collected JSONL into a Markdown table plus a structured JSON artifact.

Reviewed by Cursor Bugbot for commit 0714efd. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

Adds an opt-in AUBE_BENCH_PHASES_FILE/AUBE_BENCH_SCENARIO instrumentation path to aube install that records per-phase durations (resolve, fetch, link, scripts, state, sweep) and appends a JSONL row at the end of each run. bench.sh runs one extra aube-only pass per install-shaped scenario to populate the sink, and generate-phase-results.mjs converts it into a Markdown table and structured JSON artifact.

Confidence Score: 5/5

Safe to merge — all instrumentation is gated behind env vars and the write method is best-effort (failures logged at debug level, never propagated).

No P0 or P1 issues found. All timing records are correctly scoped inside their respective conditional blocks in Rust; duplicated resolve/fetch records across the two code paths are harmless since only one path executes per run. The two P2 findings are robustness improvements for the benchmark script only.

benchmarks/generate-phase-results.mjs — bare JSON.parse without error handling and implicit .md suffix assumption for JSON output path.

Important Files Changed

Filename Overview
benchmarks/bench.sh Adds run_aube_phase_bench to run aube-only single-shot installs with phase-timing env vars injected, extracts cold-prep to a reusable COLD_PREP variable, and invokes generate-phase-results.mjs when the JSONL sink is non-empty.
benchmarks/generate-phase-results.mjs New script that parses the JSONL phase-timing sink and emits a Markdown table plus a structured JSON artifact; root_preinstall is correctly present in phaseOrder. Minor robustness gaps: bare JSON.parse without error handling and implicit .md suffix assumption for the JSON output path.
crates/aube/src/commands/install/mod.rs Adds InstallPhaseTimings struct with gated record/write methods; all phase start/record pairs are correctly scoped inside their respective conditional blocks. Duplicated record("resolve"/"fetch") calls across the two code paths (lockfile vs. fresh) are safe because only one path executes per run.

Fix All in Claude Code

Reviews (3): Last reviewed commit: "perf(bench): add install phase timings" | Re-trigger Greptile

Comment thread benchmarks/generate-phase-results.mjs
Comment thread benchmarks/generate-phase-results.mjs
@jdx jdx force-pushed the codex/install-phase-timings branch from d548679 to 1c578cf Compare April 29, 2026 14:22
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1c578cf. Configure here.

Comment thread benchmarks/bench.sh Outdated
@jdx jdx force-pushed the codex/install-phase-timings branch from 1c578cf to 0714efd Compare April 29, 2026 14:35
@jdx jdx merged commit b5674b3 into main Apr 29, 2026
17 checks passed
@jdx jdx deleted the codex/install-phase-timings branch April 29, 2026 14:45
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.

1 participant