Skip to content

feat(ci): cross-build the Intel macOS binary on the arm64 runner - #1289

Merged
ryoppippi merged 2 commits into
mainfrom
feat/intel-mac-cross-build
Jun 11, 2026
Merged

ryoppippi merged 2 commits into
mainfrom
feat/intel-mac-cross-build

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Build the x86_64 (Intel) macOS binary by cross-compiling on the existing
aarch64 macOS runner
, removing the need for a dedicated Intel macOS runner.

Why it's clean (no pkgsCross stdenv)

macOS↔macOS cross doesn't need a full pkgsCross toolchain: the native arm64
toolchain targets x86_64-apple-darwin, Apple clang is multi-arch (the cc
crate auto-passes -arch x86_64 for bundled sqlite), and the Apple SDK ships
multi-arch tbd stubs. Verified locally:

  • file → Mach-O 64-bit x86_64 executable
  • otool -L → only /usr/lib/libSystem.B.dylib (portable to Intel Macs)
  • builds in ~50s, no cross stdenv bootstrap

(I prototyped the pkgsCross.x86_64-darwin approach too — it spends minutes
bootstrapping a cross clang/libcxx, so this lighter target-only approach wins.)

Change

  • nix/darwin-x64-package.nix: ccusage-darwin-x64 (native toolchain + the
    x86_64 target + Apple SDK; drops the aarch64-only nixpkgs libiconv).
  • build-macos-nix-native-package: pick the flake attr by arch
    (arm64 → ccusage, x64 → ccusage-darwin-x64).
  • ci.yaml: add build-mac-x64 to the native matrix (same arm64 runner),
    publish it via pkg-pr-new, and add a macos-15-intel preview E2E so the
    cross-built binary is exercised on real Intel hardware.
  • release.yaml: build mac-x64 via the arm64 cross instead of the Intel
    cargo path; drop the now-unused build-macos-cargo-native-package.

Caveats

  • ABI is unchanged (both arm64 and x64 are native Apple targets — no MSVC/MinGW
    question like Windows).
  • nixpkgs deprecates x86_64-darwin after 26.05; this path will need a revisit
    when that lands.

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


Summary by cubic

Cross-compile the Intel (x86_64) macOS ccusage binary on the existing arm64 runner. This removes the dedicated Intel runner and unifies macOS builds under Nix.

  • New Features

    • Added ccusage-darwin-x64 Nix package that builds the x86_64-apple-darwin target with the native toolchain and Apple SDK; enforces a system-dylib-only check; exposed in flake.nix.
    • Added an Intel macOS preview E2E (macos-15-intel) to run the cross-built binary.
  • Refactors

    • CI/release now use build-macos-nix-native-package for both arches; selects ccusage (arm64) or ccusage-darwin-x64 (x64) by arch and validates the input; removed the Cargo-based action.
    • Added build-mac-x64 job on blacksmith-12vcpu-macos-26 and publish packages/ccusage-darwin-x64.

Written for commit dc599fb. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added official Intel macOS (x86_64) build artifact and enabled Intel macOS end-to-end testing.
  • Chores

    • Unified and updated macOS build pipeline to produce both ARM64 and x86_64 packages.
    • CI and release workflows updated to include Intel macOS runners and adjusted build targets.
    • Removed an older macOS packaging action no longer used.

Build the x86_64 (Intel) macOS binary by cross-compiling on the existing
aarch64 macOS runner instead of a dedicated Intel runner. macOS↔macOS cross
works without a pkgsCross stdenv: the native arm64 toolchain targets
x86_64-apple-darwin, Apple clang is multi-arch (the cc crate auto-passes
-arch x86_64 for bundled sqlite), and the Apple SDK ships multi-arch stubs.
The result links only /usr/lib/libSystem.B.dylib, so it is portable to Intel
Macs (gated by the otool dylib check), and builds in ~50s with no cross stdenv.

- nix/darwin-x64-package.nix: `ccusage-darwin-x64` (native toolchain + x86_64
  target + Apple SDK, no pkgsCross).
- build-macos-nix-native-package: pick the flake attr by arch (arm64 -> ccusage,
  x64 -> ccusage-darwin-x64).
- ci.yaml: add build-mac-x64 to the native matrix (same arm64 runner), publish
  it via pkg-pr-new, and add a macos-15-intel preview E2E to exercise the
  cross-built binary on real Intel hardware.
- release.yaml: build mac-x64 via the arm64 runner cross instead of the Intel
  cargo path; drop the now-unused build-macos-cargo-native-package action.

Note: nixpkgs deprecates x86_64-darwin after 26.05, so this path will need a
revisit when that lands.
@coderabbitai

coderabbitai Bot commented Jun 11, 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: 906ac704-ba24-4919-a5f8-59e4ed9617c0

📥 Commits

Reviewing files that changed from the base of the PR and between 4a717d2 and dc599fb.

📒 Files selected for processing (1)
  • .github/actions/build-macos-nix-native-package/action.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/actions/build-macos-nix-native-package/action.yaml

📝 Walkthrough

Walkthrough

This PR adds macOS x64 (Intel) cross-compilation support for ccusage by defining a new Nix derivation for x86_64-apple-darwin, updating the build action to conditionally select it based on architecture, and integrating x64 builds into CI and release workflows with E2E testing on Intel macOS runners.

Changes

macOS x64 Cross-Compilation Implementation

Layer / File(s) Summary
Nix x64 Package Definition and Flake Integration
nix/darwin-x64-package.nix, flake.nix
New ccusage-darwin-x64 Nix derivation cross-compiles for x86_64-apple-darwin using Rust target override, Apple SDK 15, and crane-based builds. Includes postInstall validation that rejects dylib linkages outside system paths. Module imported into flake configuration.
Build Action Architecture Selection
.github/actions/build-macos-nix-native-package/action.yaml
Build action now injects ARCH from inputs and branches: builds .#ccusage-darwin-x64 for x64, otherwise .#ccusage for arm64; errors on unsupported architectures.
CI Workflow x64 Build and E2E Test Matrix
.github/workflows/ci.yaml
Add build-mac-x64 matrix entry to build-native-packages job for darwin/x64 platform. ccusage-preview-e2e matrix adds macos-15-intel runner. A publish step command was re-emitted with no observable change.
Release Workflow x64 Runner and Path Updates
.github/workflows/release.yaml
Update x64 build entry to new runner (blacksmith-12vcpu-macos-26) and expect binary at result/bin/ccusage. Broaden Darwin step condition to run Nix native package action for all darwin builds.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • ccusage/ccusage#1256: Adds otool -L dylib validation for macOS portability, similar validation pattern used in the new Nix package derivation.
  • ccusage/ccusage#1260: Modifies the macOS Nix build action; related to the composite action wiring changed here.
  • ccusage/ccusage#1249: Related Blacksmith runner and workflow changes touching macOS packaging and release flows.

Suggested reviewers

  • pullfrog

Poem

🐇 I dug a flake and found a seed of x64,
Cross-built on arm runners, a clever little mix,
Intel bits snug in Apple SDK's nest,
Dylibs checked and tidy, the binary rests,
Hopping off to CI with a joyful twitch.

🚥 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 clearly and specifically describes the main change: implementing cross-compilation of the Intel macOS binary on the arm64 runner, which is the primary objective of this PR.
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 feat/intel-mac-cross-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 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 dc599fb Commit Preview URL

Branch Preview URL
Jun 11 2026, 09:54 PM

@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 — Cross-compiles the Intel macOS x86_64 ccusage binary on the existing arm64 macOS runner, removing the need for a dedicated Intel macOS runner while keeping E2E validation on real Intel hardware.

  • New nix/darwin-x64-package.nix — crane-based cross package using the native toolchain with x86_64-apple-darwin target override, apple-sdk_15 buildInput (no nixpkgs libiconv), and a postInstall dylib-portability check.
  • Unified build-macos-nix-native-package/action.yaml — selects .#ccusage-darwin-x64 or .#ccusage by arch; both arches now share one action.
  • Removed build-macos-cargo-native-package/action.yaml — superseded by the Nix-based action.
  • CI matrix update — build-mac-x64 on the arm64 runner; publishes packages/ccusage-darwin-x64; adds macos-15-intel E2E smoketest.
  • Release workflow — mac-x64 builds on the arm64 runner via the unified action; condition simplified to matrix.platform == 'darwin'.

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

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

@ccusage/ccusage-darwin-arm64

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

@ccusage/ccusage-darwin-x64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-x64@1289

@ccusage/ccusage-linux-arm64

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

@ccusage/ccusage-linux-x64

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

@ccusage/ccusage-win32-x64

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

commit: 4a717d2

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

2 issues found across 6 files

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="nix/darwin-x64-package.nix">

<violation number="1" location="nix/darwin-x64-package.nix:43">
P2: `buildInputs` is fully overwritten in the cross args, which makes the x64 package drift-prone and can drop future Darwin dependencies from the base package.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread .github/actions/build-macos-nix-native-package/action.yaml Outdated
);
crossCommonArgs = config.packages.ccusage.passthru.commonArgs // {
cargoExtraArgs = "-p ccusage --bin ccusage --target ${target}";
buildInputs = [ pkgs.apple-sdk_15 ];

@cubic-dev-ai cubic-dev-ai Bot Jun 11, 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: buildInputs is fully overwritten in the cross args, which makes the x64 package drift-prone and can drop future Darwin dependencies from the base package.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At nix/darwin-x64-package.nix, line 43:

<comment>`buildInputs` is fully overwritten in the cross args, which makes the x64 package drift-prone and can drop future Darwin dependencies from the base package.</comment>

<file context>
@@ -0,0 +1,69 @@
+          );
+          crossCommonArgs = config.packages.ccusage.passthru.commonArgs // {
+            cargoExtraArgs = "-p ccusage --bin ccusage --target ${target}";
+            buildInputs = [ pkgs.apple-sdk_15 ];
+          };
+          crossDepsOnlyArgs = config.packages.ccusage.passthru.depsOnlyArgs // {
</file context>
Fix with cubic

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 4a717d265e65
Base SHA: 488e41af5a4c

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 488e41af5a4c 921.1ms 705.0ms 62.8ms 3
PR pkg.pr.new 4a717d2 742.2ms 1.099s 64.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: 488e41af5a4c; PR package: 4a717d2. 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 900.6ms 1.003s 0.90x 730.00 MiB 727.50 MiB 1.00x 1.12 GiB/s 1.00 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 215.3ms 221.0ms 0.97x 87.75 MiB 85.25 MiB 0.97x 4.68 GiB/s 4.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 964.4ms 1.04 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 898.1ms 1.12 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 177.6ms 5.67 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 136.7ms 7.36 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.9ms 6.2ms 8.04x 43.00 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.25 MiB/s
claude session --offline --json 0.00 MiB 41.0ms 6.3ms 6.51x 43.00 MiB 2.75 MiB 0.06x 0.04 MiB/s 0.25 MiB/s
codex daily --offline --json 0.00 MiB 43.0ms 6.1ms 7.04x 43.25 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.14 MiB/s
codex session --offline --json 0.00 MiB 40.5ms 5.9ms 6.84x 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 869.8ms 847.1ms 1.03x 734.25 MiB 731.25 MiB 1.00x 1.16 GiB/s 1.19 GiB/s
codex --offline --json 1.01 GiB 179.2ms 134.5ms 1.33x 87.00 MiB 92.25 MiB 1.06x 5.62 GiB/s 7.49 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.33 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: 4a717d265e65
Base SHA: 488e41af5a4c

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 488e41af5a4c 1.092s 682.3ms 55.1ms 3
PR pkg.pr.new 4a717d2 1.207s 1.028s 56.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: 488e41af5a4c; PR package: 4a717d2. 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 846.7ms 802.2ms 1.06x 733.75 MiB 727.25 MiB 0.99x 1.19 GiB/s 1.25 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 177.0ms 174.3ms 1.02x 90.75 MiB 89.00 MiB 0.98x 5.69 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 780.5ms 1.29 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 721.4ms 1.40 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 160.0ms 6.29 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 121.2ms 8.30 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.0ms 39.8ms 1.30x 43.00 MiB 43.00 MiB 1.00x 0.03 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 38.7ms 38.0ms 1.02x 43.25 MiB 43.00 MiB 0.99x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 37.6ms 37.5ms 1.00x 43.25 MiB 43.00 MiB 0.99x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 37.2ms 37.3ms 1.00x 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 862.5ms 787.7ms 1.09x 733.25 MiB 742.25 MiB 1.01x 1.17 GiB/s 1.28 GiB/s
codex --offline --json 1.01 GiB 158.4ms 157.2ms 1.01x 89.50 MiB 91.25 MiB 1.02x 6.35 GiB/s 6.41 GiB/s

Artifact size

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

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

@ryoppippi
ryoppippi merged commit b7b8458 into main Jun 11, 2026
15 of 17 checks passed
@ryoppippi
ryoppippi deleted the feat/intel-mac-cross-build branch June 11, 2026 21:54
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: dc599fbc669c
Base SHA: 488e41af5a4c

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 488e41af5a4c 799.0ms 836.4ms 57.4ms 3
PR pkg.pr.new dc599fb 1.032s 1.008s 64.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: 488e41af5a4c; PR package: dc599fb. 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 910.9ms 956.6ms 0.95x 738.75 MiB 741.75 MiB 1.00x 1.11 GiB/s 1.05 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 199.1ms 193.2ms 1.03x 89.00 MiB 90.75 MiB 1.02x 5.06 GiB/s 5.21 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 866.6ms 1.16 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 867.0ms 1.16 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 175.5ms 5.74 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 131.5ms 7.65 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 39.8ms 43.3ms 0.92x 43.00 MiB 43.00 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 39.3ms 37.9ms 1.04x 43.00 MiB 43.00 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 37.9ms 37.4ms 1.01x 43.00 MiB 43.25 MiB 1.01x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 36.7ms 40.3ms 0.91x 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 817.4ms 888.6ms 0.92x 728.00 MiB 726.50 MiB 1.00x 1.23 GiB/s 1.13 GiB/s
codex --offline --json 1.01 GiB 168.0ms 164.4ms 1.02x 90.75 MiB 88.00 MiB 0.97x 5.99 GiB/s 6.12 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.33 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: dc599fbc669c
Base SHA: 488e41af5a4c

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 488e41af5a4c 954.8ms 1.159s 66.1ms 3
PR pkg.pr.new dc599fb 1.382s 1.452s 64.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: 488e41af5a4c; PR package: dc599fb. 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 855.6ms 1.042s 0.82x 724.00 MiB 693.75 MiB 0.96x 1.18 GiB/s 989.04 MiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 201.4ms 199.3ms 1.01x 90.75 MiB 91.50 MiB 1.01x 5.00 GiB/s 5.05 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 911.1ms 1.11 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 906.2ms 1.11 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 177.8ms 5.66 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 141.4ms 7.12 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.2ms 6.7ms 7.18x 43.00 MiB 3.00 MiB 0.07x 0.03 MiB/s 0.23 MiB/s
claude session --offline --json 0.00 MiB 47.4ms 6.6ms 7.19x 43.25 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.23 MiB/s
codex daily --offline --json 0.00 MiB 44.4ms 6.1ms 7.33x 43.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.14 MiB/s
codex session --offline --json 0.00 MiB 43.7ms 5.7ms 7.72x 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 1.046s 964.1ms 1.08x 733.25 MiB 745.00 MiB 1.02x 985.97 MiB/s 1.04 GiB/s
codex --offline --json 1.01 GiB 171.8ms 137.2ms 1.25x 90.00 MiB 89.00 MiB 0.99x 5.86 GiB/s 7.34 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.33 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