Skip to content

feat(log): category-toggleable debug log infrastructure#1685

Merged
ohah merged 1 commit into
mainfrom
feat-debug-log-infrastructure
Apr 21, 2026
Merged

feat(log): category-toggleable debug log infrastructure#1685
ohah merged 1 commit into
mainfrom
feat-debug-log-infrastructure

Conversation

@ohah
Copy link
Copy Markdown
Owner

@ohah ohah commented Apr 21, 2026

Summary

ZTS_DEBUG env 또는 NAPI `BundleOptions.debug` 로 카테고리별 진단 로그 토글하는 경량 인프라. 첫 사용처는 `compiled_cache` (RFC #1672 B2). 비활성 카테고리는 단일 `u64` AND 분기 후 즉시 리턴 → hot path 영향 없음.

배경: B2 실측용 `std.debug.print` 가 f6b2e66 로 main 에 그대로 남아 production 에서 noise. #1684 가 print 만 제거하는 hotfix였는데, 이 PR 이 더 근본적으로 print 제거 + 영구 진단 인프라로 격상.

활성화

# env (쉼표 구분, 공백/대소문자 무시)
ZTS_DEBUG=compiled_cache bun run bungae:start

# NAPI
build({ entryPoints: [...], debug: ['compiled_cache'] })

둘 다 합집합. 알 수 없는 이름은 silent ignore.

출력 형식

[<category>] key=value ...

예:

[compiled_cache] first=false hits=3 misses=1 no_mtime_skipped=0 (entries=4)

변경

신규

  • `src/debug_log.zig` (~100 LOC): `Category` enum, `enabled_mask: u64` 전역, `enabled` / `print` / `addFromCsv` / `addCategories` / `initFromEnv` / `resetForTest` + 4 unit tests
  • `docs/DEBUG.md` — 사용법/카테고리/형식/확장 방향

수정

  • `src/root.zig` — `pub const debug_log` re-export
  • `src/main.zig` — CLI 진입 시 1회 `initFromEnv`
  • `packages/core/src/napi_entry.zig` — NAPI register 1회 init + `parseBuildOptions` 에 `debug: string[]` 파싱
  • `src/bundler/bundler.zig` — `BundleOptions.debug: []const []const u8` 필드, `Bundler.init` 에서 `addCategories` 호출
  • `src/bundler/incremental.zig` — `std.debug.print` 제거, `debug_log.print(.compiled_cache, ...)` 로 교체
  • `packages/wasm/src/wasm_entry.zig` — transpile-only 라 initFromEnv 생략 (주석 명시)
  • `CLAUDE.md` — DEBUG.md 링크 추가

Supersedes

#1684 (debug print noise hotfix) — 이 PR 이 동일 문제를 더 근본적으로 해결. 머지 후 #1684 close.

Test plan

  • `zig build test` 3298 tests EXIT=0
  • `zig build napi` EXIT=0
  • 리뷰어: 번개에서 `ZTS_DEBUG=compiled_cache bun run bungae:start` → HMR 파일 수정 시 `[compiled_cache] hits=... misses=...` stderr 출력 확인

후속

ZTS_DEBUG env 또는 NAPI `BundleOptions.debug` 로 카테고리별 진단 로그
토글. 비활성 카테고리는 단일 u64 AND 분기 후 즉시 리턴 — hot path 영향 없음.

B2 (#1674) 실측용 std.debug.print 이 f6b2e66 로 main 에 남아있던 문제를
해결하면서 영구 진단 인프라로 격상. 첫 사용처 `compiled_cache`.

### 구성
- `src/debug_log.zig` 신규: `Category` enum, `enabled_mask: u64` 전역
  bitmask, `enabled` / `print` / `addFromCsv` / `addCategories` /
  `initFromEnv` / `resetForTest` API + 4 unit tests
- `src/root.zig` — `pub const debug_log` re-export
- `src/main.zig` — CLI 진입 시 `debug_log.initFromEnv(allocator)`
- `packages/core/src/napi_entry.zig` — NAPI register 1회 init +
  `parseBuildOptions` 에 `debug: string[]` 파싱
- `src/bundler/bundler.zig` — `BundleOptions.debug: []const []const u8`
  필드, `Bundler.init` / `initWithResolveCache` 에서 `addCategories` 호출
- `src/bundler/incremental.zig` — 기존 `std.debug.print` 제거,
  `debug_log.print(.compiled_cache, ...)` 로 교체
- `packages/wasm/src/wasm_entry.zig` — transpile-only 이므로 생략,
  주석으로 향후 bundler 추가 시 initFromEnv 필요함을 명시
- `docs/DEBUG.md` 신규 — 사용법/카테고리/형식/확장 방향
- `CLAUDE.md` — 문서 링크 추가

### 활성화 예
```bash
ZTS_DEBUG=compiled_cache bun run bungae:start
```
```ts
build({ entryPoints: [...], debug: ['compiled_cache'] })
```

둘 다 합집합. 알 수 없는 카테고리는 silent ignore.

### Supersedes
#1684 (debug print noise hotfix) — 이 PR 이 동일 문제를 더 근본적으로
해결 (print 제거 + 대체 인프라). 머지 후 #1684 close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ohah ohah added the enhancement New feature or request label Apr 21, 2026
@ohah ohah self-assigned this Apr 21, 2026
@github-actions
Copy link
Copy Markdown

Smoke Test Results (CI)

Smoke Test Results

Project ZTS Size Time esbuild Size Time rolldown Size Time rspack Size Time Output
lodash-es OK 45KB 29ms OK 64KB 68ms OK 99KB 178ms OK 122KB 137ms MATCH
preact OK 13KB 6ms OK 15KB 9ms OK 13KB 108ms OK 13KB 110ms MATCH
date-fns OK 36KB 140ms OK 47KB 44ms OK 77KB 134ms OK 102KB 160ms MATCH
uuid OK 1.8KB 4ms OK 2.1KB 9ms OK 2.0KB 120ms OK 3.9KB 115ms MATCH
zod OK 105KB 12ms OK 119KB 17ms OK 98KB 121ms OK 147KB 133ms MATCH
axios OK 343KB 22ms FAIL 436KB 35ms OK 399KB 145ms OK 411KB 164ms MATCH
toolkit OK 42KB 12ms OK 51KB 19ms OK 39KB 132ms OK 126KB 129ms MATCH
rxjs OK 324KB 26ms OK 367KB 38ms OK 308KB 166ms OK 325KB 148ms MATCH
immer OK 18KB 6ms OK 22KB 9ms OK 19KB 113ms OK 36KB 114ms MATCH
superjson OK 22KB 7ms OK 26KB 12ms OK 24KB 120ms OK 32KB 116ms MATCH
express OK 781KB 32ms OK 1138KB 59ms OK 908KB 167ms OK 917KB 171ms MATCH
react OK 53KB 6ms OK 64KB 10ms OK 53KB 112ms OK 18KB 108ms MATCH
commander OK 68KB 8ms OK 119KB 13ms OK 100KB 126ms OK 121KB 114ms MATCH
eventemitter3 OK 6.7KB 3ms OK 7.8KB 7ms OK 9.2KB 118ms OK 10KB 109ms MATCH
ms OK 3.6KB 3ms OK 4.3KB 7ms OK 4.0KB 115ms OK 5.0KB 105ms MATCH
dotenv OK 14KB 4ms OK 14KB 7ms OK 12KB 110ms OK 14KB 109ms MATCH
jsonwebtoken OK 115KB 11ms OK 137KB 20ms OK 141KB 127ms OK 159KB 120ms MATCH
bcryptjs OK 33KB 6ms OK 46KB 9ms OK 47KB 110ms OK 60KB 109ms MATCH
clsx OK 0.6KB 3ms OK 0.6KB 7ms OK 0.7KB 110ms OK 1.5KB 108ms MATCH
tiny-invariant OK 0.5KB 3ms OK 0.6KB 7ms OK 0.6KB 107ms OK 1.5KB 108ms MATCH
tanstack-query OK 46KB 7ms OK 57KB 13ms OK 49KB 114ms OK 59KB 117ms MATCH
fast-glob OK 162KB 14ms OK 199KB 23ms OK 187KB 125ms OK 201KB 124ms MATCH
micromatch OK 80KB 9ms OK 100KB 14ms OK 100KB 118ms OK 108KB 115ms MATCH
semver OK 55KB 7ms OK 66KB 12ms OK 52KB 119ms OK 67KB 114ms MATCH
debug OK 20KB 5ms FAIL 25KB 10ms OK 24KB 121ms OK 28KB 114ms MATCH
chalk OK 13KB 4ms OK 15KB 8ms OK 14KB 123ms OK 17KB 112ms MATCH
yaml OK 208KB 15ms OK 261KB 21ms OK 228KB 140ms OK 284KB 125ms MATCH
yargs OK 165KB 13ms OK 185KB 18ms OK 167KB 127ms OK 227KB 129ms MATCH
effect OK 259KB 163ms OK 477KB 162ms OK 368KB 263ms OK 1460KB 243ms MATCH
vue OK 1565KB 77ms OK 2009KB 77ms OK 1606KB 270ms OK 1216KB 178ms MATCH
svelte OK 1.8KB 12ms OK 4.7KB 18ms OK 3.5KB 127ms OK 197KB 129ms MATCH
svelte-mount OK 94KB 22ms OK 113KB 28ms OK 93KB 134ms OK 459KB 154ms MATCH
svelte-mount-min OK 44KB 21ms OK 37KB 31ms OK 28KB 140ms OK 22KB 196ms MATCH
svelte-full OK 100KB 20ms OK 121KB 31ms OK 104KB 139ms OK 462KB 155ms MATCH
svelte-full-min OK 47KB 22ms OK 40KB 30ms OK 30KB 137ms OK 24KB 196ms MATCH
solid-js OK 0.3KB 4ms OK 2.4KB 8ms OK 2.2KB 112ms OK 23KB 115ms MATCH
three OK 243KB 86ms OK 296KB 70ms OK 276KB 182ms OK 1280KB 243ms MATCH
graphql OK 477KB 24ms OK 604KB 36ms OK 547KB 268ms OK 100KB 118ms MATCH
supabase OK 367KB 24ms OK 759KB 32ms OK 706KB 146ms OK 779KB 150ms MATCH
mobx OK 225KB 17ms OK 271KB 24ms OK 234KB 149ms OK 190KB 137ms MATCH
jotai OK 20KB 5ms OK 23KB 9ms OK 20KB 124ms OK 26KB 115ms MATCH
mitt OK 0.5KB 3ms OK 0.6KB 7ms OK 0.7KB 116ms OK 1.5KB 110ms MATCH
zustand OK 1.1KB 3ms OK 1.2KB 7ms OK 1.3KB 111ms OK 2.3KB 109ms MATCH
valtio OK 6.6KB 4ms OK 7.5KB 9ms OK 8.3KB 112ms OK 24KB 111ms MATCH
react-dom OK 1108KB 39ms OK 1355KB 41ms OK 1116KB 196ms OK 534KB 129ms MATCH
d3 OK 108KB 44ms OK 100KB 74ms OK 96KB 165ms OK 150KB 192ms MATCH
hono OK 43KB 9ms OK 59KB 12ms OK 52KB 116ms OK 68KB 114ms MATCH
dayjs OK 11KB 4ms OK 14KB 7ms OK 11KB 107ms OK 8.9KB 108ms MATCH
nanoid OK 0.8KB 3ms OK 0.9KB 6ms OK 0.9KB 106ms OK 2.6KB 109ms MATCH
zlib OK 95KB 14ms OK 112KB 16ms OK 102KB 130ms OK 222KB 126ms MATCH
fp-ts OK 59KB 8ms OK 70KB 13ms OK 100KB 127ms OK 50KB 117ms MATCH
neverthrow OK 13KB 4ms OK 18KB 9ms OK 13KB 109ms OK 19KB 110ms MATCH
drizzle-orm OK 13KB 32ms OK 30KB 28ms OK 14KB 119ms OK 35KB 127ms MATCH
tslib OK 0.7KB 4ms OK 0.8KB 8ms OK 0.8KB 122ms OK 18KB 113ms MATCH
iconv-lite OK 303KB 8ms OK 543KB 14ms OK 319KB 124ms OK 325KB 118ms MATCH
qs OK 77KB 11ms OK 95KB 22ms OK 81KB 117ms OK 92KB 116ms MATCH
change-case OK 3.0KB 4ms OK 3.2KB 8ms OK 3.3KB 117ms OK 8.0KB 113ms MATCH
path-to-regexp OK 12KB 4ms OK 14KB 8ms OK 8.0KB 119ms OK 15KB 109ms MATCH
mime-types OK 178KB 10ms OK 235KB 16ms OK 198KB 119ms OK 164KB 134ms MATCH
ajv OK 210KB 15ms OK 243KB 21ms OK 208KB 128ms OK 239KB 126ms MATCH
cac OK 16KB 5ms OK 18KB 9ms OK 16KB 108ms OK 19KB 109ms MATCH
defu OK 1.9KB 3ms OK 2.1KB 7ms OK 1.8KB 115ms OK 3.0KB 108ms MATCH
pathe OK 3.0KB 5ms OK 3.4KB 8ms OK 3.0KB 107ms OK 13KB 111ms MATCH
destr OK 1.9KB 3ms OK 2.1KB 7ms OK 1.8KB 104ms OK 3.1KB 108ms MATCH
hookable OK 5.3KB 3ms OK 5.9KB 7ms OK 5.2KB 109ms OK 9.3KB 113ms MATCH
minimatch OK 45KB 7ms OK 56KB 12ms OK 47KB 128ms OK 90KB 120ms MATCH
cheerio OK 1632KB 65ms OK 2186KB 86ms OK 1747KB 253ms OK 2387KB 266ms MATCH
is-glob OK 4.9KB 3ms OK 6.4KB 8ms OK 4.9KB 135ms OK 6.0KB 120ms MATCH
glob-parent OK 6.2KB 4ms OK 8.4KB 8ms OK 6.3KB 209ms OK 7.9KB 124ms MATCH
escape-string-regexp OK 0.3KB 3ms OK 0.4KB 7ms OK 0.4KB 108ms OK 1.5KB 116ms MATCH
fast-deep-equal OK 2.4KB 4ms OK 2.9KB 8ms OK 2.3KB 108ms OK 3.2KB 109ms MATCH
deepmerge OK 4.9KB 3ms OK 5.5KB 7ms OK 4.5KB 124ms OK 6.0KB 112ms MATCH
color-convert OK 24KB 6ms OK 30KB 10ms OK 27KB 112ms OK 27KB 128ms MATCH
picomatch OK 47KB 7ms OK 58KB 11ms OK 55KB 116ms OK 61KB 113ms MATCH
type-is OK 186KB 11ms OK 244KB 16ms OK 210KB 129ms OK 179KB 138ms MATCH
object-assign OK 3.0KB 3ms OK 3.8KB 7ms OK 2.8KB 109ms OK 4.3KB 110ms MATCH
has-flag OK 0.4KB 3ms OK 0.5KB 7ms OK 1.5KB 107ms OK 1.7KB 108ms MATCH
p-limit OK 2.6KB 3ms OK 3.0KB 7ms OK 2.7KB 116ms OK 5.2KB 109ms MATCH
strip-ansi OK 0.7KB 3ms OK 0.8KB 6ms OK 0.8KB 108ms OK 2.2KB 108ms MATCH
ansi-regex OK 0.4KB 3ms OK 0.5KB 6ms OK 0.4KB 110ms OK 1.8KB 110ms MATCH
wrap-ansi OK 33KB 5ms OK 35KB 11ms OK 34KB 111ms OK 38KB 114ms MATCH
supports-color OK 3.6KB 3ms OK 3.8KB 6ms OK 4.6KB 111ms OK 5.7KB 110ms MATCH
cross-spawn OK 14KB 5ms OK 18KB 10ms OK 15KB 119ms OK 19KB 111ms MATCH
lru-cache OK 21KB 5ms OK 23KB 9ms OK 22KB 117ms OK 18KB 113ms MATCH
signal-exit OK 5.2KB 4ms OK 6.8KB 7ms OK 6.5KB 116ms OK 12KB 112ms MATCH
which OK 7.7KB 4ms OK 9.5KB 8ms OK 7.7KB 104ms OK 8.7KB 109ms MATCH
string-width OK 24KB 4ms OK 25KB 9ms OK 25KB 107ms OK 27KB 111ms MATCH
safe-buffer OK 2.8KB 3ms OK 3.8KB 7ms OK 1.7KB 113ms OK 3.8KB 106ms MATCH
bytes OK 3.4KB 3ms OK 4.3KB 6ms OK 4.3KB 119ms OK 5.5KB 106ms MATCH
depd OK 9.5KB 4ms OK 12KB 7ms OK 11KB 114ms OK 13KB 109ms MATCH
merge-descriptors OK 2.0KB 3ms OK 2.3KB 7ms OK 1.8KB 113ms OK 2.9KB 109ms MATCH
content-type OK 4.4KB 3ms OK 5.3KB 6ms OK 4.2KB 109ms OK 6.0KB 106ms MATCH
cookie OK 8.2KB 3ms OK 9.8KB 8ms OK 5.6KB 103ms OK 13KB 107ms MATCH
on-finished OK 5.2KB 3ms OK 6.9KB 7ms OK 6.6KB 112ms OK 8.3KB 107ms MATCH
statuses OK 4.6KB 3ms OK 5.8KB 6ms OK 5.3KB 114ms OK 6.1KB 109ms MATCH
etag OK 2.8KB 3ms OK 3.7KB 7ms OK 3.3KB 118ms OK 4.6KB 111ms MATCH
vary OK 3.1KB 3ms OK 3.7KB 7ms OK 3.5KB 107ms OK 5.1KB 108ms MATCH
flat OK 1.1KB 3ms OK 1.3KB 7ms OK 1.2KB 105ms OK 4.9KB 107ms MATCH
retry OK 7.2KB 3ms OK 8.6KB 8ms OK 7.0KB 116ms OK 7.3KB 112ms MATCH
camelcase OK 3.4KB 3ms OK 3.7KB 6ms OK 3.5KB 109ms OK 4.5KB 108ms MATCH
decamelize OK 1.2KB 3ms OK 1.3KB 6ms OK 1.3KB 114ms OK 3.0KB 108ms MATCH
memoize-one OK 2.6KB 3ms OK 3.1KB 6ms OK 2.3KB 117ms OK 2.4KB 109ms MATCH
rfdc OK 6.9KB 3ms OK 8.2KB 7ms OK 6.4KB 111ms OK 7.7KB 110ms MATCH
ohash OK 3.6KB 3ms OK 4.1KB 7ms OK 3.9KB 107ms OK 4.6KB 108ms MATCH
nanoevents OK 0.5KB 3ms OK 0.5KB 6ms OK 0.5KB 113ms OK 1.6KB 109ms MATCH
typebox OK 103KB 20ms OK 116KB 30ms OK 123KB 136ms OK 182KB 147ms MATCH
ts-pattern OK 10KB 4ms OK 12KB 8ms OK 11KB 106ms OK 9.6KB 110ms MATCH
valibot OK 5.5KB 13ms OK 6.8KB 17ms OK 8.0KB 116ms OK 193KB 127ms MATCH
ts-results-es OK 19KB 4ms OK 22KB 9ms OK 26KB 108ms OK 34KB 111ms MATCH
remeda OK 2.2KB 11ms OK 2.6KB 19ms OK 2.5KB 117ms OK 3.7KB 123ms MATCH
nanostores OK 4.7KB 4ms OK 5.7KB 8ms OK 5.1KB 107ms OK 8.2KB 111ms MATCH
ky OK 26KB 5ms OK 30KB 10ms OK 30KB 111ms OK 49KB 119ms MATCH
typedi OK 22KB 4ms OK 27KB 9ms OK 28KB 112ms OK 25KB 114ms MATCH
io-ts OK 85KB 11ms OK 104KB 17ms OK 117KB 125ms OK 102KB 120ms MATCH
type-fest OK 0.1KB 2ms OK 0.1KB 5ms OK 0.1KB 115ms OK 0.9KB 105ms MATCH
arktype OK 257KB 20ms OK 297KB 29ms OK 273KB 146ms OK 382KB 156ms MATCH
kysely OK 223KB 25ms OK 371KB 39ms OK 357KB 141ms OK 471KB 168ms MATCH
lodash-es@es5 OK 12KB 27ms OK 18KB 57ms OK 28KB 147ms FAIL - 0ms MATCH
clsx@es5 OK 0.6KB 3ms OK 0.6KB 6ms OK 0.6KB 109ms FAIL - 0ms MATCH
ms@es5 OK 3.6KB 3ms OK 4.5KB 7ms OK 4.0KB 109ms FAIL - 0ms MATCH
deepmerge@es5 OK 4.9KB 3ms OK 5.7KB 6ms OK 4.5KB 103ms FAIL - 0ms MATCH
fast-deep-equal@es5 OK 2.4KB 3ms OK 3.0KB 7ms OK 2.3KB 106ms FAIL - 0ms MATCH
semver@es5 OK 63KB 7ms FAIL - 11ms OK 52KB 117ms FAIL - 0ms MATCH
lodash-es@es2015 OK 12KB 29ms OK 18KB 55ms OK 28KB 142ms FAIL - 0ms MATCH
superjson@es2015 OK 23KB 7ms OK 27KB 12ms OK 24KB 118ms FAIL - 0ms MATCH
flat@es2017 OK 1.1KB 3ms OK 1.3KB 6ms OK 1.2KB 105ms FAIL - 0ms MATCH
defu@es2017 OK 1.9KB 3ms OK 2.8KB 7ms OK 1.8KB 118ms FAIL - 0ms MATCH
picomatch@es2018 OK 47KB 7ms OK 58KB 10ms OK 55KB 111ms FAIL - 0ms MATCH
semver@es2019 OK 55KB 7ms OK 66KB 12ms OK 52KB 115ms FAIL - 0ms MATCH
clsx@es2019 OK 0.5KB 3ms OK 0.6KB 6ms OK 0.6KB 106ms FAIL - 0ms MATCH
nanoid@es2019 OK 0.8KB 3ms OK 1.0KB 7ms OK 0.9KB 105ms FAIL - 0ms MATCH
dayjs@es2020 OK 11KB 4ms OK 14KB 8ms OK 11KB 108ms FAIL - 0ms MATCH
ohash@es2020 OK 3.7KB 3ms OK 4.8KB 7ms OK 3.9KB 108ms FAIL - 0ms MATCH
lru-cache@es2021 OK 30KB 6ms OK 35KB 10ms OK 22KB 119ms FAIL - 0ms MATCH
nanostores@es2021 OK 1.7KB 4ms OK 2.3KB 7ms OK 1.9KB 118ms FAIL - 0ms MATCH
lodash-es@chrome80 OK 45KB 29ms OK 64KB 56ms OK 99KB 152ms FAIL - 0ms MATCH
clsx@chrome49 OK 0.6KB 3ms OK 0.6KB 7ms OK 0.7KB 114ms FAIL - 0ms MATCH
dayjs@safari14 OK 11KB 4ms OK 14KB 7ms OK 11KB 116ms FAIL - 0ms MATCH
nanoid@node16 OK 0.7KB 3ms OK 0.9KB 7ms OK 0.9KB 106ms FAIL - 0ms DIFF

Size Comparison (ZTS vs esbuild)

Project ZTS esbuild rolldown rspack Ratio Status
type-fest 0.1KB 0.1KB 0.1KB 0.9KB 1.18x ⚠️
svelte-mount-min 44KB 37KB 28KB 22KB 1.18x ⚠️
svelte-full-min 47KB 40KB 30KB 24KB 1.17x ⚠️
d3 108KB 100KB 96KB 150KB 1.08x
dotenv 14KB 14KB 12KB 14KB 0.96x
string-width 24KB 25KB 25KB 27KB 0.96x
camelcase 3.4KB 3.7KB 3.5KB 4.5KB 0.94x
supports-color 3.6KB 3.8KB 4.6KB 5.7KB 0.93x
destr 1.9KB 2.1KB 1.8KB 3.1KB 0.93x
wrap-ansi 33KB 35KB 34KB 38KB 0.93x
decamelize 1.2KB 1.3KB 1.3KB 3.0KB 0.92x
change-case 3.0KB 3.2KB 3.3KB 8.0KB 0.91x
lru-cache 21KB 23KB 22KB 18KB 0.91x
cac 16KB 18KB 16KB 19KB 0.91x
hookable 5.3KB 5.9KB 5.2KB 9.3KB 0.90x
clsx 0.6KB 0.6KB 0.7KB 1.5KB 0.90x
clsx@chrome49 0.6KB 0.6KB 0.7KB - 0.90x
yargs 165KB 185KB 167KB 227KB 0.90x
clsx@es5 0.6KB 0.6KB 0.6KB - 0.89x
clsx@es2019 0.5KB 0.6KB 0.6KB - 0.89x
uuid 1.8KB 2.1KB 2.0KB 3.9KB 0.89x
ts-pattern 10KB 12KB 11KB 9.6KB 0.89x
defu 1.9KB 2.1KB 1.8KB 3.0KB 0.89x
typebox 103KB 116KB 123KB 182KB 0.89x
zustand 1.1KB 1.2KB 1.3KB 2.3KB 0.89x
rxjs 324KB 367KB 308KB 325KB 0.88x
zod 105KB 119KB 98KB 147KB 0.88x
deepmerge 4.9KB 5.5KB 4.5KB 6.0KB 0.88x
valtio 6.6KB 7.5KB 8.3KB 24KB 0.88x
ohash 3.6KB 4.1KB 3.9KB 4.6KB 0.88x
flat@es2017 1.1KB 1.3KB 1.2KB - 0.88x
pathe 3.0KB 3.4KB 3.0KB 13KB 0.88x
flat 1.1KB 1.3KB 1.2KB 4.9KB 0.88x
tslib 0.7KB 0.8KB 0.8KB 18KB 0.88x
superjson 22KB 26KB 24KB 32KB 0.88x
has-flag 0.4KB 0.5KB 1.5KB 1.7KB 0.88x
ky 26KB 30KB 30KB 49KB 0.88x
lru-cache@es2021 30KB 35KB 22KB - 0.87x
arktype 257KB 297KB 273KB 382KB 0.86x
ajv 210KB 243KB 208KB 239KB 0.86x
remeda 2.2KB 2.6KB 2.5KB 3.7KB 0.86x
preact 13KB 15KB 13KB 13KB 0.86x
chalk 13KB 15KB 14KB 17KB 0.86x
eventemitter3 6.7KB 7.8KB 9.2KB 10KB 0.86x
ts-results-es 19KB 22KB 26KB 34KB 0.86x
ansi-regex 0.4KB 0.5KB 0.4KB 1.8KB 0.86x
deepmerge@es5 4.9KB 5.7KB 4.5KB - 0.86x
p-limit 2.6KB 3.0KB 2.7KB 5.2KB 0.85x
zlib 95KB 112KB 102KB 222KB 0.85x
superjson@es2015 23KB 27KB 24KB - 0.85x
jotai 20KB 23KB 20KB 26KB 0.85x
strip-ansi 0.7KB 0.8KB 0.8KB 2.2KB 0.85x
mitt 0.5KB 0.6KB 0.7KB 1.5KB 0.85x
tiny-invariant 0.5KB 0.6KB 0.6KB 1.5KB 0.85x
memoize-one 2.6KB 3.1KB 2.3KB 2.4KB 0.85x
nanoevents 0.5KB 0.5KB 0.5KB 1.6KB 0.84x
fast-deep-equal 2.4KB 2.9KB 2.3KB 3.2KB 0.84x
merge-descriptors 2.0KB 2.3KB 1.8KB 2.9KB 0.84x
rfdc 6.9KB 8.2KB 6.4KB 7.7KB 0.84x
fp-ts 59KB 70KB 100KB 50KB 0.84x
jsonwebtoken 115KB 137KB 141KB 159KB 0.84x
cookie 8.2KB 9.8KB 5.6KB 13KB 0.83x
immer 18KB 22KB 19KB 36KB 0.83x
retry 7.2KB 8.6KB 7.0KB 7.3KB 0.83x
mobx 225KB 271KB 234KB 190KB 0.83x
react 53KB 64KB 53KB 18KB 0.83x
semver@es2019 55KB 66KB 52KB - 0.83x
semver 55KB 66KB 52KB 67KB 0.83x
path-to-regexp 12KB 14KB 8.0KB 15KB 0.83x
svelte-full 100KB 121KB 104KB 462KB 0.83x
svelte-mount 94KB 113KB 93KB 459KB 0.83x
toolkit 42KB 51KB 39KB 126KB 0.83x
content-type 4.4KB 5.3KB 4.2KB 6.0KB 0.83x
nanostores 4.7KB 5.7KB 5.1KB 8.2KB 0.83x
io-ts 85KB 104KB 117KB 102KB 0.82x
ms 3.6KB 4.3KB 4.0KB 5.0KB 0.82x
three 243KB 296KB 276KB 1280KB 0.82x
vary 3.1KB 3.7KB 3.5KB 5.1KB 0.82x
react-dom 1108KB 1355KB 1116KB 534KB 0.82x
valibot 5.5KB 6.8KB 8.0KB 193KB 0.81x
fast-glob 162KB 199KB 187KB 201KB 0.81x
tanstack-query 46KB 57KB 49KB 59KB 0.81x
qs 77KB 95KB 81KB 92KB 0.81x
depd 9.5KB 12KB 11KB 13KB 0.81x
bytes 3.4KB 4.3KB 4.3KB 5.5KB 0.81x
picomatch@es2018 47KB 58KB 55KB - 0.81x
picomatch 47KB 58KB 55KB 61KB 0.81x
escape-string-regexp 0.3KB 0.4KB 0.4KB 1.5KB 0.81x
which 7.7KB 9.5KB 7.7KB 8.7KB 0.81x
object-assign 3.0KB 3.8KB 2.8KB 4.3KB 0.81x
color-convert 24KB 30KB 27KB 27KB 0.81x
micromatch 80KB 100KB 100KB 108KB 0.80x
dayjs@es2020 11KB 14KB 11KB - 0.80x
dayjs 11KB 14KB 11KB 8.9KB 0.80x
dayjs@safari14 11KB 14KB 11KB - 0.80x
statuses 4.6KB 5.8KB 5.3KB 6.1KB 0.80x
typedi 22KB 27KB 28KB 25KB 0.80x
nanoid@es2019 0.8KB 1.0KB 0.9KB - 0.80x
yaml 208KB 261KB 228KB 284KB 0.79x
nanoid 0.8KB 0.9KB 0.9KB 2.6KB 0.79x
minimatch 45KB 56KB 47KB 90KB 0.79x
ms@es5 3.6KB 4.5KB 4.0KB - 0.79x
nanoid@node16 0.7KB 0.9KB 0.9KB - 0.79x
fast-deep-equal@es5 2.4KB 3.0KB 2.3KB - 0.79x
graphql 477KB 604KB 547KB 100KB 0.79x
ohash@es2020 3.7KB 4.8KB 3.9KB - 0.78x
cross-spawn 14KB 18KB 15KB 19KB 0.78x
vue 1565KB 2009KB 1606KB 1216KB 0.78x
date-fns 36KB 47KB 77KB 102KB 0.77x
is-glob 4.9KB 6.4KB 4.9KB 6.0KB 0.76x
etag 2.8KB 3.7KB 3.3KB 4.6KB 0.76x
signal-exit 5.2KB 6.8KB 6.5KB 12KB 0.76x
type-is 186KB 244KB 210KB 179KB 0.76x
mime-types 178KB 235KB 198KB 164KB 0.76x
nanostores@es2021 1.7KB 2.3KB 1.9KB - 0.76x
on-finished 5.2KB 6.9KB 6.6KB 8.3KB 0.75x
neverthrow 13KB 18KB 13KB 19KB 0.75x
cheerio 1632KB 2186KB 1747KB 2387KB 0.75x
safe-buffer 2.8KB 3.8KB 1.7KB 3.8KB 0.74x
glob-parent 6.2KB 8.4KB 6.3KB 7.9KB 0.73x
hono 43KB 59KB 52KB 68KB 0.72x
lodash-es@chrome80 45KB 64KB 99KB - 0.71x
lodash-es 45KB 64KB 99KB 122KB 0.71x
bcryptjs 33KB 46KB 47KB 60KB 0.70x
express 781KB 1138KB 908KB 917KB 0.69x
defu@es2017 1.9KB 2.8KB 1.8KB - 0.67x
lodash-es@es2015 12KB 18KB 28KB - 0.65x
lodash-es@es5 12KB 18KB 28KB - 0.65x
kysely 223KB 371KB 357KB 471KB 0.60x
commander 68KB 119KB 100KB 121KB 0.57x
iconv-lite 303KB 543KB 319KB 325KB 0.56x
effect 259KB 477KB 368KB 1460KB 0.54x
supabase 367KB 759KB 706KB 779KB 0.48x
drizzle-orm 13KB 30KB 14KB 35KB 0.42x
svelte 1.8KB 4.7KB 3.5KB 197KB 0.39x
solid-js 0.3KB 2.4KB 2.2KB 23KB 0.11x

Average ratio: 0.82x | Smaller: 132 | Similar(±10%): 1 | Larger: 3

Auto-generated by CI on 2026-04-21 04:15 UTC

@ohah ohah merged commit d562e99 into main Apr 21, 2026
20 checks passed
@ohah ohah deleted the feat-debug-log-infrastructure branch April 21, 2026 04:17
@github-actions
Copy link
Copy Markdown

Benchmark Results (CI)

macos-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 3 5 1.0x
esbuild 7 6 9 1.8x
Bun 7 7 8 1.8x
oxc (node) 77 65 107 19.3x
SWC 150 127 187 37.5x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 5 5 6 1.0x
esbuild 8 6 10 1.6x
Bun 8 7 9 1.6x
oxc (node) 78 67 103 15.6x
SWC 152 128 208 30.4x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 6 5 9 1.0x
ZTS 13 12 15 2.2x
Bun 16 11 21 2.7x
oxc (node) 69 64 72 11.5x
SWC 150 146 155 25.0x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 5 4 5 1.0x
Bun 8 7 12 1.6x
esbuild 10 9 11 2.0x
rspack 240 129 507 48.0x
rolldown 256 178 356 51.2x
webpack 457 387 490 91.4x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 5 4 6 1.0x
esbuild 14 11 18 2.8x
Bun 17 12 25 3.4x
rspack 194 178 226 38.8x
rolldown 196 137 255 39.2x
webpack 514 489 572 102.8x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 10 8 17 1.0x
Bun 13 11 18 1.3x
esbuild 20 18 23 2.0x
rolldown 267 194 341 26.7x

small (100 lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 84 83 88 1.0x
WASM (.wasm) 840 825 1624 10.0x
CLI (subprocess) 5659 5138 5896 67.4x

medium (1K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 1002 965 1106 1.0x
WASM (.wasm) 3209 3151 3363 3.2x
CLI (subprocess) 56946 35429 66113 56.8x

large (5K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 8048 5716 11194 1.0x
WASM (.wasm) 14839 9016 31009 1.8x
CLI (subprocess) 119748 107086 179485 14.9x

xlarge (10K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 12617 10392 15199 1.0x
WASM (.wasm) 22749 20103 28212 1.8x
CLI (subprocess) 109161 101396 151830 8.7x

ubuntu-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 2 2 2 1.0x
esbuild 2 2 3 1.0x
Bun 3 3 3 1.5x
oxc (node) 35 33 37 17.5x
SWC 98 95 101 49.0x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
Bun 4 4 5 2.0x
ZTS 5 4 5 2.5x
oxc (node) 35 33 38 17.5x
SWC 103 100 106 51.5x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
Bun 12 12 12 6.0x
ZTS 19 18 19 9.5x
oxc (node) 37 34 40 18.5x
SWC 122 121 123 61.0x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 3 2 3 1.0x
Bun 5 5 5 1.7x
esbuild 6 6 6 2.0x
rolldown 116 111 123 38.7x
rspack 120 119 123 40.0x
webpack 525 524 527 175.0x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 4 4 1.0x
Bun 6 6 6 1.5x
esbuild 8 7 8 2.0x
rolldown 121 113 129 30.3x
rspack 128 125 137 32.0x
webpack 524 523 525 131.0x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 10 9 10 1.0x
Bun 10 10 11 1.0x
esbuild 16 15 19 1.6x
rolldown 125 121 134 12.5x

small (100 lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 237 228 271 1.0x
WASM (.wasm) 1110 917 2142 4.7x
CLI (subprocess) 8025 7876 9534 33.9x

medium (1K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 2660 2574 2724 1.0x
WASM (.wasm) 9836 9335 10177 3.7x
CLI (subprocess) 69711 69286 73172 26.2x

large (5K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 14061 13606 14520 1.0x
WASM (.wasm) 17181 16494 34985 1.2x
CLI (subprocess) 214701 213014 246258 15.3x

xlarge (10K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 27324 26521 27502 1.0x
WASM (.wasm) 33480 32967 34938 1.2x
CLI (subprocess) 224319 220080 271002 8.2x

windows-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 12 10 14 1.0x
Bun 20 20 21 1.7x
oxc (node) 68 66 69 5.7x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 14 14 15 1.0x
Bun 21 20 22 1.5x
oxc (node) 69 65 72 4.9x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 21 20 22 1.0x
ZTS 25 24 28 1.2x
oxc (node) 67 65 68 3.2x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 16 16 17 1.0x
Bun 37 35 39 2.3x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 20 19 22 1.0x
Bun 39 38 43 1.9x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 39 36 41 1.0x
Bun 52 50 54 1.3x

small (100 lines)

Method Median (us) Min (us) Max (us) vs fastest
WASM (.wasm) 2005 1374 25616 1.0x
CLI (subprocess) 15792 14591 19381 7.9x
NAPI (.node) FAIL - - -

medium (1K lines)

Method Median (us) Min (us) Max (us) vs fastest
WASM (.wasm) 8011 6737 39985 1.0x
CLI (subprocess) 80052 74503 83564 10.0x
NAPI (.node) FAIL - - -

large (5K lines)

Method Median (us) Min (us) Max (us) vs fastest
WASM (.wasm) 28367 17746 35221 1.0x
CLI (subprocess) 230704 220085 235088 8.1x
NAPI (.node) FAIL - - -

xlarge (10K lines)

Method Median (us) Min (us) Max (us) vs fastest
WASM (.wasm) 41330 34932 45843 1.0x
CLI (subprocess) 218587 214237 224855 5.3x
NAPI (.node) FAIL - - -

Auto-generated by CI on 2026-04-21 04:19 UTC

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant