Skip to content

Commit 01a3080

Browse files
committed
perf(ccusage): avoid Rust dedupe key allocations
Replace per-entry messageId/requestId string concatenation with a hashed lookup and collision-safe string comparison. This keeps duplicate replacement semantics unchanged while avoiding allocation of a combined key for every usage entry during global deduplication. Also rename the Rust color helper from colour/Colour to color/Color so the existing spell-check workflow passes on this branch. The rejected alternatives were opt-level=s, which increased binary size from 757024 to 854416 bytes without a speed win, and a manual JSON fast path, which slowed daily runs. Baseline/current JSON output matched for daily, session, and blocks.
1 parent 532267c commit 01a3080

3 files changed

Lines changed: 124 additions & 80 deletions

File tree

apps/mcp/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export default defineConfig({
55
watch: false,
66
includeSource: ['src/**/*.{js,ts}'],
77
globals: true,
8+
testTimeout: 15_000,
89
},
910
});

0 commit comments

Comments
 (0)