Skip to content

build(ccusage): ship launcher without tsdown - #1310

Merged
ryoppippi merged 2 commits into
mainfrom
codex/remove-tsdown-launcher-build
Jun 13, 2026
Merged

ryoppippi merged 2 commits into
mainfrom
codex/remove-tsdown-launcher-build

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 13, 2026 •

Copy link
Copy Markdown
Member

Removes the tsdown build step from the published ccusage package by shipping the npm launcher as checked ESM JavaScript at src/cli.js.

The package bin now points directly at src/cli.js, package checks still verify the native binary glue with Nushell and publint, and the unused tsdown build catalog/lockfile entries are removed.

Size note: the launcher grows from 2,146 B minified / 976 B gzip to 5,330 B source / 1,572 B gzip. The packed npm tarball measured 18,390 B, about +0.6 KiB versus the previous PR measurement.

Testing:

  • pnpm install --frozen-lockfile
  • just fmt
  • just typecheck
  • just test-node
  • pnpm --filter ./apps/ccusage run build
  • actionlint
  • node --check apps/ccusage/src/cli.js
  • node_modules/.bin symlink smoke test against Claude fixture JSON
  • just test
  • nix flake check --print-build-logs

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


Summary by cubic

Publish the ccusage CLI without tsdown by shipping a checked ESM launcher at src/cli.js and pointing bin to it. Also route the root check through Nix flake and drop the extra CI typecheck.

  • Refactors
    • Rewrote the launcher to JSDoc-checked ESM (src/cli.js); updated tests and docs to .js.
    • Updated package.json: bin → src/cli.js, files include src/cli.js; removed publishConfig.
    • Simplified package build: removed tsdown, added publint; build now only verifies the native binary. Removed tsdown config and catalog/lockfile entries.
    • CI and checks: just check now calls nix flake check; removed duplicate CI typecheck step.

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

Review in cubic

Summary by CodeRabbit

  • Documentation

    • Updated package docs to reference the correct published CLI entry point.
  • Chores

    • Streamlined build and packaging: packaging now sources the CLI artifact directly and removed an intermediate bundler step.
    • Simplified CI and local build recipes to skip a separate typecheck step and rely on flake checks; updated workspace metadata to match the revised toolchain.

Rewrite the npm bin launcher as checked ESM JavaScript so the package can ship src/cli.js directly instead of compiling src/cli.ts into dist/cli.js with tsdown.

Point package metadata and tests at the source launcher, keep the native binary and publint checks in the build script, and remove the now-unused tsdown build catalog entries from the workspace lockfile.
@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) | 𝕏

@ryoppippi

Copy link
Copy Markdown
Member Author

@coderabbitai review
@cubic-dev-ai review

@coderabbitai

coderabbitai Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d9d1915e-c3b8-455b-8784-a0e3ba21cdda

📥 Commits

Reviewing files that changed from the base of the PR and between 8be25ae and cbf7217.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • justfile
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yaml

📝 Walkthrough

Walkthrough

The PR migrates the ccusage CLI from TypeScript-based bundling with tsdown to direct JavaScript source publication with JSDoc type annotations. The package now publishes from src/cli.js instead of a dist/ directory, and the build pipeline no longer requires TypeScript compilation or bundler configuration.

Changes

ccusage CLI: TypeScript to JavaScript and direct source publication

Layer / File(s) Summary
CLI source: TypeScript to JavaScript with JSDoc types
apps/ccusage/src/cli.js
Conversion of src/cli.js from TypeScript annotations to JavaScript with // @ts-check`` and JSDoc @typedef/function docs; runtime logic, exports, parameter defaults, and behavior are preserved.
Package metadata and publishing configuration
apps/ccusage/package.json, apps/ccusage/AGENTS.md
Bin entrypoint changed from ./dist/cli.js to ./src/cli.js; files whitelist updated to include src/cli.js; build script now runs scripts/ensure-native-binary.nu && publint (removing tsdown); tsdown removed from devDependencies; publishConfig removed; AGENTS.md updated to reference src/cli.js.
Build pipeline and dependency cleanup
apps/ccusage/justfile, pnpm-workspace.yaml, justfile
build-package recipe removed pnpm exec tsdown and now runs just ensure-native-binary then pnpm exec publint; the build catalog block was removed from pnpm-workspace.yaml; root justfile comments were updated to remove mention of tsdown.
Test and CI / docs alignment
apps/ccusage/src/cli.test.ts, .github/workflows/ci.yaml
Tests import ./cli.js and update symlink/main-module assertions to reference src/cli.js; .github/workflows/ci.yaml removed nix develop --command just typecheck from the check job and clarified a comment in the npm-publish-dry-run-and-upload-pkg-pr-now job about dev-shell necessity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • ccusage/ccusage#1256: Changes invoking the native-binary gate (just ensure-native-binary) and related portability checks for ccusage packaging.
  • ccusage/ccusage#1257: Overlaps on package.json build/publish pipeline changes and CI adjustments.
  • ccusage/ccusage#1258: Related CI edits that reduce or remove nix develop usage in workflow jobs.

Suggested reviewers

  • pullfrog

Poem

🐰 The bundler hops away at last,
From TypeScript chains of the distant past,
JSDoc types now light the way,
Direct from source—no compile delay!
A simpler build, a swifter flight, ✨

🚥 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 clearly and concisely summarizes the main change: removing tsdown from the ccusage launcher build process and shipping the launcher as native JavaScript instead.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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/remove-tsdown-launcher-build

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

@cubic-dev-ai

cubic-dev-ai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review
@cubic-dev-ai review

@ryoppippi I have started the AI code review. It will take a few minutes to complete.

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

Branch Preview URL
Jun 13 2026, 11:52 AM

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== PR Details ==="
gh pr view 1310 --repo ccusage/ccusage --json title,body,files,baseRefName,headRefName

echo ""
echo "=== PR Files ==="
gh pr diff 1310 --repo ccusage/ccusage

Length of output: 43752



@ryoppippi This is a clean and well-executed simplification. Here's my review:

Summary

The PR removes the tsdown build step and ships src/cli.js directly as the published ESM launcher. No functional logic changes — this is purely a build pipeline simplification.

What looks good ✅

TypeScript → JSDoc migration (src/cli.js)

  • // @ts-check`` at the top preserves full TypeScript checking via the language server/tsc
  • All type aliases correctly converted to @typedef, @param, and @returns JSDoc annotations
  • NodeJS.Signals in the NativeSpawnResult typedef works fine since @types/node remains a devDependency

package.json changes

  • publishConfig.bin override correctly removed — bin: "./src/cli.js" now directly points to the published file
  • files array updated to include src/cli.js instead of dist/**/*.js
  • prepack still runs clean-pkg-json, stripping dev fields before publish

Build ordering

  • New build order (ensure-native-binary → publint) makes sense: verify the binary exists before linting the package structure

Lockfile / workspace catalog cleanup

  • Consistent and complete: [email protected], rolldown-plugin-dts, @babel/[email protected], and all related packages are properly pruned
  • The removed build catalog entries (@oxc-project/runtime, unplugin-macros, unplugin-unused) were tsdown transitive/peer deps with no other consumers

Test updates

  • Import path change ./cli.ts → ./cli.js and module URL dist/cli.js → src/cli.js are both correct

Minor observation

The size increase (976B → 1,572B gzip, +0.6KiB in the tarball) is well within acceptable range for a CLI launcher, and the PR description already calls it out. The trade-off of dropping the entire rolldown/tsdown dependency tree for ~596B of extra gzip is clearly worth it.

No issues found. The change is straightforward and all the pieces are consistent with each other.

[approve]

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

@ccusage/ccusage-darwin-arm64

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

@ccusage/ccusage-darwin-x64

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

@ccusage/ccusage-linux-arm64

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

@ccusage/ccusage-linux-x64

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

@ccusage/ccusage-win32-x64

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

commit: cbf7217

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 8be25ae88aa7
Base SHA: ed48f25e7a0a

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 245.3ms 4.10 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 215.2ms 4.68 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 97.7ms 10.30 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 78.9ms 12.75 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.4ms 1.02x 53.75 MiB 54.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 24.6ms 23.1ms 1.06x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.07 MiB/s
codex daily --offline --json 0.00 MiB 23.1ms 23.4ms 0.99x 53.75 MiB 53.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 22.0ms 23.2ms 0.95x 53.50 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 257.5ms 238.2ms 1.08x 924.33 MiB 952.34 MiB 1.03x 3.91 GiB/s 4.23 GiB/s
codex --offline --json 1.01 GiB 99.1ms 101.1ms 0.98x 419.03 MiB 433.03 MiB 1.03x 10.16 GiB/s 9.96 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.43 KiB 17.99 KiB +0.56 KiB 0.97x
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: 8be25ae88aa7
Base SHA: ed48f25e7a0a

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 261.9ms 3.84 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 220.5ms 4.57 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 79.7ms 12.63 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.1ms 4.1ms 6.32x 53.50 MiB 10.21 MiB 0.19x 0.06 MiB/s 0.37 MiB/s
claude session --offline --json 0.00 MiB 25.0ms 3.0ms 8.45x 53.50 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.52 MiB/s
codex daily --offline --json 0.00 MiB 22.7ms 2.2ms 10.46x 53.75 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.40 MiB/s
codex session --offline --json 0.00 MiB 24.6ms 2.1ms 11.59x 53.50 MiB 8.19 MiB 0.15x 0.03 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 264.2ms 223.8ms 1.18x 956.33 MiB 926.33 MiB 0.97x 3.81 GiB/s 4.50 GiB/s
codex --offline --json 1.01 GiB 103.5ms 78.4ms 1.32x 409.04 MiB 417.04 MiB 1.02x 9.73 GiB/s 12.84 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.43 KiB 17.99 KiB +0.56 KiB 0.97x
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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 10 files

Re-trigger cubic

Make the root check recipe delegate directly to nix flake check now that oxlint and the other repository checks are already modeled as flake checks.

Drop the extra CI just typecheck invocation from the check job so pull requests do not run the same oxlint pass twice.
@ryoppippi

Copy link
Copy Markdown
Member Author

@coderabbitai review
@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review
@cubic-dev-ai review

@ryoppippi I have started the AI code review. It will take a few minutes to complete.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

@ryoppippi Sure, I'll re-run the review on this PR!

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 10 files

Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: cbf72178078b
Base SHA: ed48f25e7a0a

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 245.3ms 4.10 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 218.8ms 4.60 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 103.0ms 9.78 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 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.4ms 4.2ms 5.83x 53.50 MiB 10.20 MiB 0.19x 0.06 MiB/s 0.37 MiB/s
claude session --offline --json 0.00 MiB 23.9ms 2.6ms 9.25x 53.50 MiB 10.21 MiB 0.19x 0.06 MiB/s 0.60 MiB/s
codex daily --offline --json 0.00 MiB 24.3ms 2.1ms 11.39x 53.75 MiB 8.19 MiB 0.15x 0.04 MiB/s 0.40 MiB/s
codex session --offline --json 0.00 MiB 24.8ms 2.2ms 11.27x 53.50 MiB 8.19 MiB 0.15x 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 257.9ms 226.9ms 1.14x 948.34 MiB 948.34 MiB 1.00x 3.90 GiB/s 4.44 GiB/s
codex --offline --json 1.01 GiB 102.7ms 81.5ms 1.26x 415.04 MiB 405.04 MiB 0.98x 9.81 GiB/s 12.35 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.43 KiB 17.99 KiB +0.56 KiB 0.97x
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: cbf72178078b
Base SHA: ed48f25e7a0a

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 260.5ms 3.86 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 225.8ms 4.46 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 107.3ms 9.39 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 86.5ms 11.63 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.9ms 24.3ms 1.06x 53.75 MiB 53.75 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 23.4ms 25.1ms 0.93x 53.50 MiB 53.75 MiB 1.00x 0.07 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 23.8ms 22.4ms 1.06x 53.50 MiB 53.25 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 22.8ms 22.1ms 1.03x 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 257.4ms 1.04x 942.33 MiB 932.34 MiB 0.99x 3.78 GiB/s 3.91 GiB/s
codex --offline --json 1.01 GiB 102.2ms 109.6ms 0.93x 431.04 MiB 429.04 MiB 1.00x 9.85 GiB/s 9.19 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.43 KiB 17.99 KiB +0.56 KiB 0.97x
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.

@ryoppippi
ryoppippi merged commit 27315d2 into main Jun 13, 2026
33 checks passed
@ryoppippi
ryoppippi deleted the codex/remove-tsdown-launcher-build branch June 13, 2026 12:16
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