Skip to content

perf(rust): split the workspace into independently cached crates - #1428

Merged
ryoppippi merged 43 commits into
mainfrom
cursor/split-adapter-crates-f578
Jul 27, 2026
Merged

ryoppippi merged 43 commits into
mainfrom
cursor/split-adapter-crates-f578

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Splits the Rust runtime so that a change recompiles what depends on it and nothing
else, and makes CI actually build the resulting graph in parallel.

  • 15 source adapters, the unified aggregator, and the shared file/table helpers
    each get their own crate (ccusage-adapter-*, ccusage-adapter-common)
  • the argument parser and its embedded help assets leave ccusage-cli, which every
    runtime crate depends on, for ccusage-cli-parser
  • ccusage-config takes config.rs + config_schema.rs, and with them schemars,
    out of ccusage-core
  • the billing-block report, the agent roster, and the pricing HTTP client leave
    ccusage-core too, so it holds only what every crate genuinely shares
  • Crane artifacts are layered as a linear chain, which Linux and macOS can reuse
  • CI stops building every derivation one at a time, which Nix's default
    max-jobs = 1 was doing on 32-vCPU runners
  • generate-config-schema moves to ccusage-config, which takes the whole adapter
    graph off the path to the preflight gate
  • the layout says which is which: rust/adapters/<agent> for the per-source
    crates, rust/crates for everything that is not tied to a single source, and
    [workspace.package] + [workspace.dependencies] for the settings all of them
    share

What a change costs now

Units recompiled for cargo build -p ccusage --bin ccusage, measured on a warm
target directory:

edit units rebuilt
one adapter 3
help text (cli-help.json) 2 (was 20)
a config field or the JSON schema 2 (was 20)
ccusage-core 20

The Nix layers agree: editing cli-help.json or ccusage-config leaves the
foundation and adapters artifact layers byte-identical, verified by comparing
the adapters layer derivation path before and after each edit. ccusage-core is
the one crate whose fan-out is unavoidable, which is why the bin-only parts left
it.

Why the layering changed shape

The first iteration built one artifact derivation per adapter. That could not be
used on macOS at all: Crane installs full rather than incremental archives there
(rust-lang/rust#115982), and
merging sibling full archives can overwrite shared path-crate artifacts with
incompatible variants, so macOS fell back to the dependency-only cache and
recompiled everything on every build.

A linear chain — dependencies → foundation → adapters → binary — only ever extends
the previous layer, so it needs no merging and works everywhere. The 15 adapters
share one layer because they are mutually independent: one cargoBuild with a -p
per crate lets Cargo compile them concurrently, so the layer costs about as much as
its slowest adapter (measured: codex at 12.4s against 69.2s CPU for all 15), while
the fan-out added five serial Nix round-trips that each unpack and re-archive the
227 MB dependency target directory.

Why CI parallelism had to be fixed first

nix-quick-install-action writes the nix.conf it is given verbatim, so Nix kept
its documented default of max-jobs = 1: nix flake check's independent checks and
every artifact layer were built one at a time. Without this, no layering shape can
pay off — and this one line helps main too.

What left ccusage-core

  • config (2,730 LOC, 28% of core) — one consumer, the binary, and the schema
    derives are where schemars enters the graph. cargo tree -p ccusage-core no
    longer mentions it.
  • blocks (582 LOC) — one consumer, the binary; SessionBlock, BurnRate, and
    Projection travel with it.
  • the pricing HTTP client — ureq entered through one 25-line function and
    brought rustls, ring, webpki and ~20 more crates that had to compile before core,
    and therefore before every adapter. Core now takes the fetcher as a function
    pointer that main installs. With none installed a refresh reports it is
    unavailable and the embedded snapshots are used, which is the existing --offline
    behaviour.
  • the agent roster — progress::UsageLoadAgent was a closed 16-variant enum
    plus a label match, so adding an agent meant editing the crate every adapter
    depends on. It is a newtype around the label now; the labels are unchanged.
  • the LiteLLM download in build.rs — minreq pulled rustls's aws-lc-rs
    provider on top of the ring provider ureq already needed, and compiling
    aws-lc's C and assembly sources took longer than any other unit in the graph
    (~66s CPU). No Nix build could ever use it, since the sandbox has no network and
    every package passes CCUSAGE_PRICING_JSON_PATH. It now sits behind an
    off-by-default fetch-litellm-pricing feature that only the Windows release build
    enables, and the dev shell exports the same pinned snapshot.

Also: the adapter manifests were copies of one dependency block, so sqlite now
appears only in the four crates that open a database and insta only where a
snapshot test exists; print_table_for_agent moved to ccusage-adapter-common, which
removed the goose and codebuff dependencies on the amp crate; and ccusage-clippy
no longer takes the whole repository as its source, so a README edit stops
invalidating the most expensive check in nix flake check.

The schema generator was pulling the adapter graph

generate-config-schema was a second bin of the ccusage package, so building it
compiled every adapter even though it only calls into the config layer. It now lives
in ccusage-config, where a clean build is 3 units, and its Nix derivation starts
from the foundation artifacts instead of the adapter ones.

That is a wall-clock change rather than a tidiness one, because treefmt depends on
this generator and the preflight job builds treefmt — so every build job in the
matrix was waiting behind 15 adapters that the formatter never needed.

Measured effect on CI

Three consecutive main runs (the pre-split monolith, whose durations vary by only
a few seconds) against a warm-cache run of this branch. Cache state dominates
everything here, so the branch run used is one whose push changed no manifest,
meaning it restored the previous run's cache the way a normal push does.

job main this branch change
build-linux-x64 2.15m 0.65m −70%
build-linux-arm64 4.88m 1.18m −76%
build-mac-arm64 4.25m 1.78m −58%
build-mac-x64 4.32m 1.70m −61%
test 2.42m 1.43m −41%
security & lint preflight 1.80m 0.63m −65%
sum of the Nix jobs above 19.8m 7.4m −63%

Windows is measured separately because it is the one platform Nix cannot target: it
runs plain cargo build with actions/cache. Its cargo build step, three runs
each side:

main this branch
Windows cargo build 1m29s / 1m42s / 1m50s 26s / 30s / 26s

That is the split paying off directly — the monolith compiled as one crate with
codegen-units = 1, while 22 smaller crates compile concurrently. Whole-job
duration on that runner is not a useful signal: rustup toolchain provisioning took
4s in one run and 4m36s in another.

What the remaining wall clock is

Whole-workflow wall clock is roughly unchanged (main 9.7–10.3m, this branch 9.9m).
The critical path, from job timestamps on one branch run:

job window
changes 0.0–0.2m
security & lint preflight 0.1–1.3m
build-linux-arm64 (cold; 1.18m warm) 1.6–5.2m
npm-publish 5.3–6.1m
e2e 6.1–7.9m
action-timeline 8.0–8.1m

The preflight gate in front of the build matrix is deliberate — the comment in
ci.yaml says so: secret scan and lint should fail before any build or test work
starts. Making that gate cheap is exactly what the schema generator change buys.
Everything after the builds is inherent to testing a package the way a user gets
it: the npm publish has to happen before the e2e matrix can install from it.

Binary size

The split costs binary size, and this is the honest accounting: each crate
instantiates the shared generic machinery for its own types, and stable Rust cannot
share those instantiations across crates. Measured on the shipped Linux binary,
downloaded from the CI artifacts of each side:

bytes vs main
main 4,241,344 —
this branch, no ICF 4,482,112 +5.7%
this branch, mold --icf=all 4,323,392 +1.9%
this branch, plus the narrowed visibility 4,302,464 +1.4%

Linker dead-stripping recovers none of the 240,768 bytes (measured: byte-identical
output with -Wl,-dead_strip), because the duplicates are reachable code rather than
dead code. Identical-code folding is the lever that applies, and it recovers 158,720
of them, with another 20,928 coming from the narrowed visibility below; nothing in the tree depends on two fn items having distinct addresses.

macOS therefore links with lld rather than ld64, because ld64 has no ICF. The Nix
build goes from 3,299,504 to 3,232,928 bytes (−2.0%), and lld also links more than
twice as fast: a relink of the release binary takes 20s against 42s with ld64. Both
macOS packages still link only /usr/lib and /System/Library dylibs.

Layout and manifests

Each adapter manifest used to repeat the same package fields and dependency
specs, so adding a crate meant copying a block and a version bump meant editing 23
files. Those now live in [workspace.package] and [workspace.dependencies], and
a crate manifest is a list of what that crate actually uses:

[package]
name = "ccusage-adapter-qwen"
version.workspace = true
edition.workspace = true
publish.workspace = true

[dependencies]
ccusage-adapter-common.workspace = true
ccusage-core.workspace = true
jiff.workspace = true
serde.workspace = true
serde_json.workspace = true

[dev-dependencies]
ccusage-test-support.workspace = true
rust/
  adapters/            one crate per usage source, plus common/ that they share
    amp/ claude/ codex/ ... qwen/
  crates/
    ccusage/           the binary
    ccusage-adapter-all/  the unified report
    ccusage-cli/ ccusage-cli-parser/ ccusage-config/
    ccusage-core/ ccusage-terminal/ ccusage-test-support/

ccusage-adapter-common sits with the adapters rather than beside the unified
report for a build reason as well as a conceptual one: a Cargo member glob that
matches nothing is an error, and the foundation artifact layer is built from a
source tree containing no other adapter.

Visibility, and the toolchain bump that checks it

A 24-crate split is a machine for producing pub that nothing outside the workspace
ever needs, so the branch runs hawk, a
workspace-aware Cargo lint for unnecessary Rust visibility. It found 85 such
declarations that the split had introduced, and the branch resolves all of them:
pub becomes pub(crate) wherever the workspace is the only client, and one
finding was genuinely dead code — Cli::parse had no callers, because the binary
parses through parse_from_with_config to pass a config context — so it is gone.
just hawk reports no findings.

hawk uses rustc_private and must run on the toolchain it was built against, so the
pin moves to Rust 1.97.1; the dev shell picks that up from rust-toolchain.toml with
no flake change. rust/hawk.toml declares the two production entry points — the
ccusage binary and generate-config-schema — rather than letting hawk infer that
every binary target is shipped, so the reason each one counts as an entry point is
written down.

Documentation

Every crate has a README.md stating what it owns, what belongs elsewhere, its
public surface, and which artifact layer it lands in — the last one being what
determines how much a change to it costs. The rust skill points at them and states
the rule the amp coupling broke: adapters do not depend on each other.

Testing

  • cargo test --manifest-path rust/Cargo.toml --workspace (48 suites)
  • cargo clippy --manifest-path rust/Cargo.toml --workspace --all-targets -- -D warnings, with and without --features fetch-litellm-pricing
  • nix build .#ccusage .#ccusage-tests .#checks.aarch64-darwin.ccusage-clippy .#checks.aarch64-darwin.config-schema
  • just fmt, just typecheck
  • output parity against a main binary built on the same machine: --help, codex --help, daily --help, blocks --help, and --json --offline for the unified, daily, and codex reports are byte-identical on local data
  • the same parity holds for the lld-linked macOS binary against the ld64 one
  • the shipped binary still refreshes pricing over the network (a live run takes the network path; --offline does not)
  • cargo tree -p ccusage-core contains no schemars, ureq, rustls, ring, webpki, minreq, or aws-lc-sys

Follow-up

  • pricing.rs is core's largest module at 2,850 LOC and is genuinely shared, but it
    mixes the rate tables, the models.dev cache, and the lookup logic; splitting it
    inside core would let a rate-table tweak recompile less.

Move shared types, pricing, configuration, output, date, and block logic into ccusage-core so adapter crates can depend on an acyclic foundation. Keep the ccusage package focused on command dispatch and move Codex-owned types into its adapter boundary.

Co-authored-by: ryoppippi <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR extracts Rust agent implementations into dedicated adapter crates, centralizes shared APIs in ccusage-core and ccusage-adapter-common, adds unified all-agent reporting, introduces layered Nix Cargo artifacts, and updates CLI wiring, pricing snapshots, documentation, and CI automation.

Changes

Adapter crate migration

Layer / File(s) Summary
Core APIs and shared infrastructure
rust/crates/ccusage-core/*, rust/crates/ccusage-adapter-common/*
Shared usage types, configuration, pricing, date, JSONL, filesystem, reporting, and progress APIs are exposed or added.
Dedicated agent adapters
rust/crates/ccusage-adapter-*/**
Adapter manifests, path discovery, parsers, loaders, reports, public entrypoints, Codex replay handling, and source documentation are added or migrated.
Unified all-agent reporting
rust/crates/ccusage-adapter-all/*
All-agent aggregation, ordered JSON output, table rendering, model breakdowns, and cross-agent tests are added.
Native CLI wiring
rust/crates/ccusage/*, rust/crates/ccusage/src/adapter/*
The native crate delegates to external adapter crates and ccusage-core, narrows legacy exports, and adds cross-crate API checks.

Build and repository integration

Layer / File(s) Summary
Nix artifact pipeline
package.nix, nix/*, default.nix
Dependency-only and workspace Cargo artifacts are separated, composed, exposed through passthru attributes, and assembled into cache roots.
CI cache and pricing automation
.github/actions/*, .github/workflows/update-pricing.yaml, justfile
Linux Nix GC settings, artifact rooting, Windows pricing-feature activation, and multi-file pricing snapshot staging are updated.
Repository guidance
AGENTS.md, .agents/skills/*, rust/crates/ccusage/src/adapter/*, rust/crates/ccusage-adapter-*/src/README.md
Instructions and source documentation reference dedicated adapter crates and shared core/common locations.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: copilot, pullfrog

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: splitting the Rust workspace into independently cached crates.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/split-adapter-crates-f578

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

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

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

Branch Preview URL
Jul 27 2026, 11:02 AM

cursoragent and others added 2 commits July 10, 2026 23:14
Keep Insta snapshot ownership aligned with the new ccusage-core crate so its existing characterization tests continue to compare the same outputs.

Co-authored-by: ryoppippi <[email protected]>
Move JSONL parsing, file walking, date filtering, size-balanced chunking, and ordered parallel reads into ccusage-adapter-common. This removes the Claude adapter as an infrastructure dependency before agent crates are split.

Co-authored-by: ryoppippi <[email protected]>
@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

ccusage

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

@ccusage/ccusage-darwin-arm64

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

@ccusage/ccusage-darwin-x64

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

@ccusage/ccusage-linux-arm64

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

@ccusage/ccusage-linux-x64

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

@ccusage/ccusage-win32-x64

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

commit: 79a958e

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: e664cefa96f6
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 335.4ms 3.00 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 303.4ms 3.32 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 108.3ms 9.30 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 81.9ms 12.29 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 native ccusage binary 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 25.9ms 4.1ms 6.29x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.38 MiB/s
claude session --offline --json 0.00 MiB 25.4ms 2.3ms 11.07x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.67 MiB/s
codex daily --offline --json 0.00 MiB 26.0ms 2.2ms 11.76x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.39 MiB/s
codex session --offline --json 0.00 MiB 22.8ms 2.1ms 10.98x 53.75 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.41 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 345.0ms 310.2ms 1.11x 960.59 MiB 960.34 MiB 1.00x 2.92 GiB/s 3.25 GiB/s
codex --offline --json 1.01 GiB 101.1ms 83.2ms 1.21x 427.29 MiB 411.29 MiB 0.96x 9.96 GiB/s 12.09 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.70 KiB -0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4102.00 KiB +18.19 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: e664cefa96f6
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 351.5ms 2.86 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 318.8ms 3.16 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 106.7ms 9.43 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 83.0ms 12.13 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 24.2ms 26.8ms 0.90x 53.50 MiB 54.00 MiB 1.01x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 27.8ms 25.7ms 1.08x 54.00 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 22.9ms 23.0ms 1.00x 53.75 MiB 53.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 23.2ms 24.4ms 0.95x 53.50 MiB 53.75 MiB 1.00x 0.04 MiB/s 0.04 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 367.5ms 364.9ms 1.01x 954.58 MiB 948.34 MiB 0.99x 2.74 GiB/s 2.76 GiB/s
codex --offline --json 1.01 GiB 107.8ms 110.0ms 0.98x 437.29 MiB 417.29 MiB 0.95x 9.34 GiB/s 9.15 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.70 KiB -0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4102.00 KiB +18.19 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: 56aebe7e01db
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 338.2ms 2.98 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 301.8ms 3.34 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 103.6ms 9.72 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 80.6ms 12.48 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 25.7ms 26.0ms 0.99x 53.75 MiB 54.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 23.0ms 22.5ms 1.02x 53.75 MiB 53.75 MiB 1.00x 0.07 MiB/s 0.07 MiB/s
codex daily --offline --json 0.00 MiB 22.8ms 22.3ms 1.02x 53.50 MiB 53.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 22.2ms 22.9ms 0.97x 53.75 MiB 53.50 MiB 1.00x 0.04 MiB/s 0.04 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 357.3ms 341.2ms 1.05x 948.58 MiB 930.33 MiB 0.98x 2.82 GiB/s 2.95 GiB/s
codex --offline --json 1.01 GiB 103.2ms 103.6ms 1.00x 403.29 MiB 405.29 MiB 1.00x 9.76 GiB/s 9.71 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.70 KiB -0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4102.00 KiB +18.19 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: 56aebe7e01db
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 304.2ms 3.31 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 302.0ms 3.33 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 110.2ms 9.14 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 86.0ms 11.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 the published native ccusage binary 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 33.2ms 3.1ms 10.57x 54.00 MiB 10.20 MiB 0.19x 0.05 MiB/s 0.49 MiB/s
claude session --offline --json 0.00 MiB 30.8ms 3.9ms 7.96x 53.75 MiB 10.19 MiB 0.19x 0.05 MiB/s 0.40 MiB/s
codex daily --offline --json 0.00 MiB 27.5ms 2.6ms 10.71x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.33 MiB/s
codex session --offline --json 0.00 MiB 27.9ms 3.0ms 9.39x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.29 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 334.0ms 292.2ms 1.14x 948.58 MiB 954.33 MiB 1.01x 3.01 GiB/s 3.45 GiB/s
codex --offline --json 1.01 GiB 115.8ms 91.9ms 1.26x 401.28 MiB 403.29 MiB 1.01x 8.70 GiB/s 10.95 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.70 KiB -0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4102.00 KiB +18.19 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: f47231f21c94
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 337.7ms 2.98 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 311.0ms 3.24 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 105.8ms 9.52 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 80.9ms 12.44 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 native ccusage binary 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 25.2ms 3.0ms 8.49x 53.75 MiB 10.21 MiB 0.19x 0.06 MiB/s 0.52 MiB/s
claude session --offline --json 0.00 MiB 25.6ms 2.6ms 9.82x 53.75 MiB 10.21 MiB 0.19x 0.06 MiB/s 0.59 MiB/s
codex daily --offline --json 0.00 MiB 23.9ms 2.1ms 11.16x 53.50 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.40 MiB/s
codex session --offline --json 0.00 MiB 24.4ms 2.1ms 11.51x 54.00 MiB 8.20 MiB 0.15x 0.04 MiB/s 0.40 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 347.6ms 308.5ms 1.13x 970.58 MiB 944.34 MiB 0.97x 2.90 GiB/s 3.26 GiB/s
codex --offline --json 1.01 GiB 103.2ms 89.1ms 1.16x 397.29 MiB 411.04 MiB 1.03x 9.76 GiB/s 11.30 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4102.44 KiB +18.62 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: f47231f21c94
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 317.0ms 3.18 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 287.2ms 3.51 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 117.5ms 8.57 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 92.4ms 10.90 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 31.3ms 29.2ms 1.07x 53.75 MiB 53.75 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 30.4ms 29.9ms 1.02x 54.00 MiB 54.25 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 28.1ms 28.8ms 0.98x 53.75 MiB 54.00 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 29.3ms 27.0ms 1.09x 53.75 MiB 53.75 MiB 1.00x 0.03 MiB/s 0.03 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 332.1ms 311.5ms 1.07x 928.57 MiB 974.34 MiB 1.05x 3.03 GiB/s 3.23 GiB/s
codex --offline --json 1.01 GiB 112.6ms 119.7ms 0.94x 391.28 MiB 407.05 MiB 1.04x 8.94 GiB/s 8.41 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4102.44 KiB +18.62 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.

cursoragent and others added 2 commits July 10, 2026 23:33
Move every agent adapter and the unified all-agent aggregator into dedicated ccusage-adapter-* crates. Preserve their tests and snapshots with each owning crate, keep shared infrastructure in ccusage-adapter-common, and leave ccusage as thin command wiring.

Co-authored-by: ryoppippi <[email protected]>
Build the shared foundation and each adapter as filtered Crane cargoBuild derivations, merge their real target artifacts, and compile only the unified adapter plus thin binary at the final layers. Apply the same target-specific graph to native, musl, and Darwin cross packages.

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

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 8c6a770231c1
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 340.0ms 2.96 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 308.4ms 3.26 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 105.6ms 9.53 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 81.1ms 12.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 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 26.2ms 25.5ms 1.03x 53.75 MiB 53.50 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 25.0ms 25.8ms 0.97x 53.75 MiB 54.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 24.3ms 23.7ms 1.03x 53.75 MiB 53.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 25.5ms 23.1ms 1.10x 53.75 MiB 53.75 MiB 1.00x 0.03 MiB/s 0.04 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 361.3ms 341.8ms 1.06x 958.58 MiB 950.59 MiB 0.99x 2.79 GiB/s 2.95 GiB/s
codex --offline --json 1.01 GiB 103.4ms 106.1ms 0.97x 419.28 MiB 417.29 MiB 1.00x 9.74 GiB/s 9.48 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4214.88 KiB +131.06 KiB 0.97x

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: 8c6a770231c1
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 299.3ms 3.36 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 289.5ms 3.48 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 112.0ms 8.99 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 87.8ms 11.46 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 native ccusage binary 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 31.1ms 4.6ms 6.73x 53.75 MiB 10.46 MiB 0.19x 0.05 MiB/s 0.33 MiB/s
claude session --offline --json 0.00 MiB 29.4ms 4.0ms 7.33x 53.75 MiB 10.46 MiB 0.19x 0.05 MiB/s 0.39 MiB/s
codex daily --offline --json 0.00 MiB 28.0ms 3.1ms 9.17x 54.00 MiB 8.45 MiB 0.16x 0.03 MiB/s 0.28 MiB/s
codex session --offline --json 0.00 MiB 28.3ms 2.8ms 10.01x 53.75 MiB 8.45 MiB 0.16x 0.03 MiB/s 0.30 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 331.8ms 299.7ms 1.11x 952.58 MiB 964.59 MiB 1.01x 3.03 GiB/s 3.36 GiB/s
codex --offline --json 1.01 GiB 110.1ms 85.4ms 1.29x 401.29 MiB 423.30 MiB 1.05x 9.15 GiB/s 11.79 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4214.88 KiB +131.06 KiB 0.97x

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

cursoragent and others added 3 commits July 10, 2026 23:48
Update repository guidance and source references for the new ccusage-adapter-* workspace layout and shared core/common boundaries.

Co-authored-by: ryoppippi <[email protected]>
Crane emits full artifact archives on macOS, so merging sibling adapter archives can overwrite shared crate variants. Keep per-adapter layers on Linux and fall back to the safe dependency-only cache for native and cross Darwin packages.

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

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 41239072d95c
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 331.5ms 3.04 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 320.3ms 3.14 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 98.7ms 10.20 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 78.8ms 12.78 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 native ccusage binary 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 24.7ms 4.2ms 5.84x 53.50 MiB 10.46 MiB 0.20x 0.06 MiB/s 0.37 MiB/s
claude session --offline --json 0.00 MiB 27.0ms 2.6ms 10.31x 53.75 MiB 10.46 MiB 0.19x 0.06 MiB/s 0.59 MiB/s
codex daily --offline --json 0.00 MiB 25.4ms 2.3ms 11.06x 53.75 MiB 8.45 MiB 0.16x 0.03 MiB/s 0.37 MiB/s
codex session --offline --json 0.00 MiB 24.8ms 2.1ms 11.85x 53.50 MiB 8.45 MiB 0.16x 0.03 MiB/s 0.41 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 345.0ms 311.1ms 1.11x 958.59 MiB 950.60 MiB 0.99x 2.92 GiB/s 3.24 GiB/s
codex --offline --json 1.01 GiB 101.2ms 82.7ms 1.22x 437.29 MiB 421.30 MiB 0.96x 9.95 GiB/s 12.18 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4214.88 KiB +131.06 KiB 0.97x

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: 41239072d95c
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 324.1ms 3.11 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 286.9ms 3.51 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 106.5ms 9.46 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 88.5ms 11.38 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 29.5ms 30.5ms 0.97x 53.75 MiB 54.00 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 29.7ms 27.2ms 1.09x 53.75 MiB 53.75 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 30.5ms 25.3ms 1.21x 53.75 MiB 54.00 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 28.3ms 26.0ms 1.09x 53.75 MiB 53.75 MiB 1.00x 0.03 MiB/s 0.03 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 340.5ms 309.9ms 1.10x 960.58 MiB 964.59 MiB 1.00x 2.96 GiB/s 3.25 GiB/s
codex --offline --json 1.01 GiB 117.8ms 113.8ms 1.03x 401.29 MiB 393.30 MiB 0.98x 8.55 GiB/s 8.85 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4214.88 KiB +131.06 KiB 0.97x

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

Move generic JSON row and period helpers from the OpenCode adapter into ccusage-core. Remove the resulting OpenCode dependency from leaf adapters and trim obsolete direct dependencies from the binary crate.
Regenerate, format, diff, and stage models.dev and Codex fallback snapshots at their new owning crate paths. Watch the moved config schema source in treefmt as well.
Build independent adapters directly from the shared foundation. Root the current Linux native artifact graph and garbage-collect superseded store generations before saving that cache, preventing per-commit artifact accumulation.
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: e7e1f2da448f
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 343.7ms 2.93 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 322.9ms 3.12 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 104.5ms 9.63 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 81.9ms 12.29 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 native ccusage binary 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 25.4ms 4.0ms 6.31x 53.75 MiB 10.70 MiB 0.20x 0.06 MiB/s 0.38 MiB/s
claude session --offline --json 0.00 MiB 22.8ms 2.9ms 7.94x 53.75 MiB 10.70 MiB 0.20x 0.07 MiB/s 0.54 MiB/s
codex daily --offline --json 0.00 MiB 25.2ms 2.1ms 12.14x 53.75 MiB 8.68 MiB 0.16x 0.03 MiB/s 0.41 MiB/s
codex session --offline --json 0.00 MiB 24.1ms 2.1ms 11.56x 53.75 MiB 8.69 MiB 0.16x 0.04 MiB/s 0.41 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 361.9ms 315.5ms 1.15x 956.58 MiB 944.83 MiB 0.99x 2.78 GiB/s 3.19 GiB/s
codex --offline --json 1.01 GiB 107.6ms 81.5ms 1.32x 419.29 MiB 425.53 MiB 1.01x 9.36 GiB/s 12.35 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4319.56 KiB +235.75 KiB 0.95x

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: e7e1f2da448f
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 335.6ms 3.00 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 315.2ms 3.19 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 102.3ms 9.84 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 80.5ms 12.51 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 25.7ms 24.4ms 1.05x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 25.0ms 25.1ms 1.00x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 25.3ms 22.3ms 1.14x 53.75 MiB 53.75 MiB 1.00x 0.03 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 22.6ms 23.2ms 0.97x 53.50 MiB 54.00 MiB 1.01x 0.04 MiB/s 0.04 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 351.0ms 331.1ms 1.06x 946.58 MiB 1.01 GiB 1.09x 2.87 GiB/s 3.04 GiB/s
codex --offline --json 1.01 GiB 102.2ms 109.9ms 0.93x 437.29 MiB 423.53 MiB 0.97x 9.85 GiB/s 9.16 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4319.56 KiB +235.75 KiB 0.95x

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

Expose only each adapter's intentional command and loader surface while keeping parser, path, report, and implementation modules crate-private.
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 511bb3718ff4
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 346.2ms 2.91 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 345.1ms 2.92 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 105.9ms 9.51 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 82.6ms 12.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 native ccusage binary 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 26.5ms 4.1ms 6.49x 53.50 MiB 10.70 MiB 0.20x 0.06 MiB/s 0.38 MiB/s
claude session --offline --json 0.00 MiB 26.0ms 2.6ms 9.95x 53.75 MiB 10.70 MiB 0.20x 0.06 MiB/s 0.59 MiB/s
codex daily --offline --json 0.00 MiB 23.7ms 2.2ms 10.77x 53.75 MiB 8.69 MiB 0.16x 0.04 MiB/s 0.39 MiB/s
codex session --offline --json 0.00 MiB 25.6ms 2.2ms 11.54x 53.75 MiB 8.69 MiB 0.16x 0.03 MiB/s 0.39 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 365.1ms 320.4ms 1.14x 958.58 MiB 968.84 MiB 1.01x 2.76 GiB/s 3.14 GiB/s
codex --offline --json 1.01 GiB 108.4ms 86.2ms 1.26x 449.29 MiB 449.54 MiB 1.00x 9.29 GiB/s 11.68 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4319.88 KiB +236.06 KiB 0.95x

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: 511bb3718ff4
Base SHA: 997ad7f90189

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 355.4ms 2.83 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 311.5ms 3.23 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 105.6ms 9.54 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 89.7ms 11.23 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 26.6ms 26.6ms 1.00x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 25.2ms 23.6ms 1.07x 53.75 MiB 53.50 MiB 1.00x 0.06 MiB/s 0.07 MiB/s
codex daily --offline --json 0.00 MiB 22.9ms 23.6ms 0.97x 53.50 MiB 53.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 23.9ms 24.0ms 1.00x 53.75 MiB 53.50 MiB 1.00x 0.04 MiB/s 0.04 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 355.2ms 337.7ms 1.05x 954.58 MiB 954.83 MiB 1.00x 2.83 GiB/s 2.98 GiB/s
codex --offline --json 1.01 GiB 104.5ms 107.8ms 0.97x 419.29 MiB 417.54 MiB 1.00x 9.63 GiB/s 9.34 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4083.81 KiB 4319.88 KiB +236.06 KiB 0.95x

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: 841bc51ed80a
Base SHA: df89eb712b75

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 328.9ms 3.06 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 279.0ms 3.61 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 122.1ms 8.24 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 98.6ms 10.21 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 native ccusage binary 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 32.7ms 6.2ms 5.25x 55.00 MiB 12.71 MiB 0.23x 0.05 MiB/s 0.25 MiB/s
claude session --offline --json 0.00 MiB 33.7ms 4.2ms 8.01x 55.25 MiB 12.71 MiB 0.23x 0.05 MiB/s 0.37 MiB/s
codex daily --offline --json 0.00 MiB 28.4ms 2.9ms 9.80x 55.25 MiB 10.70 MiB 0.19x 0.03 MiB/s 0.30 MiB/s
codex session --offline --json 0.00 MiB 27.4ms 3.4ms 8.13x 54.75 MiB 10.71 MiB 0.20x 0.03 MiB/s 0.25 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 348.7ms 295.2ms 1.18x 974.34 MiB 950.84 MiB 0.98x 2.89 GiB/s 3.41 GiB/s
codex --offline --json 1.01 GiB 124.1ms 100.7ms 1.23x 398.89 MiB 407.16 MiB 1.02x 8.11 GiB/s 10.00 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4141.94 KiB 4222.06 KiB +80.13 KiB 0.98x

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

hawk lints a Cargo workspace for `pub` that the workspace itself never needs,
which is exactly the surface a 24-crate split creates. It uses `rustc_private`
and must run on the toolchain it was built against, so the pin moves to 1.97.1;
the dev shell picks that up from rust-toolchain.toml with no flake change.

hawk.toml names the two production entry points rather than letting hawk assume
every binary target is shipped, so the reason each one is an entry point is
written down. 1.97.1's clippy also wants a byte-string literal in
parse_timezone_offset.
Splitting one crate into 24 turned a lot of module-private items into `pub`,
because that is what crossing a crate boundary needs — but only some of them are
actually crossed. hawk's closed-world analysis over the two production entry
points found 85 such declarations; this applies the 68 machine-applicable ones,
turning `pub` into `pub(crate)` and dropping restricted modifiers that no longer
restrict anything.
The remaining hawk findings were public re-exports that no other crate reaches:
each adapter re-exported report_from_rows even though only its own run() calls
it, claude re-exported three path helpers used only inside itself, and codex
re-exported two types its own parser and replay modules use. Splitting each
statement keeps every name visible where it is used and stops advertising it
past the crate boundary.

Cli::parse had no callers at all — the binary goes through
parse_from_with_config because it must pass a config context — so it is gone and
its parse_from shorthand is now test-only. hawk reports no findings.
A 24-crate workspace needs a stated rule for `pub`, or the next crate will export
whatever compiles. The rust skill now says what the rule is, how `just hawk`
checks it, that hawk must be installed separately because it is not in nixpkgs,
why the toolchain is pinned to 1.97.1, and that its findings are suggestions
rather than a gate — it is explicitly experimental.
Copilot AI review requested due to automatic review settings July 27, 2026 10:55

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The schema-gen treefmt formatter still listed config_schema.rs under
ccusage-core and the generator under the ccusage package, so after both moved to
ccusage-config it never ran on the files whose changes should regenerate the
schema. The config-schema flake check would still have caught the drift, but only
after a failing build instead of a formatting pass.
Copilot AI review requested due to automatic review settings July 27, 2026 11:01

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 37 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

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


<file name="rust/adapters/qwen/src/lib.rs">

<violation number="1" location="rust/adapters/qwen/src/lib.rs:18">
P2: The README still documents `report::report_from_rows` as part of the public surface, but this change makes it `pub(crate)` only. Since the function is only used internally (in `run()` and tests), the narrower visibility is fine — please update the README's Public surface list to remove this entry so the docs stay accurate.</violation>
</file>

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

Re-trigger cubic

pub(crate) use loader::load_entries;
pub(crate) use report::{report_from_rows, summarize_entries};
pub use loader::load_entries;
pub(crate) use report::report_from_rows;

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: The README still documents report::report_from_rows as part of the public surface, but this change makes it pub(crate) only. Since the function is only used internally (in run() and tests), the narrower visibility is fine — please update the README's Public surface list to remove this entry so the docs stay accurate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At rust/adapters/qwen/src/lib.rs, line 18:

<comment>The README still documents `report::report_from_rows` as part of the public surface, but this change makes it `pub(crate)` only. Since the function is only used internally (in `run()` and tests), the narrower visibility is fine — please update the README's Public surface list to remove this entry so the docs stay accurate.</comment>

<file context>
@@ -15,7 +15,8 @@ use crate::{
 
 pub use loader::load_entries;
-pub use report::{report_from_rows, summarize_entries};
+pub(crate) use report::report_from_rows;
+pub use report::summarize_entries;
 
</file context>

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 9fc9ac3c1cda
Base SHA: df89eb712b75

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 359.3ms 2.80 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 298.2ms 3.38 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 114.6ms 8.79 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 98.0ms 10.27 GiB/s 1

Committed fixture performance

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

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 29.8ms 4.8ms 6.22x 55.00 MiB 12.46 MiB 0.23x 0.05 MiB/s 0.32 MiB/s
claude session --offline --json 0.00 MiB 30.3ms 4.0ms 7.50x 54.75 MiB 12.46 MiB 0.23x 0.05 MiB/s 0.38 MiB/s
codex daily --offline --json 0.00 MiB 23.1ms 2.3ms 10.19x 54.75 MiB 10.70 MiB 0.20x 0.04 MiB/s 0.38 MiB/s
codex session --offline --json 0.00 MiB 22.9ms 2.3ms 9.98x 55.00 MiB 10.70 MiB 0.19x 0.04 MiB/s 0.37 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 366.0ms 313.7ms 1.17x 944.33 MiB 962.58 MiB 1.02x 2.75 GiB/s 3.21 GiB/s
codex --offline --json 1.01 GiB 114.8ms 92.6ms 1.24x 414.91 MiB 412.90 MiB 1.00x 8.77 GiB/s 10.87 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4141.94 KiB 4201.63 KiB +59.69 KiB 0.99x

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: 9fc9ac3c1cda
Base SHA: df89eb712b75

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 356.6ms 2.82 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 302.1ms 3.33 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 117.6ms 8.56 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 91.1ms 11.05 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 30.2ms 27.8ms 1.09x 55.00 MiB 55.00 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 26.0ms 24.9ms 1.04x 55.25 MiB 55.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 23.4ms 24.1ms 0.97x 55.00 MiB 54.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 22.7ms 24.8ms 0.91x 55.00 MiB 55.00 MiB 1.00x 0.04 MiB/s 0.03 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 364.7ms 324.9ms 1.12x 956.34 MiB 954.59 MiB 1.00x 2.76 GiB/s 3.10 GiB/s
codex --offline --json 1.01 GiB 112.2ms 115.8ms 0.97x 416.90 MiB 418.90 MiB 1.00x 8.98 GiB/s 8.69 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4141.94 KiB 4201.63 KiB +59.69 KiB 0.99x

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 — 4 commits since the last review: a systematic workspace visibility audit, hawk tooling for automated enforcement, and documentation of the new visibility discipline.

  • Narrowed pub to pub(crate) or fn across all ~20 workspace crates — every item that no other crate uses lost its pub visibility. Struct fields (Pricing::cache_create*, IsoDate::year/month/day, UtcParts::millisecond, TokenCounts::extra_total_tokens, CacheCreationRaw fields), standalone functions (apply_config_*, parse_timezone_offset, parse_digits, calendar helpers, format_*), adapter exports (report_from_rows), and type helpers (merge_codex_service_tiers, aggregate_model_breakdowns, parse_project_aliases) were narrowed. Items the binary crate needs became pub (load_entries, summarize_entries, run, calculate_cost_*, PricingMap methods).
  • Dead code removed — Cli::parse() (no callers; binary uses parse_from_with_config), unused weekday_from_sunday and checked_add_days on IsoDate.
  • Hawk integration — toolchain bumped to 1.97.1, rust/hawk.toml declares the two production entry points, and just hawk reports pub items nothing outside their crate needs.
  • Documented visibility discipline — the rust skill and AGENTS.md now state: pub only for what another crate requires, pub(crate) for everything else, with just hawk as the automated check.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (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 — 1 commit since the last review: fixes the stale treefmt schema-gen includes paths that the prior review flagged.

  • Fixed treefmt.nix schema formatter paths — config_schema.rs now points to rust/crates/ccusage-config/src/config_schema.rs (was ccusage-core) and generate_config_schema.rs now points to rust/crates/ccusage-config/src/bin/generate_config_schema.rs (was ccusage/src/bin). Treefmt will once again auto-generate the schema when those files change locally.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 79a958eadbb0
Base SHA: df89eb712b75

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 351.0ms 2.87 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 326.4ms 3.08 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 119.6ms 8.42 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 100.4ms 10.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 native ccusage binary 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 27.0ms 2.9ms 9.25x 55.00 MiB 12.45 MiB 0.23x 0.06 MiB/s 0.53 MiB/s
claude session --offline --json 0.00 MiB 24.8ms 2.7ms 9.07x 55.00 MiB 12.45 MiB 0.23x 0.06 MiB/s 0.57 MiB/s
codex daily --offline --json 0.00 MiB 23.1ms 2.5ms 9.43x 55.00 MiB 10.70 MiB 0.19x 0.04 MiB/s 0.35 MiB/s
codex session --offline --json 0.00 MiB 22.8ms 2.4ms 9.48x 55.00 MiB 10.70 MiB 0.19x 0.04 MiB/s 0.36 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary 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 381.0ms 330.1ms 1.15x 962.34 MiB 950.84 MiB 0.99x 2.64 GiB/s 3.05 GiB/s
codex --offline --json 1.01 GiB 120.9ms 97.0ms 1.25x 420.90 MiB 410.90 MiB 0.98x 8.33 GiB/s 10.38 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4141.94 KiB 4201.63 KiB +59.69 KiB 0.99x

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: 79a958eadbb0
Base SHA: df89eb712b75

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

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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 349.9ms 2.88 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 312.2ms 3.22 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 122.9ms 8.19 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 129.1ms 7.80 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 30.0ms 28.3ms 1.06x 55.00 MiB 55.00 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 26.3ms 24.4ms 1.08x 55.00 MiB 55.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 23.9ms 23.6ms 1.01x 55.00 MiB 55.25 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 25.8ms 23.4ms 1.10x 55.00 MiB 55.00 MiB 1.00x 0.03 MiB/s 0.04 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, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 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 389.3ms 375.2ms 1.04x 966.34 MiB 946.59 MiB 0.98x 2.59 GiB/s 2.68 GiB/s
codex --offline --json 1.01 GiB 120.7ms 123.9ms 0.97x 416.91 MiB 410.91 MiB 0.99x 8.34 GiB/s 8.13 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.71 KiB +0.00 KiB 1.00x
installed native package binary 4141.94 KiB 4201.63 KiB +59.69 KiB 0.99x

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 86788c3 into main Jul 27, 2026
35 checks passed
@ryoppippi
ryoppippi deleted the cursor/split-adapter-crates-f578 branch July 27, 2026 11:16
ryoppippi added a commit that referenced this pull request Jul 27, 2026
…til-adapter

Resolves the workspace split from #1428, which moved the files this branch
touches into separate crates:

- `date_utils` now lives in `ccusage-core`. The window helpers added here
  (`date_within_range`, `date_range_bounds_ms`) are `pub` rather than
  `pub(crate)`, because the opencode adapter that calls them is its own
  crate now; `parse_compact_date` and `start_of_day_ms` stay private.
  `parse_digits` keeps main's private, overflow-checked version.
- `filter_loaded_entries_by_date` moved from the claude adapter to
  `ccusage-adapter-common`. Main's copy still inlined the date predicate,
  so it now calls the shared `date_within_range` instead — the point of
  collapsing the three copies in the first place.
- `opencode::has_data` follows the adapter crate's new `pub` surface.
ryoppippi added a commit that referenced this pull request Jul 28, 2026
…1510)

* fix(pricing): commit the codex fallback snapshot from its real path

The models.dev job has failed on every hourly run since #1428 moved the
adapter crates:

  fatal: pathspec
  'rust/crates/ccusage-adapter-codex/src/codex-auto-review-fallbacks.json'
  did not match any files

The file lives at rust/adapters/codex/src/codex-auto-review-fallbacks.json,
so models.dev pricing has not been refreshed since that move; only the
LiteLLM half of the workflow still worked.

The path was duplicated between the update script and the workflow, which is
how it drifted from the Rust tree in the first place. The script now reports
the paths it owns through GITHUB_OUTPUT and the workflow passes that straight
to the push action, so there is one list. The script also asserts up front
that the snapshots exist, so the next move fails immediately instead of
after a full regenerate-and-validate cycle.

* refactor(pricing): share the GITHUB_OUTPUT report helper between lock scripts

Both update scripts carried a byte-identical `report` definition, so any change
to the GITHUB_OUTPUT format had to be made twice. Move it to a
`.github/scripts/pricing-lock.nu` module both scripts import.

Nushell resolves relative `use` paths against the importing file, so the module
loads regardless of the workflow's working directory.

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

---------

Co-authored-by: Codesmith <[email protected]>
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.

3 participants