Skip to content

build: add publint flake check - #1312

Merged
ryoppippi merged 6 commits into
mainfrom
codex/add-publint-flake-check
Jun 13, 2026
Merged

ryoppippi merged 6 commits into
mainfrom
codex/add-publint-flake-check

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 13, 2026 •

Copy link
Copy Markdown
Member

Packages publint through Nix and adds a flake check that runs publint across every package.json in the workspace. Removes clean-pkg-json from package scripts and lockfile now that the manifests only need publint validation. Validated with nix build .#publint, nix build .#checks.aarch64-darwin.publint, nix develop --ignore-environment --command publint --version, nix fmt, and git diff --cached --check.


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


Summary by cubic

Package publint via Nix and add a flake check that runs it across every workspace package to validate publish metadata without a full build. Remove clean-pkg-json, switch scripts to the Nix-provided publint, and allow the sade package name in typos config.

  • New Features

    • Nix package for publint built from a small synthetic pnpm project (independent of the workspace lockfile); available in the dev shell and as a flake check; wrapper adds node to PATH.
    • Flake check scans all package.json files, seeds placeholder binaries for native packages, and runs publint per package root without packing.
  • Refactors

    • Remove clean-pkg-json from scripts and workspace catalogs; lockfile entries pruned.
    • Use Nix publint in just/package scripts and dev shell; dev shell no longer auto-runs pnpm install (run pnpm install --frozen-lockfile when needed).
    • Add sade to typos.toml to avoid false rewrites.

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

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a package validation tool to the dev environment and wired it as an automated repo check.
  • Documentation

    • Clarified contributor setup and development installation to list available tooling (including the pinned package manager) and when to run pnpm install.
  • Chores

    • Simplified build/prepack flows across packages, removed redundant cleaning steps and related devDependency entries.
    • Whitelisted a new word in the typo checker.

Package publint through Nix using the repository pnpm lockfile so the dev shell and flake checks do not depend on a local pnpm install for this tool.

Remove clean-pkg-json from package scripts and workspace dependencies because the package manifests now only need publint validation before publish. The new flake check enumerates every package.json and runs publint for each package root, seeding placeholder files for generated publish artifacts so metadata checks can run without a full package build.
…ke-check

# Conflicts:
#	apps/ccusage/package.json
#	justfile
@pullfrog

pullfrog Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

no API key found — this repo is configured to use deepseek/deepseek-v4-pro, which needs DEEPSEEK_API_KEY, but the runner has no key for it.

To fix: add the key as a GitHub Actions secret (referenced from your workflow's env: block) or as a Pullfrog secret in the console — or switch this repo to a different model (free models need no key).

Open repo secrets → · Configure model → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Jun 13, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0db924fb-b573-411e-950d-5b9a34aba3a8

📥 Commits

Reviewing files that changed from the base of the PR and between e351fee and b486a97.

📒 Files selected for processing (1)
  • typos.toml
✅ Files skipped from review due to trivial changes (1)
  • typos.toml

📝 Walkthrough

Walkthrough

Packages publint in Nix, adds it to the dev shell and repo checks, removes the workspace clean-pkg-json usage from prepack/build scripts in favor of calling publint directly, and updates docs/comments to clarify pnpm and dev-shell tool usage.

Changes

Publint Integration and clean-pkg-json Removal

Layer / File(s) Summary
Create publint Nix package
nix/publint.nix, nix/packages.nix
publint 0.3.12 packaged as a Nix derivation by generating a minimal pnpm source, resolving deps with fetchPnpmDeps, copying node_modules into the output, and exposing $out/bin/publint. Exported via nix/packages.nix.
Integrate publint into dev shell and checks
nix/dev-shell.nix, nix/checks.nix
Dev shell buildInputs includes publint; removed the conditional pnpm install --frozen-lockfile from shellHook. New repo check discovers repository package.json files, materializes expected files placeholders, and runs publint run <pkg> --pack false per package.
Remove clean-pkg-json and use publint directly
apps/ccusage/justfile, apps/ccusage/package.json, packages/ccusage-*/*.json, pnpm-workspace.yaml
All prepack scripts drop clean-pkg-json and invoke publint (or just build-package which runs publint); build-package now runs publint directly; clean-pkg-json removed from pnpm workspace catalog and package devDependencies where applicable.
Update documentation and build comments
justfile, apps/ccusage/README.md, docs/guide/installation.md, typos.toml
Root justfile clarifies pnpm/Nix tool invocation policy. apps/ccusage/README.md and installation docs note dev-shell provides pinned pnpm and other tooling and specify when to run pnpm install --frozen-lockfile. typos.toml adds an allowlist entry.

Sequence Diagram(s)

No sequence diagrams generated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ccusage/ccusage#1254: Touches nix/dev-shell.nix shellHook and pnpm install logic overlapping with this PR.
  • ccusage/ccusage#1310: Both PRs modify apps/ccusage build/packaging flows around publint and prepack behavior.

Suggested reviewers

  • pullfrog

Poem

🐰 I hopped a tiny wrapper into bin,
Nix fetched publint, tidy as a pin.
Clean-pkg waved off, prepack trims its tail,
Dev-shell keeps pnpm — install when tasks will fail.
Carrots, checks, and builds in a jaunty rail.

🚥 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 PR title 'build: add publint flake check' accurately describes the main objective: adding a new publint flake check to the build system.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-publint-flake-check

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

@cloudflare-workers-and-pages

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

Branch Preview URL
Jun 13 2026, 12:52 PM

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

ccusage

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

@ccusage/ccusage-darwin-arm64

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

@ccusage/ccusage-darwin-x64

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

@ccusage/ccusage-linux-arm64

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

@ccusage/ccusage-linux-x64

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

@ccusage/ccusage-win32-x64

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

commit: b486a97

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found and verified against the latest diff

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

Fix all with cubic | Re-trigger cubic

Comment thread nix/publint.nix Outdated
Comment thread nix/checks.nix Outdated
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 7be9495d70c9
Base SHA: 27315d2ec758

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 254.2ms 3.96 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 215.3ms 4.68 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 100.9ms 9.98 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 78.7ms 12.79 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 23.1ms 3.5ms 6.51x 53.50 MiB 12.21 MiB 0.23x 0.07 MiB/s 0.44 MiB/s
claude session --offline --json 0.00 MiB 26.4ms 2.3ms 11.67x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.68 MiB/s
codex daily --offline --json 0.00 MiB 22.8ms 2.0ms 11.21x 53.50 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.42 MiB/s
codex session --offline --json 0.00 MiB 24.6ms 2.0ms 12.00x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.42 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 255.9ms 210.3ms 1.22x 936.33 MiB 932.33 MiB 1.00x 3.93 GiB/s 4.79 GiB/s
codex --offline --json 1.01 GiB 99.5ms 81.1ms 1.23x 409.04 MiB 419.04 MiB 1.02x 10.11 GiB/s 12.41 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 1.00x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 7be9495d70c9
Base SHA: 27315d2ec758

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 232.8ms 4.32 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 212.2ms 4.75 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 100.8ms 9.98 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 81.4ms 12.36 GiB/s 1

Committed fixture performance

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

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs 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.8ms 24.0ms 1.03x 53.75 MiB 54.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 24.9ms 25.5ms 0.98x 53.50 MiB 53.50 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 22.8ms 25.2ms 0.91x 53.75 MiB 53.50 MiB 1.00x 0.04 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 22.1ms 22.7ms 0.98x 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 261.2ms 245.4ms 1.06x 938.33 MiB 928.33 MiB 0.99x 3.85 GiB/s 4.10 GiB/s
codex --offline --json 1.01 GiB 99.1ms 101.9ms 0.97x 417.04 MiB 427.05 MiB 1.02x 10.16 GiB/s 9.88 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 1.00x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@pullfrog

pullfrog Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

no API key found — this repo is configured to use deepseek/deepseek-v4-pro, which needs DEEPSEEK_API_KEY, but the runner has no key for it.

To fix: add the key as a GitHub Actions secret (referenced from your workflow's env: block) or as a Pullfrog secret in the console — or switch this repo to a different model (free models need no key).

Open repo secrets → · Configure model → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 89ddc392ef34
Base SHA: 27315d2ec758

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 248.4ms 4.05 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 217.6ms 4.63 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 100.3ms 10.04 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 78.6ms 12.81 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.3ms 3.5ms 6.88x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.44 MiB/s
claude session --offline --json 0.00 MiB 26.0ms 2.4ms 10.97x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.65 MiB/s
codex daily --offline --json 0.00 MiB 22.9ms 2.1ms 11.06x 53.50 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.41 MiB/s
codex session --offline --json 0.00 MiB 24.2ms 2.0ms 12.05x 53.75 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.43 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 258.8ms 223.1ms 1.16x 952.33 MiB 932.33 MiB 0.98x 3.89 GiB/s 4.51 GiB/s
codex --offline --json 1.01 GiB 105.1ms 82.1ms 1.28x 425.04 MiB 415.04 MiB 0.98x 9.58 GiB/s 12.27 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 1.00x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 89ddc392ef34
Base SHA: 27315d2ec758

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 226.1ms 4.45 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 195.0ms 5.16 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 120.3ms 8.37 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 94.8ms 10.62 GiB/s 1

Committed fixture performance

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

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

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.3ms 30.0ms 0.98x 53.75 MiB 54.00 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 30.2ms 28.5ms 1.06x 53.50 MiB 53.75 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 26.1ms 28.1ms 0.93x 53.75 MiB 53.75 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 27.3ms 26.5ms 1.03x 53.75 MiB 54.00 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 248.8ms 241.8ms 1.03x 958.34 MiB 916.33 MiB 0.96x 4.05 GiB/s 4.16 GiB/s
codex --offline --json 1.01 GiB 111.1ms 113.0ms 0.98x 423.04 MiB 405.04 MiB 0.96x 9.06 GiB/s 8.91 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 1.00x
installed native package binary 3837.94 KiB 3837.94 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.

Build the Nix publint tool from a synthetic pnpm project instead of the repository workspace manifests and lockfile. This keeps the tool package independent from apps/ccusage/package.json while still using pnpm to fetch and install publint.
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 70f1ccdc4512
Base SHA: 27315d2ec758

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 244.7ms 4.11 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 211.1ms 4.77 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 101.0ms 9.97 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 79.8ms 12.62 GiB/s 1

Committed fixture performance

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

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published 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.89x 53.50 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.37 MiB/s
claude session --offline --json 0.00 MiB 27.8ms 2.5ms 11.33x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.63 MiB/s
codex daily --offline --json 0.00 MiB 24.7ms 2.1ms 11.92x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.41 MiB/s
codex session --offline --json 0.00 MiB 22.5ms 2.1ms 10.85x 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 270.0ms 219.0ms 1.23x 942.33 MiB 946.33 MiB 1.00x 3.73 GiB/s 4.60 GiB/s
codex --offline --json 1.01 GiB 101.7ms 81.9ms 1.24x 409.04 MiB 407.04 MiB 1.00x 9.90 GiB/s 12.29 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 0.99x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 70f1ccdc4512
Base SHA: 27315d2ec758

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 256.2ms 3.93 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 233.4ms 4.31 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 103.9ms 9.69 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 96.5ms 10.43 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 24.8ms 0.98x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 26.6ms 24.9ms 1.07x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 22.7ms 22.1ms 1.02x 53.50 MiB 54.00 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 23.4ms 22.3ms 1.05x 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 266.6ms 251.1ms 1.06x 924.32 MiB 914.33 MiB 0.99x 3.78 GiB/s 4.01 GiB/s
codex --offline --json 1.01 GiB 104.5ms 105.9ms 0.99x 441.04 MiB 421.04 MiB 0.95x 9.64 GiB/s 9.51 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 0.99x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
nix/checks.nix (1)

140-181: ⚠️ Potential issue | 🟡 Minor

Limit publint inputs to pnpm workspace packages (exclude repo root package.json)

fd --type f '^package\.json$' . matches ./package.json (repo root) in addition to the pnpm workspace globs (apps/*, docs, packages/*). If CI is intended to lint only workspace package roots, filter packageManifests to those globs (or explicitly exclude the repo root) before running publint.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nix/checks.nix` around lines 140 - 181, The package discovery currently
collects the repo root package.json because mapfile into packageManifests uses
fd --type f '^package\.json$' ., so update the discovery to only include
workspace package roots (or explicitly drop the repo root) before running
publint: either change the fd invocation to search only the workspace globs
(e.g., restrict to apps/*, docs, packages/*) or post-filter the packageManifests
array to remove "./package.json" (or the repo-root path); ensure the rest of the
script (the for loop iterating packageManifests and the publint run
"$packageDir" --pack false invocation) remains unchanged so generatedArtifacts
handling and touchGeneratedFile behavior still apply.
🧹 Nitpick comments (1)
nix/checks.nix (1)

146-173: ⚡ Quick win

Derive placeholder executables from each manifest instead of package-name switches.

generatedArtifacts duplicates the publish contract that already lives in package.json, so a package rename or bin path change now needs a second edit here or CI starts failing. Reading bin from the manifest keeps the check aligned automatically.

♻️ Suggested direction
-              const generatedArtifacts = new Map([
-                ["`@ccusage/ccusage-darwin-arm64`", ["bin/ccusage"]],
-                ["`@ccusage/ccusage-darwin-x64`", ["bin/ccusage"]],
-                ["`@ccusage/ccusage-linux-arm64`", ["bin/ccusage"]],
-                ["`@ccusage/ccusage-linux-x64`", ["bin/ccusage"]],
-                ["`@ccusage/ccusage-win32-arm64`", ["bin/ccusage.exe"]],
-                ["`@ccusage/ccusage-win32-x64`", ["bin/ccusage.exe"]],
-              ]);
+              function manifestBinPaths(packageJson) {
+                if (typeof packageJson.bin === "string") {
+                  return [packageJson.bin];
+                }
+
+                if (packageJson.bin && typeof packageJson.bin === "object") {
+                  return Object.values(packageJson.bin);
+                }
+
+                return [];
+              }

               function touchGeneratedFile(packageDir, relativePath) {
                 const targetPath = path.join(packageDir, relativePath);
                 fs.mkdirSync(path.dirname(targetPath), { recursive: true });
                 if (!fs.existsSync(targetPath)) {
                   fs.writeFileSync(targetPath, "");
                 }
                 if (!relativePath.endsWith(".exe")) {
                   fs.chmodSync(targetPath, 0o755);
                 }
               }

               for (const manifestPath of process.argv.slice(2)) {
                 const packageDir = path.dirname(manifestPath);
                 const packageJson = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
                 const files = new Set(packageJson.files ?? []);
-                for (const relativePath of generatedArtifacts.get(packageJson.name) ?? []) {
-                  if (files.has(relativePath)) {
+                for (const relativePath of manifestBinPaths(packageJson)) {
+                  if (files.size === 0 || files.has(relativePath)) {
                     touchGeneratedFile(packageDir, relativePath);
                   }
                 }
               }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nix/checks.nix` around lines 146 - 173, The code currently hardcodes
generatedArtifacts and duplicates the package.json publish contract; replace
that with logic that reads packageJson.bin from each manifest and derives the
relative executable paths dynamically. In the loop that processes each
manifestPath (the block using packageDir, packageJson and files), remove the
generatedArtifacts.get(...) lookup and instead: inspect packageJson.bin (handle
string form and object form), collect the bin target paths (the values when bin
is an object, or the single string when bin is a string), then for each derived
relativePath call touchGeneratedFile(packageDir, relativePath) only if
files.has(relativePath) (same gating as before). Keep touchGeneratedFile and its
chmod behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@nix/checks.nix`:
- Around line 140-181: The package discovery currently collects the repo root
package.json because mapfile into packageManifests uses fd --type f
'^package\.json$' ., so update the discovery to only include workspace package
roots (or explicitly drop the repo root) before running publint: either change
the fd invocation to search only the workspace globs (e.g., restrict to apps/*,
docs, packages/*) or post-filter the packageManifests array to remove
"./package.json" (or the repo-root path); ensure the rest of the script (the for
loop iterating packageManifests and the publint run "$packageDir" --pack false
invocation) remains unchanged so generatedArtifacts handling and
touchGeneratedFile behavior still apply.

---

Nitpick comments:
In `@nix/checks.nix`:
- Around line 146-173: The code currently hardcodes generatedArtifacts and
duplicates the package.json publish contract; replace that with logic that reads
packageJson.bin from each manifest and derives the relative executable paths
dynamically. In the loop that processes each manifestPath (the block using
packageDir, packageJson and files), remove the generatedArtifacts.get(...)
lookup and instead: inspect packageJson.bin (handle string form and object
form), collect the bin target paths (the values when bin is an object, or the
single string when bin is a string), then for each derived relativePath call
touchGeneratedFile(packageDir, relativePath) only if files.has(relativePath)
(same gating as before). Keep touchGeneratedFile and its chmod behavior
unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 336405f6-c79a-434b-aa58-8c81d9c9f263

📥 Commits

Reviewing files that changed from the base of the PR and between 70f1ccd and e351fee.

📒 Files selected for processing (3)
  • nix/checks.nix
  • nix/packages.nix
  • nix/publint.nix

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: e351feebc586
Base SHA: 27315d2ec758

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 253.9ms 3.96 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 214.2ms 4.70 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 103.3ms 9.75 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 98.2ms 10.26 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.9ms 23.7ms 1.05x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.07 MiB/s
claude session --offline --json 0.00 MiB 24.2ms 26.3ms 0.92x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 23.7ms 23.2ms 1.02x 53.75 MiB 53.50 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 23.3ms 22.8ms 1.02x 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 269.5ms 250.8ms 1.07x 944.34 MiB 958.34 MiB 1.01x 3.74 GiB/s 4.01 GiB/s
codex --offline --json 1.01 GiB 104.8ms 104.3ms 1.00x 437.04 MiB 435.04 MiB 1.00x 9.61 GiB/s 9.65 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 0.99x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: e351feebc586
Base SHA: 27315d2ec758

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 224.0ms 4.49 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 199.3ms 5.05 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 121.6ms 8.28 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 112.8ms 8.92 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.6ms 5.0ms 5.95x 53.50 MiB 10.20 MiB 0.19x 0.05 MiB/s 0.31 MiB/s
claude session --offline --json 0.00 MiB 29.8ms 4.1ms 7.32x 53.75 MiB 10.20 MiB 0.19x 0.05 MiB/s 0.38 MiB/s
codex daily --offline --json 0.00 MiB 28.6ms 3.8ms 7.58x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.23 MiB/s
codex session --offline --json 0.00 MiB 28.2ms 2.8ms 10.20x 53.75 MiB 8.19 MiB 0.15x 0.03 MiB/s 0.31 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 258.8ms 215.4ms 1.20x 930.33 MiB 938.33 MiB 1.01x 3.89 GiB/s 4.67 GiB/s
codex --offline --json 1.01 GiB 111.7ms 91.9ms 1.21x 415.04 MiB 403.04 MiB 0.97x 9.02 GiB/s 10.95 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 0.99x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: b486a9717588
Base SHA: 27315d2ec758

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 239.7ms 4.20 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 214.2ms 4.70 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 97.0ms 10.38 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 77.7ms 12.96 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.4ms 3.9ms 6.96x 54.00 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.39 MiB/s
claude session --offline --json 0.00 MiB 24.0ms 2.3ms 10.32x 53.75 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.66 MiB/s
codex daily --offline --json 0.00 MiB 21.9ms 2.0ms 10.95x 53.50 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.43 MiB/s
codex session --offline --json 0.00 MiB 21.9ms 2.1ms 10.61x 53.50 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 257.5ms 222.1ms 1.16x 954.34 MiB 958.33 MiB 1.00x 3.91 GiB/s 4.53 GiB/s
codex --offline --json 1.01 GiB 100.6ms 81.0ms 1.24x 411.04 MiB 423.04 MiB 1.03x 10.01 GiB/s 12.42 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 1.00x
installed native package binary 3837.94 KiB 3837.94 KiB +0.00 KiB 1.00x

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

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: b486a9717588
Base SHA: 27315d2ec758

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 222.4ms 4.53 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 200.8ms 5.01 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 119.3ms 8.44 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.6ms 10.76 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.8ms 27.6ms 1.12x 54.00 MiB 53.75 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 29.5ms 31.4ms 0.94x 53.75 MiB 53.75 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 28.3ms 28.8ms 0.98x 53.75 MiB 53.75 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 28.3ms 27.6ms 1.03x 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 254.2ms 238.9ms 1.06x 942.33 MiB 952.33 MiB 1.01x 3.96 GiB/s 4.21 GiB/s
codex --offline --json 1.01 GiB 110.6ms 116.7ms 0.95x 405.04 MiB 403.03 MiB 1.00x 9.11 GiB/s 8.62 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.99 KiB 18.08 KiB +0.09 KiB 1.00x
installed native package binary 3837.94 KiB 3837.94 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