[PR #6035] [MERGED] tools: build_times.py compare puts two build-time reports side by side #6617

Closed
opened 2026-11-03 06:23:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6035
Author: @mariuslozo-boop
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: tools/build-times-compare


📝 Commits (3)

  • c65cb2b tools: build_times.py measures cold and incremental builds per crate (#5794)
  • e30ff91 docs: build-times.md, how to run tools/build_times.py and the first numbers (#5794)
  • 2ae7c88 tools: build_times.py compare puts two reports side by side (#5794)

📊 Changes

4 files changed (+1770 additions, -0 deletions)

View changed files

📝 docs/README.md (+1 -0)
➕ docs/build-times.md (+148 -0)
➕ tests/test_build_times.py (+673 -0)
➕ tools/build_times.py (+948 -0)

📄 Description

🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Sonnet 5.5 + Claude Opus 5.5 review), not by mariuslozo-boop personally.

What and why

Fixes #5794 (part of #3916). Stacked on #6034, which adds tools/build_times.py run; until that merges, this diff shows both. This adds the other half: python3 tools/build_times.py compare before.json after.json, so a crate split can show its build times before and after.

  • One table each, with seconds before, after, the change and the change in percent, for:
    • the cold builds and the nothing-changed build;
    • every incremental build;
    • every crate in either cold build's slowest list;
    • the two critical paths, side by side.
  • A crate, profile or build on one side only gets a dash. A report whose first incremental build failed still compares.
  • "Read with care": the comparison first lists what makes the seconds a poor match: a different CPU, OS, RAM, jobs, rustc, edit mode or edited files, a build variable (RUSTFLAGS, RUSTC_WRAPPER...), and either report's warnings. CARGO_TARGET_DIR doesn't count, because the tool never builds there.
  • A file that isn't a build_times report is refused with exit code 2. --output writes the table to a file as well.
  • docs/build-times.md gets a Compare section, and the docs/README.md line mentions it.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

none

Other projects' code

none

Self-check

6 new tests in tests/test_build_times.py. They cover the before/after/change rows, the machine and jobs notes, build variables (and CARGO_TARGET_DIR not counting), a report with a failed incremental build in either order, entries on one side only, and the command line (--output, a non-report file refused).

pr_ready (tools/pr_ready.py --base tools/build-times on PCDKBLENDER, against tools/build-times at e30ff91de, 1 min 18 s)

Check Result
Scope ✅ 4 files, +200 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 576 passed (1 min 17 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 375 affected,
Label skip-release
  • Run against #6034's branch (--base tools/build-times), so the scope is this pull request's own change.
  • Parity: run on Windows, where the runner needs fcntl and can't start. No harness touches this tool.

Not tested: compare on two real reports from different machines. It was run on reports from this one machine, and in the tests on reports built by hand.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RodDbPWCByh96WKcbiEQpB


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6035 **Author:** [@mariuslozo-boop](https://github.com/mariuslozo-boop) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `tools/build-times-compare` --- ### 📝 Commits (3) - [`c65cb2b`](https://github.com/horizon-rust/horizon/commit/c65cb2b9295c88e94a8c09d3518121f9c99385f4) tools: build_times.py measures cold and incremental builds per crate (#5794) - [`e30ff91`](https://github.com/horizon-rust/horizon/commit/e30ff91de7157c697ab86a6602a2336532c8da71) docs: build-times.md, how to run tools/build_times.py and the first numbers (#5794) - [`2ae7c88`](https://github.com/horizon-rust/horizon/commit/2ae7c880c4ec0beb777ebc90dd1b73922e58e437) tools: build_times.py compare puts two reports side by side (#5794) ### 📊 Changes **4 files changed** (+1770 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/README.md` (+1 -0) ➕ `docs/build-times.md` (+148 -0) ➕ `tests/test_build_times.py` (+673 -0) ➕ `tools/build_times.py` (+948 -0) </details> ### 📄 Description > 🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Sonnet 5.5 + Claude Opus 5.5 review), not by mariuslozo-boop personally. ## What and why Fixes #5794 (part of #3916). Stacked on #6034, which adds `tools/build_times.py run`; until that merges, this diff shows both. This adds the other half: `python3 tools/build_times.py compare before.json after.json`, so a crate split can show its build times before and after. - One table each, with seconds before, after, the change and the change in percent, for: - the cold builds and the nothing-changed build; - every incremental build; - every crate in either cold build's slowest list; - the two critical paths, side by side. - A crate, profile or build on one side only gets a dash. A report whose first incremental build failed still compares. - **"Read with care":** the comparison first lists what makes the seconds a poor match: a different CPU, OS, RAM, jobs, rustc, edit mode or edited files, a build variable (`RUSTFLAGS`, `RUSTC_WRAPPER`...), and either report's warnings. `CARGO_TARGET_DIR` doesn't count, because the tool never builds there. - A file that isn't a `build_times` report is refused with exit code 2. `--output` writes the table to a file as well. - `docs/build-times.md` gets a Compare section, and the `docs/README.md` line mentions it. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference none ## Other projects' code none ## Self-check 6 new tests in `tests/test_build_times.py`. They cover the before/after/change rows, the machine and jobs notes, build variables (and `CARGO_TARGET_DIR` not counting), a report with a failed incremental build in either order, entries on one side only, and the command line (`--output`, a non-report file refused). **pr_ready** (`tools/pr_ready.py --base tools/build-times` on PCDKBLENDER, against tools/build-times at e30ff91de, 1 min 18 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +200 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 576 passed (1 min 17 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 375 affected, | | Label | `skip-release` | - Run against #6034's branch (`--base tools/build-times`), so the scope is this pull request's own change. - Parity: run on Windows, where the runner needs `fcntl` and can't start. No harness touches this tool. Not tested: `compare` on two real reports from different machines. It was run on reports from this one machine, and in the tests on reports built by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RodDbPWCByh96WKcbiEQpB --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:52 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6617
No description provided.