Skip to content

chore: consolidate dev tasks behind just - #1238

Merged
ryoppippi merged 7 commits into
mainfrom
chore/consolidate-tasks-into-just
Jun 8, 2026
Merged

ryoppippi merged 7 commits into
mainfrom
chore/consolidate-tasks-into-just

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Make just the single entry point for development and release tasks, with
per-package justfiles (arto-style modules) aggregated at the root. The pnpm
workspace and the Nix flake stay as the execution backends; just only routes
to them. This removes redundant/duplicated package.json scripts and the
implicit npm pre/post release lifecycle in favour of an explicit recipe.

What changed

  • New justfiles: root justfile with mod ccusage/docs/rust, plus
    apps/ccusage/justfile, docs/justfile, rust/justfile. Root recipes
    aggregate modules (build, typecheck), own whole-repo Nix jobs (fmt,
    check, schema), and release. just test runs Rust + Vitest via the
    [parallel] attribute.
  • pnpm policy inside just: dev-shell tools are called directly (cargo,
    tsgo, nix); package-scoped node binaries use pnpm exec (vitest,
    vitepress, wrangler); pnpm run build is delegated only where npm
    prepack and Cloudflare invoke that script by name.
  • package.json slimmed: root keeps only preinstall. apps/ccusage and
    docs drop scripts that are redundant (format/lint, owned by treefmt +
    flake check) or superseded by just (test cluster, prerelease,
    typecheck/preview/deploy, unused stage:native-package wrapper).
    docs build/dev are kept because wrangler.jsonc calls pnpm run build.
  • release: bump.config.ts now syncs the Rust workspace version from
    operation.state.newVersion instead of the sync:rust-version script +
    $npm_package_version, so that script could be removed.
  • CI: lint-check/test jobs call just typecheck/just test/
    just test-vitest (inside nix develop) instead of pnpm scripts; just
    is added to the dev shell.
  • Docs/skills: AGENTS.md, CONTRIBUTING, package READMEs, the installation
    guide, and the repo-local skills now reference just.

Testing

  • just typecheck (tsgo across both packages) — pass
  • just test (parallel: cargo workspace + Vitest) — pass
  • just fmt (treefmt, 0 changes), oxlint ., oxfmt --check — clean
  • just --dry-run release — expands to typecheck → build → bumpp → checkout

Summary by cubic

Make just the single entry point for dev and release tasks. This removes redundant package.json scripts, standardizes CI, and simplifies the release flow.

  • Refactors

    • Added a root justfile and per-package modules for apps/ccusage, docs, and rust; root aggregates build/typecheck, owns fmt/check/schema, and release.
    • Tests run via just test using [parallel] (Rust + Vitest); just test-vitest runs JS tests only.
    • Command routing: call dev-shell tools directly (cargo, tsgo, nix); use pnpm exec for Node CLIs; delegate pnpm run build only where tools require it.
    • Trimmed scripts in root, apps/ccusage, and docs; kept docs build/dev as they are invoked by name.
    • Release: bump.config.ts calls cargo set-version with operation.state.newVersion; after bump, restore only tracked package.json files via git checkout -- $(git ls-files '*package.json') to avoid touching node_modules.
    • CI uses nix develop --command just typecheck|test|test-vitest; just is included in the dev shell.
  • Migration

    • Use just fmt, just typecheck, just test, just build, just check, and just release instead of pnpm scripts.
    • Use module recipes when needed, e.g. just docs::dev, just docs::build, just ccusage::build, just rust::test.
    • Enter the dev environment with nix develop so just and tools are on PATH; run just --list to see all recipes.

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

Review in cubic

Summary by CodeRabbit

  • New Features

    • Introduced just task runner as the unified entry point for development workflows.
  • Documentation

    • Updated all contributor guides and documentation to use just commands (e.g., just fmt, just test, just typecheck) instead of pnpm scripts.
  • Refactor

    • Migrated development tasks from pnpm scripts to just recipes across root, docs, and apps modules.
    • Simplified CI/CD pipelines to invoke tasks via just.
    • Removed redundant build scripts from package.json files.

ryoppippi added 6 commits June 9, 2026 00:21
just becomes the single task entry point for the repo, so expose its
binary in the pinned development shell.
Introduce a root justfile plus per-package justfiles (apps/ccusage, docs,
rust) imported as just modules, following the arto layout. Root recipes
aggregate the modules (build, typecheck) or own whole-repo nix jobs (fmt,
check, schema) and release.

pnpm policy inside just: call dev-shell tools directly (cargo, tsgo, nix),
use `pnpm exec` for package-scoped node binaries (vitest, vitepress,
wrangler), and delegate `pnpm run build` only where npm prepack and
Cloudflare invoke that script by name.
Call `cargo set-version` directly with operation.state.newVersion instead
of shelling out to the `sync:rust-version` pnpm script via the
$npm_package_version env var. This removes a layer of indirection and lets
the root package.json drop the script entirely.
Remove scripts that are redundant or superseded:
- root: keep only preinstall; build/typecheck/test/lint/format/release moved
  to just, sync:rust-version inlined into bump.config.ts
- apps/ccusage: drop format/lint (treefmt + flake check own these), the
  test cluster (run via just), prerelease (folded into the release recipe),
  and the unused stage:native-package wrapper (CI calls the script directly)
- docs: drop format/lint plus typecheck/preview/deploy (just calls the
  tools directly); keep build/dev since wrangler invokes pnpm run build
Replace the direct pnpm script invocations with the just recipes
(`just typecheck`, `just test`, `just test-vitest`), which now own the
fan-out and run inside the dev shell.
Update AGENTS.md, CONTRIBUTING, the package READMEs, the installation guide,
and the repo-local skills to use `just fmt|typecheck|test` and the
`just <module>::<recipe>` form instead of the removed pnpm scripts.
@pullfrog

pullfrog Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Pullfrog  | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR migrates the repository's task orchestration from npm/pnpm scripts to just recipes as the single entry point. It introduces a root justfile that orchestrates workspace modules, removes scripts from package.json files, updates CI workflows to use just commands, changes Rust version synchronization to invoke cargo directly, and comprehensively updates documentation and contributor guidance across the codebase.

Changes

Just Task Orchestration Migration

Layer / File(s) Summary
Root justfile and Nix integration
justfile, nix/dev-shell.nix
Root justfile imports workspace modules and defines recipes for build, typecheck, test (parallelized with Rust and Vitest), fmt, check, schema generation, and release. Nix dev-shell adds just to buildInputs for hermetic task execution.
Workspace justfile modules
apps/ccusage/justfile, docs/justfile, rust/justfile
Workspace-specific justfiles define recipes (ccusage: build, typecheck; docs: dev, build, typecheck, preview, deploy; rust: test) that are imported and composed by the root justfile.
Package.json script consolidation
package.json, apps/ccusage/package.json, docs/package.json
Root package.json retains only preinstall; ccusage removes build/format/lint/test/typecheck while keeping schema generation and statusline tests; docs removes format/lint/preview/typecheck/deploy while keeping build and dev.
CI workflow command updates
.github/workflows/ci.yaml
Lint and test jobs switch from direct pnpm invocations to nix develop --command just recipes (just typecheck, just test, just test-vitest), preserving existing PR/branch-specific conditionals.
Release automation and version sync
bump.config.ts
Rust version synchronization changed from pnpm run sync:rust-version to direct cargo set-version --manifest-path rust/Cargo.toml --workspace <newVersion> invocation with updated error reporting.
Documentation and contributor guidance updates
.agents/skills/*, AGENTS.md, CONTRIBUTING.md, apps/ccusage/README.md, docs/README.md, docs/guide/installation.md, nix/git-hooks.nix
Comprehensive updates across agent skills, contributing guidelines, and README files to replace pnpm command references with just equivalents (fmt, test, typecheck, build, check, release). Includes updates to PR creation skill examples and git-hooks comments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ryoppippi/ccusage#1077: Modifies apps/ccusage/README.md Nix contributor setup documentation, changing documented check commands from pnpm ... to just ....
  • ryoppippi/ccusage#747: Updates .github/workflows/ci.yaml to switch test/typecheck steps from pnpm commands to Nix-based nix develop execution.
  • ryoppippi/ccusage#1236: Updates AGENTS.md to guide agents on running repo tasks in the Nix/direnv environment.

Suggested reviewers

  • pullfrog

Poem

🐰 Just hops in to simplify,
Pnpm scripts say goodbye!
One recipe to rule them all,
Build, test, fmt—just the call.
Workspace harmony at last! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: consolidating development tasks behind the just task runner as a single entry point, which is precisely what the changeset accomplishes across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/consolidate-tasks-into-just

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 and usage tips.

@cloudflare-workers-and-pages

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

Branch Preview URL
Jun 08 2026, 11:25 PM

Feed git's own tracked file list into the post-bump checkout instead of a
shell glob. `git ls-files '*package.json'` enumerates only version-managed
package.json files, so node_modules copies can never be matched, and the
shell no longer decides what the glob expands to.
@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

ccusage

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

@ccusage/ccusage-darwin-arm64

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

@ccusage/ccusage-darwin-x64

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

@ccusage/ccusage-linux-arm64

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

@ccusage/ccusage-linux-x64

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

@ccusage/ccusage-win32-arm64

npx https://pkg.pr.new/@ccusage/ccusage-win32-arm64@1238

@ccusage/ccusage-win32-x64

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

commit: 133f465

@ryoppippi
ryoppippi merged commit d876efb into main Jun 8, 2026
27 of 28 checks passed
@ryoppippi
ryoppippi deleted the chore/consolidate-tasks-into-just branch June 8, 2026 23:29
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 133f465d93a3
Base SHA: 904e2b7f85b4

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

Package runner startup

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

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new 904e2b7f85b4 965.7ms 446.1ms 30.2ms 3
PR pkg.pr.new 133f465 620.9ms 472.0ms 29.6ms 3

Cached bunx execution performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 541.4ms 534.1ms 1.01x 327.33 MiB 328.20 MiB 1.00x 1.86 GiB/s 1.89 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 368.9ms 367.5ms 1.00x 81.08 MiB 70.45 MiB 0.87x 2.73 GiB/s 2.74 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 538.3ms 1.87 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 511.5ms 1.97 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 356.5ms 2.82 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 338.6ms 2.97 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 27.2ms 28.5ms 0.96x 43.61 MiB 43.61 MiB 1.00x 0.06 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 28.4ms 27.2ms 1.04x 43.61 MiB 43.61 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 27.8ms 27.0ms 1.03x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 27.1ms 27.6ms 0.98x 43.61 MiB 43.73 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, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 549.0ms 534.8ms 1.03x 315.70 MiB 317.95 MiB 1.01x 1.83 GiB/s 1.88 GiB/s
codex --offline --json 1.01 GiB 355.7ms 349.2ms 1.02x 70.83 MiB 75.95 MiB 1.07x 2.83 GiB/s 2.88 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.26 KiB 17.28 KiB +0.02 KiB 1.00x
installed native package binary 3353.74 KiB 3353.74 KiB +0.00 KiB 1.00x

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 133f465d93a3
Base SHA: 904e2b7f85b4

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

Package runner startup

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

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new 904e2b7f85b4 1.068s 824.2ms 29.2ms 3
PR pkg.pr.new 133f465 895.7ms 945.1ms 30.5ms 3

Cached bunx execution performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 550.2ms 550.0ms 1.00x 318.83 MiB 323.20 MiB 1.01x 1.83 GiB/s 1.83 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 368.9ms 370.0ms 1.00x 76.20 MiB 72.33 MiB 0.95x 2.73 GiB/s 2.72 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 541.4ms 1.86 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 511.6ms 1.97 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 362.1ms 2.78 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 332.5ms 3.03 GiB/s 1

Committed fixture performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.7ms 3.9ms 7.39x 43.48 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.40 MiB/s
claude session --offline --json 0.00 MiB 32.2ms 4.2ms 7.66x 43.48 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.37 MiB/s
codex daily --offline --json 0.00 MiB 27.8ms 3.6ms 7.68x 43.61 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s
codex session --offline --json 0.00 MiB 28.0ms 3.6ms 7.87x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 551.6ms 523.5ms 1.05x 330.20 MiB 320.33 MiB 0.97x 1.83 GiB/s 1.92 GiB/s
codex --offline --json 1.01 GiB 355.2ms 329.6ms 1.08x 72.45 MiB 72.20 MiB 1.00x 2.83 GiB/s 3.05 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.26 KiB 17.28 KiB +0.02 KiB 1.00x
installed native package binary 3353.74 KiB 3353.74 KiB +0.00 KiB 1.00x

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: bad2e8d00c26
Base SHA: 904e2b7f85b4

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

Package runner startup

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

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new 904e2b7f85b4 611.1ms 644.1ms 29.5ms 3
PR pkg.pr.new bad2e8d 929.5ms 618.1ms 30.0ms 3

Cached bunx execution performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 551.6ms 542.6ms 1.02x 316.20 MiB 293.45 MiB 0.93x 1.83 GiB/s 1.86 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 363.6ms 367.3ms 0.99x 79.33 MiB 79.70 MiB 1.00x 2.77 GiB/s 2.74 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 560.5ms 1.80 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 522.7ms 1.93 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 363.2ms 2.77 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 333.3ms 3.02 GiB/s 1

Committed fixture performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.0ms 28.1ms 0.99x - 43.61 MiB - 0.06 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 27.8ms 28.0ms 0.99x 43.48 MiB 43.61 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 27.5ms 27.8ms 0.99x 43.48 MiB - - 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 27.8ms 27.7ms 1.00x 43.48 MiB 43.48 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, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 537.4ms 542.5ms 0.99x 318.20 MiB 330.33 MiB 1.04x 1.87 GiB/s 1.86 GiB/s
codex --offline --json 1.01 GiB 357.0ms 353.9ms 1.01x 81.45 MiB 79.83 MiB 0.98x 2.82 GiB/s 2.84 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.26 KiB 17.28 KiB +0.02 KiB 1.00x
installed native package binary 3353.74 KiB 3353.74 KiB +0.00 KiB 1.00x

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: bad2e8d00c26
Base SHA: 904e2b7f85b4

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

Package runner startup

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

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new 904e2b7f85b4 999.6ms 705.5ms 30.9ms 3
PR pkg.pr.new bad2e8d 1.231s 876.4ms 31.9ms 3

Cached bunx execution performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 559.8ms 555.1ms 1.01x 316.20 MiB 317.95 MiB 1.01x 1.80 GiB/s 1.81 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 362.1ms 365.4ms 0.99x 79.33 MiB 72.20 MiB 0.91x 2.78 GiB/s 2.76 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 543.4ms 1.85 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 521.7ms 1.93 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 359.3ms 2.80 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 334.3ms 3.01 GiB/s 1

Committed fixture performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.4ms 4.0ms 7.41x - 2.70 MiB - 0.05 MiB/s 0.39 MiB/s
claude session --offline --json 0.00 MiB 29.6ms 4.0ms 7.35x 43.48 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.38 MiB/s
codex daily --offline --json 0.00 MiB 29.2ms 3.6ms 8.02x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s
codex session --offline --json 0.00 MiB 27.3ms 3.6ms 7.65x 43.61 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 545.9ms 518.8ms 1.05x 316.83 MiB 283.70 MiB 0.90x 1.84 GiB/s 1.94 GiB/s
codex --offline --json 1.01 GiB 357.1ms 330.0ms 1.08x - 64.45 MiB - 2.82 GiB/s 3.05 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.26 KiB 17.28 KiB +0.02 KiB 1.00x
installed native package binary 3353.74 KiB 3353.74 KiB +0.00 KiB 1.00x

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant