Skip to content

ci: run perf-comment and pkg-pr-new jobs without the full Nix dev shell - #1258

Merged
ryoppippi merged 3 commits into
mainfrom
perf-comment-packages-no-rust-build
Jun 10, 2026
Merged

ryoppippi merged 3 commits into
mainfrom
perf-comment-packages-no-rust-build

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Several CI jobs entered the full nix develop dev shell (Rust toolchain, litellm, typescript-go, …) just to run a few bun/pnpm scripts that never touch Rust. This slims the ccusage perf comment, ccusage rust perf comment, and npm-publish-dry-run-and-upload-pkg-pr-now jobs down to the tools they actually use, provisioned with nix profile install --inputs-from . … (pinned to the flake's locked nixpkgs).

Follows up #1257 (release publish off the dev shell + per-github.job sticky-disk keys). With per-job sticky disks, each job warms its own store; provisioning only what it needs keeps that store tiny instead of caching the whole dev shell.

What changed

perf-comment jobs (ccusage perf comment, ccusage rust perf comment)

  • compare-pr-performance.ts already benchmarks the native binary bundled in the installed pkg.pr.new package (installedNativePackageBinEntry → node_modules/@ccusage/ccusage-<plat>-<arch>/bin/ccusage) — no local Rust build, confirmed by job logs (package installs + "Installed native binary" benchmark, zero cargo/Compiling).
  • Replace nix develop with nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just + pnpm install --frozen-lockfile, then run the scripts directly. No change to compare-pr-performance.ts.

pkg-pr-new dry-run job

  • Packing only repackages the native binaries restored from the build matrix, so no Rust toolchain is needed (bun is fetched via engines.runtime during pnpm install).
  • Replace nix develop --command pnpm pkg-pr-new publish with nix profile install --inputs-from . nixpkgs#pnpm + pnpm install --frozen-lockfile + a direct pnpm pkg-pr-new publish.

Comments added to all three jobs explaining why the dev shell is unnecessary (prebuilt binaries, no cargo).

node continues to come from the runner image. The typecheck and test jobs keep nix develop — they genuinely need the full toolchain (cargo, clippy, cargo-llvm-cov, tsgo, vitest). The build matrix is untouched: linux/mac-arm use targeted nix build .#ccusage[-static], and Intel mac / Windows already cargo build with the runner's system Rust (pinned by rust-toolchain.toml) — none use the dev shell.

Why

Pulling the entire Rust dev shell to run a benchmarking or packaging script is pure overhead; on a cold sticky-disk miss it is ~4.5 min of download. The minimal tool set is a small closure (cold ~tens of seconds, instant when warm).

Testing / validation

  • actionlint clean on ci.yaml; zizmor findings identical before/after; pre-commit hooks pass.
  • Verified the perf script's head-binary resolution comes from the installed package (the rust/target/release/ccusage path is only a fallback / size-table entry, absent in CI).
  • Confirmed each script's external deps: compare-pr-performance.ts spawns hyperfine and imports gunshi/fs-fixture; generate-large-fixture.ts imports gunshi; upsert-pr-comment.ts uses fetch only — all covered by the installed tools + pnpm install.

All three jobs run on PR CI, so this PR exercises the changes directly.

Summary by CodeRabbit

  • Chores
    • CI workflows updated: a job key and dependency were adjusted, and test jobs now warm the dev shell before timed steps.
    • Tooling is now provisioned via profiles and installed up front; packaging, fixture generation, and performance-comparison steps invoke tools directly rather than through the previous wrapper.

The `ccusage perf comment` and `ccusage rust perf comment` jobs entered the
full `nix develop` dev shell (Rust toolchain, litellm, typescript-go, …) only
to run a handful of bun/pnpm scripts. `compare-pr-performance.ts` already
benchmarks the native binary bundled in the installed pkg.pr.new package
(`installedNativePackageBinEntry` → node_modules/@ccusage/ccusage-<plat>-<arch>/bin/ccusage),
so no Rust build — and therefore no cargo/toolchain — is involved.

Provision only the tools these jobs actually use via
`nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just`
(pinned to the flake's locked nixpkgs) plus an explicit
`pnpm install --frozen-lockfile` (previously done by the dev shell's shellHook),
and run the scripts directly. node continues to come from the runner image.
This shrinks the cold closure from the whole dev shell to four small tools.
@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0091b281-50d2-443d-8f25-9b97e3e6b3e8

📥 Commits

Reviewing files that changed from the base of the PR and between 388496f and ace4c86.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yaml

📝 Walkthrough

Walkthrough

CI workflow updates replace nix develop --command wrappers by installing tooling with nix profile install and running pnpm, just, and bun directly; also renames lint-check → check and warms the Nix dev shell early in the test job.

Changes

Workflow unwrapping and direct tooling execution

Layer / File(s) Summary
Rename lint job and adjust downstream needs
.github/workflows/ci.yaml
Rename lint-check to check and update action-timeline to depend on check.
Warm Nix dev shell in test job
.github/workflows/ci.yaml
Add nix develop --command true as an early test job step to realize the dev shell before timed tests.
npm-publish-dry-run and publish
.github/workflows/ci.yaml
Packing step provisions pnpm via nix profile install and runs pnpm install --frozen-lockfile; publish now calls pnpm pkg-pr-new publish directly.
ccusage-perf-comment job updates
.github/workflows/ci.yaml
Install pnpm, bun, hyperfine, just via nix profile install, run pnpm install --frozen-lockfile, use just generate-large-fixture, and run comparisons/PR upserts via pnpm exec bun.
ccusage-rust-perf-comment job updates
.github/workflows/ci.yaml
Apply same pattern to Rust perf job: explicit tooling install, pnpm install --frozen-lockfile, just generate-large-fixture, and pnpm exec bun for comparisons and PR upsert.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant NixProfile
  participant PNPM
  participant Just
  participant Bun
  GitHubActions->>NixProfile: nix profile install pnpm,bun,hyperfine,just
  GitHubActions->>PNPM: pnpm install --frozen-lockfile
  GitHubActions->>Just: just generate-large-fixture
  PNPM->>Bun: pnpm exec bun compare-pr-performance.ts
  PNPM->>Bun: pnpm exec bun upsert-pr-comment.ts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ccusage/ccusage#1254: Overlapping CI/Nix refactor that rewrites nix develop invocation patterns in workflow jobs.
  • ccusage/ccusage#1257: Similar changes removing nix develop --command wrappers and installing/running pnpm/bun directly.

Suggested reviewers

  • pullfrog

Poem

A rabbit hops through CI workflows neat,
Installs the tools and skips the shell's retreat,
pnpm, just, and bun now run in a row,
No extra nix develop to slow the show—
The pipeline hums, and the tests all go! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: optimizing CI by removing the full Nix dev shell dependency from three specific jobs (perf-comment and pkg-pr-new) while keeping it for jobs that genuinely need it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf-comment-packages-no-rust-build

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 10, 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 ace4c86 Commit Preview URL

Branch Preview URL
Jun 10 2026, 11:25 PM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/ci.yaml (2)

223-225: 💤 Low value

Consider adding a step name for consistency.

The perf tooling installation and dependency setup look correct. The --inputs-from . flag properly pins to the flake.lock, and all required tools (pnpm, bun, hyperfine, just) are installed.

However, the pnpm install step on line 225 is missing a name: field. While valid YAML, adding a name would improve consistency with the rest of the workflow.

📝 Suggested improvement
       - name: Install perf tooling
         run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
-      - run: pnpm install --frozen-lockfile
+      - name: Install dependencies
+        run: pnpm install --frozen-lockfile
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml around lines 223 - 225, The workflow step that
runs "pnpm install --frozen-lockfile" is missing a name; add a descriptive
"name:" field (e.g., "Install dependencies" or "Install pnpm dependencies")
above the run line to match the rest of the workflow and improve readability and
consistency with the preceding "Install perf tooling" step.

297-299: 💤 Low value

Consider adding a step name for consistency (mirrors ccusage-perf-comment).

Same perf tooling setup as the ccusage-perf-comment job. The pnpm install step on line 299 is also missing a name: field.

📝 Suggested improvement
       - name: Install perf tooling
         run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
-      - run: pnpm install --frozen-lockfile
+      - name: Install dependencies
+        run: pnpm install --frozen-lockfile
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml around lines 297 - 299, The workflow step running
"pnpm install --frozen-lockfile" is missing a name for consistency with the
"Install perf tooling" step and the ccusage-perf-comment job; add a top-level
"name:" key (e.g., "Install dependencies" or "Install pnpm deps") immediately
above the run: pnpm install --frozen-lockfile line, matching indentation and
style used by the "Install perf tooling" step so both steps have explicit names.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 223-225: The workflow step that runs "pnpm install
--frozen-lockfile" is missing a name; add a descriptive "name:" field (e.g.,
"Install dependencies" or "Install pnpm dependencies") above the run line to
match the rest of the workflow and improve readability and consistency with the
preceding "Install perf tooling" step.
- Around line 297-299: The workflow step running "pnpm install
--frozen-lockfile" is missing a name for consistency with the "Install perf
tooling" step and the ccusage-perf-comment job; add a top-level "name:" key
(e.g., "Install dependencies" or "Install pnpm deps") immediately above the run:
pnpm install --frozen-lockfile line, matching indentation and style used by the
"Install perf tooling" step so both steps have explicit names.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f2fe720-4cfc-4ded-985b-75fe93223a61

📥 Commits

Reviewing files that changed from the base of the PR and between 85aa44b and 95cfc77.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml

@github-code-quality

github-code-quality Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall coverage remains at 77%, unchanged from the main branch.


Updated June 10, 2026 23:20 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@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

The pkg-pr-new dry-run job entered the full `nix develop` dev shell only to run
`pnpm pkg-pr-new publish`. Packing repackages the native binaries restored from
the build matrix, so no Rust toolchain is involved (bun is fetched via the
engines.runtime entry during `pnpm install`). Provision just pnpm with
`nix profile install --inputs-from . nixpkgs#pnpm` plus an explicit
`pnpm install --frozen-lockfile`, matching the release and perf-comment jobs.

Add comments to the pkg-pr-new and perf-comment jobs explaining why the dev
shell is unnecessary, since the reasoning (prebuilt binaries, no cargo) is not
obvious from the step alone.
@ryoppippi ryoppippi changed the title ci: run perf-comment jobs without the full Nix dev shell ci: run perf-comment and pkg-pr-new jobs without the full Nix dev shell Jun 10, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1258

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1258

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1258

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1258

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1258

commit: ace4c86

Two CI tweaks:

- Rename the `lint-check` job to `check` (and its action-timeline `needs`
  reference). `nix flake check` covers far more than linting — clippy, treefmt,
  schema drift, gitleaks, build — so `check` describes it better.
- Add a `nix develop --command true` warm-up step to the `test` job so the dev
  shell realization and its pnpm install hook land in a dedicated step instead
  of bleeding into the first timed step and adding noise to action-timeline.
@pkg-pr-new

pkg-pr-new Bot commented Jun 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1258

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1258

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1258

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1258

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1258

commit: 388496f

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 388496f2304c
Base SHA: 85aa44bed99a

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 85aa44bed99a 1.237s 757.8ms 46.7ms 3
PR pkg.pr.new 388496f 1.060s 1.152s 46.7ms 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: 85aa44bed99a; PR package: 388496f. 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 888.4ms 922.7ms 0.96x 738.00 MiB 726.00 MiB 0.98x 1.13 GiB/s 1.09 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 181.2ms 179.6ms 1.01x 91.25 MiB 90.50 MiB 0.99x 5.56 GiB/s 5.61 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 948.0ms 1.06 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 898.4ms 1.12 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 172.5ms 5.84 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 130.0ms 7.74 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 38.9ms 43.4ms 0.89x 43.25 MiB 43.25 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 38.1ms 38.6ms 0.99x 43.00 MiB 43.00 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 37.6ms 37.9ms 0.99x 43.25 MiB 43.00 MiB 0.99x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 38.4ms 37.2ms 1.03x 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 864.0ms 934.4ms 0.92x 725.25 MiB 733.00 MiB 1.01x 1.17 GiB/s 1.08 GiB/s
codex --offline --json 1.01 GiB 168.6ms 166.0ms 1.02x 88.00 MiB 90.25 MiB 1.03x 5.97 GiB/s 6.06 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.32 KiB 17.33 KiB +0.00 KiB 1.00x
installed native package binary 3353.74 KiB 3353.74 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: 388496f2304c
Base SHA: 85aa44bed99a

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 85aa44bed99a 807.9ms 846.4ms 43.0ms 3
PR pkg.pr.new 388496f 920.0ms 928.5ms 46.9ms 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: 85aa44bed99a; PR package: 388496f. 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 952.0ms 870.9ms 1.09x 687.50 MiB 732.00 MiB 1.06x 1.06 GiB/s 1.16 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 183.2ms 175.6ms 1.04x 90.75 MiB 91.75 MiB 1.01x 5.49 GiB/s 5.73 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 893.6ms 1.13 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 846.7ms 1.19 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 163.6ms 6.15 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 121.8ms 8.27 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 39.3ms 5.2ms 7.55x 43.00 MiB 2.75 MiB 0.06x 0.04 MiB/s 0.30 MiB/s
claude session --offline --json 0.00 MiB 39.5ms 5.4ms 7.31x 43.25 MiB 2.50 MiB 0.06x 0.04 MiB/s 0.29 MiB/s
codex daily --offline --json 0.00 MiB 36.6ms 4.9ms 7.41x 43.00 MiB 2.50 MiB 0.06x 0.02 MiB/s 0.17 MiB/s
codex session --offline --json 0.00 MiB 36.7ms 5.0ms 7.36x 43.25 MiB 2.50 MiB 0.06x 0.02 MiB/s 0.17 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 791.9ms 762.1ms 1.04x 728.00 MiB 723.00 MiB 0.99x 1.27 GiB/s 1.32 GiB/s
codex --offline --json 1.01 GiB 163.0ms 129.1ms 1.26x 89.50 MiB 90.25 MiB 1.01x 6.18 GiB/s 7.80 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.32 KiB 17.33 KiB +0.00 KiB 1.00x
installed native package binary 3353.74 KiB 3353.74 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.

@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.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/ci.yaml">

<violation number="1" location=".github/workflows/ci.yaml:23">
P2: Renaming the CI job ID from `lint-check` to `check` changes the check-run context and can silently break required branch-protection checks.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread .github/workflows/ci.yaml
uses: ./.github/actions/detect-code-changes

lint-check:
check:

@cubic-dev-ai cubic-dev-ai Bot Jun 10, 2026 •

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.

P2: Renaming the CI job ID from lint-check to check changes the check-run context and can silently break required branch-protection checks.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yaml, line 23:

<comment>Renaming the CI job ID from `lint-check` to `check` changes the check-run context and can silently break required branch-protection checks.</comment>

<file context>
@@ -20,7 +20,7 @@ jobs:
         uses: ./.github/actions/detect-code-changes
 
-  lint-check:
+  check:
     needs: changes
     if: needs.changes.outputs.code-changed == 'true'
</file context>
Fix with cubic

@ryoppippi
ryoppippi merged commit da04f8b into main Jun 10, 2026
28 checks passed
@ryoppippi
ryoppippi deleted the perf-comment-packages-no-rust-build branch June 10, 2026 23:29
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: ace4c86bda91
Base SHA: 85aa44bed99a

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 85aa44bed99a 753.2ms 712.3ms 49.1ms 3
PR pkg.pr.new ace4c86 1.314s 908.7ms 48.5ms 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: 85aa44bed99a; PR package: ace4c86. 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 907.2ms 879.1ms 1.03x 735.75 MiB 729.75 MiB 0.99x 1.11 GiB/s 1.15 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 185.0ms 189.5ms 0.98x 93.75 MiB 88.75 MiB 0.95x 5.44 GiB/s 5.31 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 909.3ms 1.11 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 890.2ms 1.13 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 177.0ms 5.69 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 127.2ms 7.91 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 48.0ms 55.7ms 0.86x 43.25 MiB 43.25 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 41.0ms 44.1ms 0.93x 43.00 MiB 43.25 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 41.1ms 41.6ms 0.99x 43.00 MiB 43.25 MiB 1.01x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 43.0ms 40.5ms 1.06x 43.00 MiB 43.00 MiB 1.00x 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 816.0ms 923.7ms 0.88x 734.25 MiB 728.25 MiB 0.99x 1.23 GiB/s 1.09 GiB/s
codex --offline --json 1.01 GiB 166.9ms 167.4ms 1.00x 89.25 MiB 89.75 MiB 1.01x 6.03 GiB/s 6.01 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 3353.74 KiB 3353.74 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: ace4c86bda91
Base SHA: 85aa44bed99a

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 85aa44bed99a 738.9ms 648.5ms 51.8ms 3
PR pkg.pr.new ace4c86 941.9ms 967.3ms 45.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: 85aa44bed99a; PR package: ace4c86. 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 886.9ms 856.0ms 1.04x 742.00 MiB 727.25 MiB 0.98x 1.14 GiB/s 1.18 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 183.2ms 184.0ms 1.00x 90.75 MiB 87.75 MiB 0.97x 5.50 GiB/s 5.47 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 970.8ms 1.04 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 910.0ms 1.11 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 179.1ms 5.62 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 137.3ms 7.33 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 38.4ms 5.5ms 6.92x 43.00 MiB 2.75 MiB 0.06x 0.04 MiB/s 0.28 MiB/s
claude session --offline --json 0.00 MiB 38.3ms 5.4ms 7.08x 43.00 MiB 2.50 MiB 0.06x 0.04 MiB/s 0.29 MiB/s
codex daily --offline --json 0.00 MiB 45.0ms 5.0ms 8.95x 43.00 MiB 2.50 MiB 0.06x 0.02 MiB/s 0.17 MiB/s
codex session --offline --json 0.00 MiB 37.4ms 5.3ms 7.04x 43.00 MiB 2.50 MiB 0.06x 0.02 MiB/s 0.16 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 880.9ms 784.9ms 1.12x 727.75 MiB 741.25 MiB 1.02x 1.14 GiB/s 1.28 GiB/s
codex --offline --json 1.01 GiB 164.6ms 128.7ms 1.28x 90.50 MiB 89.00 MiB 0.98x 6.12 GiB/s 7.82 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 3353.74 KiB 3353.74 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.

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