Skip to content

perf(ci): cache Rust builds with cache-nix-action (check, test, native build) - #1285

Merged
ryoppippi merged 5 commits into
mainfrom
ci/build-native-mac-style-cache
Jun 11, 2026
Merged

ryoppippi merged 5 commits into
mainfrom
ci/build-native-mac-style-cache

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

Summary

The Rust jobs (check, test, build-native-packages) recompiled the entire
crate dependency set (~3 min on the arm runner) on nearly every run. This moves
all of them to cache-nix-action (the same mechanism macOS already uses), which
makes the deps reliably warm.

Root cause

crane's cargoArtifacts (deps-only) is an unrooted intermediate. What dropped
it differed by cache mechanism:

  • Blacksmith sticky disk trims the store to GC roots on commit, but its trim
    does not honor /nix/var/nix/profiles/* — verified on a restored
    build-native disk: the pinned ccusage-deps profile symlink survived but its
    target was GC'd. check only looked warm because its store is small enough to
    skip the trim, not because the pin worked.
  • cache-nix-action garbage-collects with the standard nix store gc, which
    does honor the profile pin, so the rooted deps survive and are cached. It
    also only stores non-substitutable paths, so the cache is small (~880MB) and
    the toolchain still comes from cache.nixos.org.

Change

  • New setup-linux-nix-action-cache action: nix-quick-install + cache-nix-action
    with gc-max-store-size-linux (bounds the cache) and a per-github.job key so
    check/test/build don't thrash each other's caches.
  • check, test, and the Linux native build use it; each pins its own crane
    deps (pin-nix-deps) so the GC keeps them.
  • Drop the build-native concurrency (cache keys are immutable — no clobber).

Verified

  • build-linux-arm64: 336s cold → 78s warm, deps reused, ~877MB bounded cache,
    cache hit.

Notes

  • macOS already uses cache-nix-action; this aligns Linux with it.
  • Non-Rust jobs (npm-publish, perf-comment) keep the sticky disk — they only
    nix profile install tools and don't build the crate.

Summary by CodeRabbit

  • Chores
    • Improved Linux Nix setup and store caching with a new composite setup flow to speed and stabilize CI runs.
    • Introduced smarter cache keys, targeted purge policies, and an explicit GC size bound to control cache growth and freshness.
    • Clarified dependency pinning behavior for pull-request runs that lack access tokens.
    • Removed per-matrix serialization so native-package builds can run without prior concurrency constraints.

@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 2 files

Re-trigger cubic

@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 — experimental PR replacing the Linux native build's Blacksmith sticky disk setup with cache-nix-action (mirroring the macOS approach), to validate whether GHA's native cache can replace the Blacksmith disk within the 10GB limit.

  • New setup-linux-nix-action-cache composite action — installs Nix via nixbuild/nix-quick-install-action and manages the store with nix-community/cache-nix-action, keyed on flake+lockfile hashes, with 4GB GC limit and 2-day purge
  • Swap build-linux-native-package to use the new action — replaces uses: ./.github/actions/setup-nix with uses: ./.github/actions/setup-linux-nix-action-cache

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

@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 962530db-56ea-4ce0-af5c-1f587f90837f

📥 Commits

Reviewing files that changed from the base of the PR and between ee126f1 and ae53dd3.

📒 Files selected for processing (2)
  • .github/actions/setup-linux-nix-action-cache/action.yaml
  • .github/workflows/ci.yaml

📝 Walkthrough

Walkthrough

Adds a new composite action (.github/actions/setup-linux-nix-action-cache) that installs Nix and caches/restores the Linux Nix store (with gc-max-store-size-linux), updates the Linux build action to use it and clarifies pinning comments, and removes a per-matrix concurrency block from the CI job.

Changes

Linux Nix caching & CI updates

Layer / File(s) Summary
New composite action for Linux Nix setup with action cache
.github/actions/setup-linux-nix-action-cache/action.yaml
Installs Nix via nixbuild/nix-quick-install-action (workflow token in nix_conf) and configures nix-community/cache-nix-action to restore/save the Linux Nix store keyed by OS/arch + content hashes, enable prefix-based restores, set purge rules, and bound store GC via gc-max-store-size-linux (2000000000).
Update build action to use new Nix setup
.github/actions/build-linux-native-package/action.yaml
Replaces the earlier setup-nix step with setup-linux-nix-action-cache and updates comments above pin-nix-deps to describe dependency rooting for cache GC trimming and to note that Nix build/eval must disable access tokens on PR runs when nix-github-token == 'false'.
CI workflow: swap setup step and remove concurrency
.github/workflows/ci.yaml
Replaces ./.github/actions/setup-nix with ./.github/actions/setup-linux-nix-action-cache in the check and test jobs, and removes the concurrency block from the build-native-packages job so it no longer sets a per-matrix concurrency group or cancel-in-progress behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ccusage/ccusage#1260: Modifies build-linux-native-package Nix build invocation; related to Linux native action changes.
  • ccusage/ccusage#1279: Introduced pin-nix-deps and related rooting behavior referenced by this change.
  • ccusage/ccusage#1249: Refactors Nix setup/caching across Linux/macOS; touches similar setup action usage.

Suggested reviewers

  • pullfrog

Poem

🐰 I hopped through YAML late at night,
I taught Nix to cache and hold on tight,
Flakes and locks hashed in tidy heaps,
Purge the old, let fresh caches keep,
My tiny paws ensure builds leap.

🚥 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 summarizes the main change: exploring a macOS-style cache approach for native Linux builds, and includes a 'do not merge' marker indicating exploratory work.
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 ci/build-native-mac-style-cache

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

@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 ae53dd3 Commit Preview URL

Branch Preview URL
Jun 11 2026, 08:54 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.

Actionable comments posted: 1

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

Inline comments:
In @.github/actions/setup-linux-nix-action-cache/action.yaml:
- Around line 22-26: The workflow currently sets gc-max-store-size-linux:
4000000000 and gc-max-store-size-macos: 3500000000 with purge flags in
.github/actions/setup-linux-nix-action-cache/action.yaml (keys:
gc-max-store-size-linux, gc-max-store-size-macos, purge, purge-prefixes,
purge-created, purge-primary-key), but GC alone may not guarantee the cache fits
GitHub Actions limits; add a lightweight pre-save check step that measures/logs
the nix store size (e.g., run nix store --query --size or du on the store path)
and fail or emit a warning when the measured size exceeds the target thresholds
(4GB/3.5GB) so the action can trim or abort before save, and ensure the check
runs on both Linux and macOS paths that use the respective gc-max-store-size-*
keys.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c128ccb8-364d-4b16-a73c-ce2ba9947f15

📥 Commits

Reviewing files that changed from the base of the PR and between 23c33fc and c548fb6.

📒 Files selected for processing (2)
  • .github/actions/build-linux-native-package/action.yaml
  • .github/actions/setup-linux-nix-action-cache/action.yaml

Comment on lines +22 to +26
gc-max-store-size-linux: 4000000000
purge: true
purge-prefixes: nix-buildnative-${{ runner.os }}-${{ runner.arch }}-
purge-created: 172800
purge-primary-key: never

@coderabbitai coderabbitai Bot Jun 11, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Compare with macOS Nix setup to verify parameter consistency

# Find macOS Nix setup action
echo "Searching for macOS Nix setup configuration..."
fd -e yaml . .github/actions/ | xargs rg -l 'cache-nix-action' | grep -i mac

# Check cache-nix-action usage across all workflow files
echo ""
echo "All cache-nix-action configurations:"
rg -n -A10 'cache-nix-action' --type yaml

Repository: ccusage/ccusage

Length of output: 194


🌐 Web query:

cache-nix-action v7.0.2 documentation gc-max-store-size-linux purge parameters

💡 Result:

In cache-nix-action v7.0.2, the parameters regarding Nix store garbage collection and cache purging operate as follows [1][2]: Garbage Collection The gc-max-store-size-linux input allows you to specify the maximum size of the Nix store (in bytes) before the action attempts to save a new cache [1][3]. When provided, the action runs nix store gc --max to collect garbage until the store size is at or below the specified limit [1][4]. This parameter specifically overrides the general gc-max-store-size input and only takes effect on Linux runners [1][3]. You may use suffixes K, M, or G (representing kibibytes, mebibytes, and gibibytes, respectively) [1][4]. This process occurs just before the action saves a new cache and has no effect if a primary-key hit occurs [1][5]. Purge Parameters The purge functionality is enabled by setting purge: true [1][2]. When enabled, it purges caches scoped to the current GITHUB_REF based on the following parameters [1][3]: - purge-prefixes: A newline-separated list of non-empty cache key prefixes. The action will select for purging any caches with keys matching these prefixes [1][5][6]. - purge-created: Purges selected caches that were created more than this specified number of seconds ago, relative to the start of the Post Restore phase [7][8]. - purge-last-accessed: Purges selected caches that were last accessed more than this number of seconds ago, relative to the start of the Post Restore phase [7][6]. - purge-primary-key: Controls whether the cache with the current primary-key is purged. Setting this to always will force purging, while never will exempt the primary-key cache from being purged [1][4]. These inputs have no effect unless purge is set to true [1][7].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Linux action file (requested lines 22-26):"
ls -la .github/actions/setup-linux-nix-action-cache/action.yaml
cat -n .github/actions/setup-linux-nix-action-cache/action.yaml | sed -n '1,120p'

echo ""
echo "macOS action file (found by initial search):"
ls -la .github/actions/setup-macos-nix-cache/action.yaml
cat -n .github/actions/setup-macos-nix-cache/action.yaml | sed -n '1,160p'

echo ""
echo "Search for cache-nix-action usage and version pins in ./ .github/actions:"
rg -n "cache-nix-action" .github/actions --type yaml -S || true

echo ""
echo "Search for cache-nix-action usage in workflows:"
rg -n "cache-nix-action" .github/workflows --type yaml -S || true

echo ""
echo "Search for gc-max-store-size and purge parameters in those action files:"
rg -n "gc-max-store-size|purge(:|-) |purge-prefixes|purge-created|purge-primary-key" .github/actions --type yaml -S || true

Repository: ccusage/ccusage

Length of output: 4299


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Linux action file (requested lines 22-26):"
ls -la .github/actions/setup-linux-nix-action-cache/action.yaml
cat -n .github/actions/setup-linux-nix-action-cache/action.yaml | sed -n '1,120p'

echo ""
echo "macOS action file (found by initial search):"
ls -la .github/actions/setup-macos-nix-cache/action.yaml
cat -n .github/actions/setup-macos-nix-cache/action.yaml | sed -n '1,160p'

echo ""
echo "Search for cache-nix-action usage and version pins in ./ .github/actions:"
rg -n "cache-nix-action" .github/actions --type yaml -S || true

echo ""
echo "Search for cache-nix-action usage in workflows:"
rg -n "cache-nix-action" .github/workflows --type yaml -S || true

echo ""
echo "Search for gc-max-store-size and purge parameters in those action files:"
rg -n "gc-max-store-size|purge-prefixes|purge-created|purge-primary-key|purge:" .github/actions --type yaml -S || true

Repository: ccusage/ccusage

Length of output: 4299


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Linux action file:"
cat -n .github/actions/setup-linux-nix-action-cache/action.yaml | sed -n '1,200p'

echo ""
echo "macOS action file:"
cat -n .github/actions/setup-macos-nix-cache/action.yaml | sed -n '1,220p'

echo ""
echo "cache-nix-action usage in .github/actions:"
rg -n "cache-nix-action" .github/actions --type yaml -S || true

echo ""
echo "cache-nix-action usage in .github/workflows:"
rg -n "cache-nix-action" .github/workflows --type yaml -S || true

echo ""
echo "gc/purge parameters in .github/actions:"
rg -n "gc-max-store-size|purge-prefixes|purge-created|purge-primary-key|purge:" .github/actions --type yaml -S || true

Repository: ccusage/ccusage

Length of output: 3978


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Linux action file:"
cat -n .github/actions/setup-linux-nix-action-cache/action.yaml | sed -n '1,200p'

echo ""
echo "macOS action file:"
cat -n .github/actions/setup-macos-nix-cache/action.yaml | sed -n '1,220p'

echo ""
echo "cache-nix-action usage in .github/actions:"
rg -n "cache-nix-action" .github/actions --type yaml -S || true

echo ""
echo "cache-nix-action usage in .github/workflows:"
rg -n "cache-nix-action" .github/workflows --type yaml -S || true

echo ""
echo "gc/purge parameters in .github/actions:"
rg -n "gc-max-store-size|purge-prefixes|purge-created|purge-primary-key|purge:" .github/actions --type yaml -S || true

Repository: ccusage/ccusage

Length of output: 3978


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Linux action file:"
cat -n .github/actions/setup-linux-nix-action-cache/action.yaml | sed -n '1,200p'

echo ""
echo "macOS action file:"
cat -n .github/actions/setup-macos-nix-cache/action.yaml | sed -n '1,220p'

echo ""
echo "cache-nix-action usage in .github/actions:"
rg -n "cache-nix-action" .github/actions --type yaml -S || true

echo ""
echo "cache-nix-action usage in .github/workflows:"
rg -n "cache-nix-action" .github/workflows --type yaml -S || true

echo ""
echo "gc/purge parameters in .github/actions:"
rg -n "gc-max-store-size|purge-prefixes|purge-created|purge-primary-key|purge:" .github/actions --type yaml -S || true

Repository: ccusage/ccusage

Length of output: 3978


Confirm cache-nix-action v7.0.2 GC/purge params match the deps-pin trimming goal

  • .github/actions/setup-linux-nix-action-cache/action.yaml pins nix-community/cache-nix-action@... # v7.0.2; on Linux it sets gc-max-store-size-linux: 4000000000, which runs nix store gc --max before cache save (only on Linux, and not when the primary-key restores).
  • Purge is consistent with the intent: purge: true, purge-prefixes: nix-buildnative-${{ runner.os }}-${{ runner.arch }}-, purge-created: 172800, purge-primary-key: never.
  • macOS mirrors the same purge behavior (purge: true, purge-created: 172800, purge-primary-key: never) but uses gc-max-store-size-macos: 3500000000 and purge-prefixes: nix-${{ runner.os }}-${{ runner.arch }}- (key prefix differs).
  • The “keep rooted cargoArtifacts / trim toolchain” outcome still depends on the deps/profile pin actually making the desired paths reachable; GC alone won’t guarantee 4GB is sufficient—consider adding a lightweight check (e.g., log/store size) to ensure the cache stays under the GitHub Actions limit.
🤖 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/actions/setup-linux-nix-action-cache/action.yaml around lines 22 -
26, The workflow currently sets gc-max-store-size-linux: 4000000000 and
gc-max-store-size-macos: 3500000000 with purge flags in
.github/actions/setup-linux-nix-action-cache/action.yaml (keys:
gc-max-store-size-linux, gc-max-store-size-macos, purge, purge-prefixes,
purge-created, purge-primary-key), but GC alone may not guarantee the cache fits
GitHub Actions limits; add a lightweight pre-save check step that measures/logs
the nix store size (e.g., run nix store --query --size or du on the store path)
and fail or emit a warning when the measured size exceeds the target thresholds
(4GB/3.5GB) so the action can trim or abort before save, and ensure the check
runs on both Linux and macOS paths that use the respective gc-max-store-size-*
keys.

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.

This PR is an exploratory "do not merge" run whose explicit purpose is to validate whether the 4GB gc-max-store-size-linux keeps the cache under the 10GB GHA limit. The cache-nix-action already runs nix store gc --max before save, and the CI run output reports cache size, so an extra pre-save size-check step is out of scope for this minimal experiment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: c548fb681d21
Base SHA: 23c33fcca979

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 23c33fcca979 1.183s 809.9ms 55.4ms 3
PR pkg.pr.new c548fb6 971.7ms 1.270s 55.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: 23c33fcca979; PR package: c548fb6. 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 821.0ms 851.8ms 0.96x 733.00 MiB 736.00 MiB 1.00x 1.23 GiB/s 1.18 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 177.2ms 171.6ms 1.03x 91.25 MiB 90.25 MiB 0.99x 5.68 GiB/s 5.87 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 818.4ms 1.23 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 708.0ms 1.42 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 156.2ms 6.45 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 120.6ms 8.35 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 48.6ms 4.5ms 10.85x 44.00 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.34 MiB/s
claude session --offline --json 0.00 MiB 38.6ms 4.4ms 8.74x 44.25 MiB 2.75 MiB 0.06x 0.04 MiB/s 0.35 MiB/s
codex daily --offline --json 0.00 MiB 37.1ms 4.1ms 8.99x 44.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.21 MiB/s
codex session --offline --json 0.00 MiB 37.7ms 4.3ms 8.85x 44.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.20 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 750.3ms 786.8ms 0.95x 754.00 MiB 742.00 MiB 0.98x 1.34 GiB/s 1.28 GiB/s
codex --offline --json 1.01 GiB 156.8ms 125.0ms 1.25x 92.50 MiB 91.25 MiB 0.99x 6.42 GiB/s 8.05 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: c548fb681d21
Base SHA: 23c33fcca979

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 23c33fcca979 996.1ms 1.085s 55.0ms 3
PR pkg.pr.new c548fb6 1.070s 939.4ms 53.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: 23c33fcca979; PR package: c548fb6. 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 831.9ms 818.0ms 1.02x 732.50 MiB 735.00 MiB 1.00x 1.21 GiB/s 1.23 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 173.7ms 174.2ms 1.00x 92.00 MiB 91.25 MiB 0.99x 5.80 GiB/s 5.78 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 804.3ms 1.25 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 723.1ms 1.39 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 153.6ms 6.56 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 116.8ms 8.62 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 52.3ms 38.6ms 1.36x 44.00 MiB 44.25 MiB 1.01x 0.03 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 36.4ms 37.1ms 0.98x 44.00 MiB 44.25 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 37.8ms 36.9ms 1.02x 44.00 MiB 44.00 MiB 1.00x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 36.9ms 37.4ms 0.99x 44.25 MiB 44.25 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 797.5ms 796.0ms 1.00x 734.25 MiB 746.00 MiB 1.02x 1.26 GiB/s 1.26 GiB/s
codex --offline --json 1.01 GiB 153.9ms 154.5ms 1.00x 88.75 MiB 89.25 MiB 1.01x 6.54 GiB/s 6.52 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.

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

ccusage

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

@ccusage/ccusage-darwin-arm64

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

@ccusage/ccusage-linux-arm64

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

@ccusage/ccusage-linux-x64

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

@ccusage/ccusage-win32-x64

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

commit: ee126f1

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 7673e0391f34
Base SHA: 23c33fcca979

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 23c33fcca979 1.046s 921.6ms 66.0ms 3
PR pkg.pr.new 7673e03 1.014s 1.179s 65.3ms 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: 23c33fcca979; PR package: 7673e03. 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 959.0ms 911.6ms 1.05x 726.50 MiB 727.75 MiB 1.00x 1.05 GiB/s 1.10 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 202.0ms 200.7ms 1.01x 90.50 MiB 92.75 MiB 1.02x 4.98 GiB/s 5.02 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 999.2ms 1.01 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 944.9ms 1.07 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 168.0ms 5.99 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 130.7ms 7.70 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 48.1ms 5.8ms 8.24x 43.25 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.26 MiB/s
claude session --offline --json 0.00 MiB 44.6ms 5.4ms 8.26x 43.25 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.29 MiB/s
codex daily --offline --json 0.00 MiB 45.0ms 5.2ms 8.59x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.16 MiB/s
codex session --offline --json 0.00 MiB 46.5ms 5.9ms 7.86x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.14 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 820.2ms 925.0ms 0.89x 733.25 MiB 742.50 MiB 1.01x 1.23 GiB/s 1.09 GiB/s
codex --offline --json 1.01 GiB 186.7ms 136.2ms 1.37x 90.25 MiB 91.00 MiB 1.01x 5.39 GiB/s 7.39 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.

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/actions/setup-linux-nix-action-cache/action.yaml (1)

24-24: ⚖️ Poor tradeoff

Consider whether 2GB gc-max-store-size-linux is sufficient for the deps pin.

The gc-max-store-size-linux is set to 2GB, which is lower than macOS's 3.5GB limit and significantly lower than the 4GB discussed in past reviews. While the description claims the cache stays small (~900MB), this leaves limited headroom for:

  • Multiple generations of pinned deps across runs
  • Stale build outputs before the GC purge runs
  • Store overhead and metadata

Since this is an exploratory PR validating cache size, monitor the actual cache size in CI logs to confirm 2GB provides sufficient margin.

🤖 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/actions/setup-linux-nix-action-cache/action.yaml at line 24, Review
and adjust the gc-max-store-size-linux value in action.yaml: consider raising
gc-max-store-size-linux from 2000000000 to a larger limit (e.g., ~4000000000 or
at least match macOS 3500000000) to provide headroom for pinned deps, stale
outputs and metadata, and add a short comment next to the
gc-max-store-size-linux key explaining the chosen value and that CI will monitor
actual cache sizes (log and alert if close to the limit) so we can iterate if
needed.
🤖 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.

Inline comments:
In @.github/actions/setup-linux-nix-action-cache/action.yaml:
- Line 22: The primary-key in
.github/actions/setup-linux-nix-action-cache/action.yaml omits package.json
(which package.nix reads), causing cache misses; update the primary-key's
hashFiles(...) list used for the primary-key to include "package.json" and also
add any other files your Nix expressions depend on (e.g., "default.nix" and
"rust/**/Cargo.toml") so changes to those inputs affect the cache key; locate
the primary-key entry and append those filenames/globs to the hashFiles(...)
argument.

---

Nitpick comments:
In @.github/actions/setup-linux-nix-action-cache/action.yaml:
- Line 24: Review and adjust the gc-max-store-size-linux value in action.yaml:
consider raising gc-max-store-size-linux from 2000000000 to a larger limit
(e.g., ~4000000000 or at least match macOS 3500000000) to provide headroom for
pinned deps, stale outputs and metadata, and add a short comment next to the
gc-max-store-size-linux key explaining the chosen value and that CI will monitor
actual cache sizes (log and alert if close to the limit) so we can iterate if
needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a27d17f4-18fb-472a-bf73-9c94093b6506

📥 Commits

Reviewing files that changed from the base of the PR and between 7673e03 and cf76046.

📒 Files selected for processing (3)
  • .github/actions/build-linux-native-package/action.yaml
  • .github/actions/setup-linux-nix-action-cache/action.yaml
  • .github/workflows/ci.yaml
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yaml

Comment thread .github/actions/setup-linux-nix-action-cache/action.yaml Outdated
mirror the macos primary-key hash list so the linux key invalidates on the
same nix inputs. `package.nix` reads `version` from `package.json`, and the
nix build references `default.nix` plus the rust workspace `Cargo.toml`
files, which were previously omitted from the linux key.

Co-authored-by: Codesmith <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 7673e0391f34
Base SHA: 23c33fcca979

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 23c33fcca979 1.739s 822.8ms 76.5ms 3
PR pkg.pr.new 7673e03 760.1ms 1.107s 66.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: 23c33fcca979; PR package: 7673e03. 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.6ms 963.9ms 0.92x 734.50 MiB 731.50 MiB 1.00x 1.13 GiB/s 1.04 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 217.4ms 207.4ms 1.05x 86.75 MiB 91.50 MiB 1.05x 4.63 GiB/s 4.85 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.120s 920.59 MiB/s 1
claude --offline --json Installed native binary 1.01 GiB 900.6ms 1.12 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 195.9ms 5.14 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 143.3ms 7.02 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 46.5ms 52.0ms 0.89x 43.00 MiB 42.75 MiB 0.99x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 51.5ms 48.5ms 1.06x 43.00 MiB 43.00 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex daily --offline --json 0.00 MiB 49.1ms 52.7ms 0.93x 43.00 MiB 43.25 MiB 1.01x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 42.8ms 44.4ms 0.97x 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 944.9ms 977.0ms 0.97x 746.25 MiB 735.75 MiB 0.99x 1.07 GiB/s 1.03 GiB/s
codex --offline --json 1.01 GiB 200.2ms 200.0ms 1.00x 90.00 MiB 90.50 MiB 1.01x 5.03 GiB/s 5.03 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.

@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 — incremental delta from the prior Pullfrog review at c548fb6: refined the cache description and tightened the gc-max bound to 2GB; dropped the Blacksmith concurrency serialization that is no longer needed.

  • Tightened gc-max to 2GB and refined cache description — lowered gc-max-store-size-linux from 4GB to 2GB in .github/actions/setup-linux-nix-action-cache/action.yaml, and updated the description to more precisely note that cache-nix-action only caches non-substitutable paths (~900MB)
  • Removed build-native-packages concurrency group — .github/workflows/ci.yaml: the sticky-disk concurrency serialization is no longer needed with cache-nix-action
  • Updated deps pin comment — .github/actions/build-linux-native-package/action.yaml: the pin-nix-deps comment now explains the rooting-for-GC rationale instead of the token-hardening rationale

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

@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 — new commit ee126f1 that aligns the Linux Nix cache primary key hash inputs with the macOS setup.

  • Aligned Linux cache key inputs with macOS — added default.nix, package.json, and rust/**/Cargo.toml to the hashFiles(...) call in setup-linux-nix-action-cache/action.yaml, matching the existing macOS key at setup-macos-nix-cache/action.yaml. Without rust/**/Cargo.toml, changes to individual crate manifests wouldn't bust the cache. Correctness fix.

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: cf76046028bc
Base SHA: 23c33fcca979

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 23c33fcca979 1.510s 1.314s 70.5ms 3
PR pkg.pr.new cf76046 1.831s 1.637s 65.2ms 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: 23c33fcca979; PR package: cf76046. 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 929.5ms 996.0ms 0.93x 725.25 MiB 740.00 MiB 1.02x 1.08 GiB/s 1.01 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 212.3ms 207.4ms 1.02x 87.25 MiB 90.75 MiB 1.04x 4.74 GiB/s 4.85 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.005s 1.00 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 982.1ms 1.03 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 177.7ms 5.66 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 135.8ms 7.41 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 57.6ms 6.4ms 9.04x 43.00 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.24 MiB/s
claude session --offline --json 0.00 MiB 46.1ms 6.7ms 6.87x 43.00 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.23 MiB/s
codex daily --offline --json 0.00 MiB 42.2ms 6.0ms 7.07x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.14 MiB/s
codex session --offline --json 0.00 MiB 48.0ms 5.7ms 8.50x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.15 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 907.5ms 875.4ms 1.04x 727.00 MiB 732.50 MiB 1.01x 1.11 GiB/s 1.15 GiB/s
codex --offline --json 1.01 GiB 170.0ms 134.4ms 1.26x 90.50 MiB 91.75 MiB 1.01x 5.92 GiB/s 7.49 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: cf76046028bc
Base SHA: 23c33fcca979

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 23c33fcca979 1.353s 1.431s 70.6ms 3
PR pkg.pr.new cf76046 1.391s 1.646s 71.8ms 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: 23c33fcca979; PR package: cf76046. 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 904.1ms 978.1ms 0.92x 731.50 MiB 732.75 MiB 1.00x 1.11 GiB/s 1.03 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 217.4ms 218.0ms 1.00x 90.00 MiB 94.25 MiB 1.05x 4.63 GiB/s 4.62 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 939.0ms 1.07 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 874.5ms 1.15 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 191.3ms 5.26 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 141.8ms 7.10 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 54.8ms 49.2ms 1.11x 43.00 MiB 43.00 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 49.2ms 52.0ms 0.95x 43.25 MiB 43.00 MiB 0.99x 0.03 MiB/s 0.03 MiB/s
codex daily --offline --json 0.00 MiB 50.2ms 48.8ms 1.03x 43.00 MiB 43.00 MiB 1.00x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 49.3ms 48.5ms 1.01x 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 873.3ms 901.9ms 0.97x 726.50 MiB 726.50 MiB 1.00x 1.15 GiB/s 1.12 GiB/s
codex --offline --json 1.01 GiB 176.5ms 174.5ms 1.01x 92.50 MiB - - 5.70 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.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: ee126f180efd
Base SHA: 23c33fcca979

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 23c33fcca979 883.6ms 813.9ms 60.2ms 3
PR pkg.pr.new ee126f1 1.148s 1.027s 59.4ms 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: 23c33fcca979; PR package: ee126f1. 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 877.0ms 853.4ms 1.03x 740.50 MiB 730.00 MiB 0.99x 1.15 GiB/s 1.18 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 180.2ms 181.4ms 0.99x 92.50 MiB 92.75 MiB 1.00x 5.59 GiB/s 5.55 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 867.2ms 1.16 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 863.9ms 1.17 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 176.8ms 5.69 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 120.0ms 8.39 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 48.5ms 4.5ms 10.68x 43.00 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.34 MiB/s
claude session --offline --json 0.00 MiB 40.6ms 4.5ms 8.99x 43.00 MiB 2.75 MiB 0.06x 0.04 MiB/s 0.34 MiB/s
codex daily --offline --json 0.00 MiB 39.4ms 4.1ms 9.56x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.21 MiB/s
codex session --offline --json 0.00 MiB 38.8ms 4.2ms 9.18x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.20 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 845.5ms 831.8ms 1.02x 700.25 MiB 747.25 MiB 1.07x 1.19 GiB/s 1.21 GiB/s
codex --offline --json 1.01 GiB 155.9ms 120.9ms 1.29x 90.75 MiB 89.25 MiB 0.98x 6.46 GiB/s 8.32 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: ee126f180efd
Base SHA: 23c33fcca979

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 23c33fcca979 1.054s 1.130s 70.0ms 3
PR pkg.pr.new ee126f1 934.7ms 1.002s 73.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: 23c33fcca979; PR package: ee126f1. 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 867.6ms 927.1ms 0.94x 742.00 MiB 739.50 MiB 1.00x 1.16 GiB/s 1.09 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 208.8ms 205.7ms 1.01x 87.75 MiB 90.50 MiB 1.03x 4.82 GiB/s 4.89 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 921.0ms 1.09 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 856.2ms 1.18 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 180.7ms 5.57 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 142.6ms 7.06 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 51.0ms 48.6ms 1.05x 43.00 MiB 43.00 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 39.8ms 41.1ms 0.97x 43.00 MiB 43.00 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 44.3ms 41.9ms 1.06x 43.25 MiB 43.00 MiB 0.99x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 41.2ms 42.1ms 0.98x 43.25 MiB 43.00 MiB 0.99x 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 987.0ms 858.5ms 1.15x 738.00 MiB 745.00 MiB 1.01x 1.02 GiB/s 1.17 GiB/s
codex --offline --json 1.01 GiB 177.2ms 174.6ms 1.02x 94.25 MiB 93.50 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 changed the title ci: explore macOS-style cache for native build (do not merge) perf(ci): cache Rust builds with cache-nix-action (check, test, native build) Jun 11, 2026
@ryoppippi
ryoppippi merged commit 488e41a into main Jun 11, 2026
13 of 15 checks passed
@ryoppippi
ryoppippi deleted the ci/build-native-mac-style-cache branch June 11, 2026 20:54
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: ae53dd3c421d
Base SHA: 23c33fcca979

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 23c33fcca979 832.9ms 811.6ms 71.2ms 3
PR pkg.pr.new ae53dd3 1.141s 761.2ms 74.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: 23c33fcca979; PR package: ae53dd3. 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 873.9ms 895.6ms 0.98x 735.75 MiB 731.50 MiB 0.99x 1.15 GiB/s 1.12 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 212.3ms 202.5ms 1.05x 87.75 MiB 89.50 MiB 1.02x 4.74 GiB/s 4.97 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 931.6ms 1.08 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 983.7ms 1.02 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 179.2ms 5.62 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 133.9ms 7.52 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 49.4ms 6.4ms 7.71x 43.00 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.24 MiB/s
claude session --offline --json 0.00 MiB 47.9ms 6.2ms 7.67x 43.00 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.25 MiB/s
codex daily --offline --json 0.00 MiB 44.3ms 6.2ms 7.14x 43.25 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.14 MiB/s
codex session --offline --json 0.00 MiB 45.8ms 5.5ms 8.34x 43.00 MiB 2.75 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 839.7ms 850.6ms 0.99x 732.25 MiB 723.50 MiB 0.99x 1.20 GiB/s 1.18 GiB/s
codex --offline --json 1.01 GiB 182.0ms 137.8ms 1.32x 90.00 MiB 94.50 MiB 1.05x 5.53 GiB/s 7.31 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: ae53dd3c421d
Base SHA: 23c33fcca979

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 23c33fcca979 834.3ms 602.3ms 71.7ms 3
PR pkg.pr.new ae53dd3 1.244s 1.034s 73.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: 23c33fcca979; PR package: ae53dd3. 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 891.7ms 1.029s 0.87x 728.50 MiB 734.75 MiB 1.01x 1.13 GiB/s 1001.80 MiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 220.4ms 214.6ms 1.03x 91.50 MiB 93.25 MiB 1.02x 4.57 GiB/s 4.69 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 960.9ms 1.05 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 891.6ms 1.13 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 188.8ms 5.33 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 140.1ms 7.19 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 51.3ms 46.7ms 1.10x 43.00 MiB 43.25 MiB 1.01x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 50.4ms 50.3ms 1.00x 43.25 MiB 43.00 MiB 0.99x 0.03 MiB/s 0.03 MiB/s
codex daily --offline --json 0.00 MiB 45.5ms 50.9ms 0.89x 43.00 MiB 43.00 MiB 1.00x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 48.2ms 48.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 1.016s 1.066s 0.95x 746.25 MiB 729.50 MiB 0.98x 1014.74 MiB/s 967.41 MiB/s
codex --offline --json 1.01 GiB 184.8ms 182.1ms 1.01x 88.00 MiB 91.25 MiB 1.04x 5.45 GiB/s 5.53 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.

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