Skip to content

perf(ci): drop the full dev shell from the test job - #1269

Merged
ryoppippi merged 1 commit into
ci/push-main-onlyfrom
ci/test-job-lean-shell
Jun 11, 2026
Merged

ryoppippi merged 1 commit into
ci/push-main-onlyfrom
ci/test-job-lean-shell

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

Summary

The test job spent ~73s on "Warm Nix dev shell" realizing the complete
development shell (every linter, formatter, renovate, and the pre-commit hook
closure) while pnpm install itself was only ~7s.

Now that coverage is a nix build derivation (#1266), Vitest is the only step
that needs a JS toolchain. This replaces nix develop with
nix profile install pnpm_11 bun just — the same pattern already used by the
perf-comment and pkg-pr-new jobs — and runs just test-vitest directly.

Why

The full dev shell pulls in tooling the test job never uses. Installing only
pnpm/bun/just skips that closure entirely.

Notes


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Drop the full Nix dev shell from the test job to cut ~73s of shell warmup. Install only pnpm_11, bun, and just, run Vitest directly, and keep coverage via nix build.

  • Refactors
    • Replace nix develop with nix profile install nixpkgs#pnpm_11 nixpkgs#bun nixpkgs#just.
    • Add pnpm install --frozen-lockfile; run tests with just test-vitest.
    • Coverage unchanged (nix build .#ccusage-coverage).

Written for commit 0a3391e. Summary will update on new commits.

Review in cubic

The test job spent ~73s on "Warm Nix dev shell" realizing the complete
development shell — every linter, formatter, renovate, and the pre-commit hook
closure — even though pnpm install itself was only ~7s. Now that coverage is a
`nix build` derivation, Vitest is the sole step that needs a JS toolchain.

Replace `nix develop` with `nix profile install pnpm_11 bun just`, mirroring the
perf-comment and pkg-pr-new jobs, then run `just test-vitest` directly. This
skips the heavy shell closure while keeping the exact tools Vitest needs.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d3a8c0d9-b75d-40ee-bd4a-d83d8588b435

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/test-job-lean-shell

Comment @coderabbitai help to get the list of available commands and usage tips.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — drops the full dev shell from the test CI job, replacing it with nix profile install for just the three tools Vitest needs (pnpm/bun/just). Follows the same pattern already used by the perf-comment and pkg-pr-new jobs.

  • Replace nix develop with nix profile install — installs only pnpm_11, bun, and just instead of realizing the full dev shell (~73s → near-zero overhead).
  • Add explicit pnpm install --frozen-lockfile — previously handled by the dev shell's implicit hook; now an explicit step after tooling install.
  • Drop nix develop --command wrapper from just test-vitest — runs just directly since it's on $PATH via the Nix profile.

Pullfrog  | View workflow run | Using Big Pickle (free via Pullfrog for OSS) | 𝕏

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 0a3391e Commit Preview URL

Branch Preview URL
Jun 11 2026, 03:09 PM

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall coverage remains at 77%, unchanged from the ci/push-main-only branch.


Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 0a3391e302b2
Base SHA: 7a385661f167

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new 7a385661f167 846.0ms 956.1ms 60.2ms 3
PR pkg.pr.new 0a3391e 867.1ms 938.8ms 57.6ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: 7a385661f167; PR package: 0a3391e. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 1.009s 935.6ms 1.08x 723.75 MiB 742.00 MiB 1.03x 1021.34 MiB/s 1.08 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 216.2ms 204.3ms 1.06x 92.00 MiB 92.75 MiB 1.01x 4.66 GiB/s 4.93 GiB/s

Package runtime diagnostics

Compares 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 992.1ms 1.01 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 898.9ms 1.12 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 178.1ms 5.65 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 139.8ms 7.20 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 50.6ms 7.2ms 7.03x 43.00 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.21 MiB/s
claude session --offline --json 0.00 MiB 48.4ms 7.2ms 6.70x 43.00 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.21 MiB/s
codex daily --offline --json 0.00 MiB 50.2ms 6.6ms 7.66x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.13 MiB/s
codex session --offline --json 0.00 MiB 49.5ms 6.6ms 7.55x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.13 MiB/s

Large real-world-shaped fixture performance

Generated 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 940.9ms 1.036s 0.91x 735.75 MiB 742.50 MiB 1.01x 1.07 GiB/s 995.22 MiB/s
codex --offline --json 1.01 GiB 182.2ms 141.3ms 1.29x 91.75 MiB 89.25 MiB 0.97x 5.53 GiB/s 7.13 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.32 KiB 17.32 KiB +0.00 KiB 1.00x
installed native package binary 3324.84 KiB 3324.84 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 0a3391e302b2
Base SHA: 7a385661f167

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new 7a385661f167 896.5ms 1.001s 56.9ms 3
PR pkg.pr.new 0a3391e 1.012s 1.011s 59.0ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: 7a385661f167; PR package: 0a3391e. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 1.072s 973.2ms 1.10x 734.25 MiB 738.25 MiB 1.01x 961.96 MiB/s 1.03 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 192.5ms 190.0ms 1.01x 94.25 MiB 93.25 MiB 0.99x 5.23 GiB/s 5.30 GiB/s

Package runtime diagnostics

Compares 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 1.036s 995.52 MiB/s 1
claude --offline --json Installed native binary 1.01 GiB 902.1ms 1.12 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 180.4ms 5.58 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 133.5ms 7.54 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 43.3ms 45.8ms 0.95x 43.00 MiB 43.25 MiB 1.01x 0.04 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 44.9ms 45.3ms 0.99x 43.25 MiB 43.00 MiB 0.99x 0.03 MiB/s 0.03 MiB/s
codex daily --offline --json 0.00 MiB 47.0ms 46.9ms 1.00x 43.25 MiB 43.00 MiB 0.99x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 47.5ms 47.8ms 0.99x 43.00 MiB 43.25 MiB 1.01x 0.02 MiB/s 0.02 MiB/s

Large real-world-shaped fixture performance

Generated 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 929.6ms 929.8ms 1.00x 736.00 MiB 731.75 MiB 0.99x 1.08 GiB/s 1.08 GiB/s
codex --offline --json 1.01 GiB 177.2ms 174.4ms 1.02x 94.00 MiB 92.75 MiB 0.99x 5.68 GiB/s 5.77 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.32 KiB 17.32 KiB +0.00 KiB 1.00x
installed native package binary 3324.84 KiB 3324.84 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@ryoppippi
ryoppippi merged commit 6d4ea65 into ci/push-main-only Jun 11, 2026
25 checks passed
@ryoppippi
ryoppippi deleted the ci/test-job-lean-shell branch June 11, 2026 15:14
ryoppippi added a commit that referenced this pull request Jun 11, 2026
* perf(ci): run CI once per change instead of twice

`on: { push, pull_request }` with no branch filter meant every push to a PR
branch triggered the full workflow twice — once for `push` and once for
`pull_request` — duplicating the check, test, and native-build matrix on every
commit.

Restrict `push` to `main` so branch commits are validated once via the
`pull_request` event, while main keeps its post-merge run. Rust tests stay
covered: the `Run test suite` step only fired on pushes to non-default
branches (now gone), and the coverage step already runs `cargo llvm-cov` over
the workspace on both remaining triggers. Drop that dead step and the
now-always-true event guards on the Vitest and coverage steps.

* perf(ci): drop the full dev shell from the test job (#1269)

The test job spent ~73s on "Warm Nix dev shell" realizing the complete
development shell — every linter, formatter, renovate, and the pre-commit hook
closure — even though pnpm install itself was only ~7s. Now that coverage is a
`nix build` derivation, Vitest is the sole step that needs a JS toolchain.

Replace `nix develop` with `nix profile install pnpm_11 bun just`, mirroring the
perf-comment and pkg-pr-new jobs, then run `just test-vitest` directly. This
skips the heavy shell closure while keeping the exact tools Vitest needs.
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