perf(ci): speed up the check job and make native build cache observable - #1260
Conversation
Pass --print-build-logs to the Nix builds so CI shows whether each native package build compiles the derivation or restores it from the Blacksmith sticky-disk Nix store, making cache hits/misses observable.
The check job re-realizes the full optimized native ccusage package on every cache-cold run (~70s), even though ccusage-clippy already compiles the whole workspace with --all-targets and the build-native-packages job produces and verifies the actual release binary. Removing the redundant checks.ccusage entry trims that duplicate release compile from flake check.
Document the dev/native (ccusage) vs distribution (ccusage-static) split at the top of the static package definition so the release matrix's use of .#ccusage-static for Linux is self-explanatory.
📝 WalkthroughWalkthroughGitHub Actions for Linux and macOS builds now emit detailed build logs via ChangesBuild infrastructure for logging and check optimization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | 68e78e9 | Commit Preview URL Branch Preview URL |
Jun 11 2026, 12:13 AM |
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall coverage remains at 77%, unchanged from the Code Coverage is in Public Preview. Learn more and provide us with your feedback. |
ccusage
@ccusage/ccusage-darwin-arm64
@ccusage/ccusage-linux-arm64
@ccusage/ccusage-linux-x64
@ccusage/ccusage-win32-x64
commit: |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
What
Three small CI changes, motivated by investigating why the native release builds and the
checkjob felt slow.1.
perf(ci): drop the duplicateccusagepackage build fromnix flake checkThe
checkjob re-realizes the full optimized nativeccusagepackage on every cache-cold run (~70s), even though:ccusage-clippyalready compiles the entire workspace with--all-targets(so any build break is still caught), andbuild-native-packagesjob already produces and verifies the actual release binary.Removing the redundant
checks.ccusageentry trims that duplicate release compile fromnix flake check.2.
ci: print nix build logs in native package buildsPass
--print-build-logsto the Nix builds (ccusage-static,ccusage) so CI shows whether each build compiled the derivation or restored it from the sticky-disk store — making cache hits/misses observable.3.
docs(nix): explain whyccusage-staticis separate fromccusageDocument the dev/native (
ccusage) vs distribution (ccusage-static) split at the top of the static package definition.Why / findings
While investigating, with
--print-build-logsadded:checkjob swings between ~2m (warm) and ~7–8m (cold): on cold runs its large (~7.7 GiB) per-job sticky disk gets evicted, so it re-vendors crates from crates.io + recompilesccusage-deps+ the package. Nix's caching itself is fine — the CI persistent store just doesn't retain the big closure reliably.Follow-up (not in this PR)
The proper "Nix-way" fix for cold-cache
checkruns is a shared binary cache (attic / cachix) so any runner can fetch the deps/package outputs instead of recompiling them, independent of sticky-disk retention. Happy to do that separately if we want to provision a cache.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Speeds up the
checkjob by removing a redundant native package build and makes Nix build cache behavior visible in CI. Also documents whyccusage-staticis separate fromccusage.Performance
checks.ccusagefromnix flake checkto avoid a duplicate ~70s release compile on cold runners; rely onccusage-clippyand the release job instead.CI and Docs
--print-build-logstonix build .#ccusageandnix build .#ccusage-staticto show compile vs store-restore.ccusage(native/dev) vsccusage-static(musl, fully static, release) split innix/static-package.nix.Written for commit 68e78e9. Summary will update on new commits.
Summary by CodeRabbit