LoggerJS 基准矩阵
最后更新:2026-06-18(两台机器的 rows 手工合并;每台机器的 JSON artifacts 位于 gitignored benchmarks/matrix/,所以 aggregate command 不能重新生成本地不存在 artifact 的 row)。
这张表是签入仓库的 loggerjs-vs-pino Node hot-path 声明证据矩阵。Ratios 来自 interleaved A/B harness 的 paired per-round latency medians,不是一轮顺序运行的 ratio。低于 1.00x 表示该机器上 LoggerJS path latency 低于 pino。**下面两行有意不一致,这正是重点:**排序依赖 CPU/V8(M1 Max 上 LoggerJS 更快,M4 Pro 上 pino 更快),因此不能支持普遍“快于 pino”的声明。
| Label | Platform | CPU | Node | Git | Runs | Pino ns | Lean ns | Prepared ns | Lean / pino | Prepared / pino | Result |
|---|---|---|---|---|---|---|---|---|---|---|---|
| macbookpro-node22 | darwin/arm64 | Apple M1 Max | v22.21.1 | 5d7e4e3bf423 | 5 | 286 | 244 | 223 | 0.843x (118.6%) | 0.773x (129.3%) | LoggerJS lean + prepared faster |
| m4pro-node22 | darwin/arm64 | Apple M4 Pro | v22.22.2 | 1d3d51c21f86 | 6 | 197 | 223 | 211 | 1.137x (87.9%) | 1.054x (94.9%) | pino faster (lean + prepared) |
Row Details
| Label | Memory | Dependencies | Sampling | Baseline spread | Prepared / lean |
|---|---|---|---|---|---|
| macbookpro-node22 | 64 GB | pino 10.3.1, winston 3.19.0, LogTape 2.1.3 | 5 runs, 120 rounds x 5000 ops, 100000 warmup | 21.2% | 0.919x (108.8%) |
| m4pro-node22 | 24 GB | pino 10.3.1, winston 3.19.0, LogTape 2.1.5 | 6 runs, 120 rounds x 5000 ops, 100000 warmup | 41.9% | 0.942x (106.1%) |
Evidence Coverage
| Requirement | Status | Rows |
|---|---|---|
| At least one non-Apple-Silicon runtime | Missing | darwin/arm64 |
| At least two Node major versions | Missing | 22 |
两个 gate 仍然 Missing:M4 Pro row 是 Node 22 上的第二台 Apple-Silicon CPU,不满足 non-Apple 或 second-Node-major 要求。不过它已经把 universal-claim guard 具体化:在同一 OS/arch/Node-major 内,只替换 CPU(M1 Max -> M4 Pro)就能把结果从“LoggerJS faster”翻转为“pino faster”。在加入 non-Apple 和 second Node-major row 前,性能措辞必须限定到 CPU 范围,不要写成“LoggerJS 总是快于 pino”。
复现
pnpm build
pnpm bench:matrix -- --runs=5 --rounds=120 --label="$(hostname)-node22"
# after copying artifacts from other machines into benchmarks/matrix/
pnpm bench:matrix:aggregate -- benchmarks/matrix --out docs/BENCHMARK-MATRIX.md非 Apple-Silicon 和多 Node 证据运行手动 GitHub Actions workflow:
gh workflow run benchmark-matrix.yml -f runs=5 -f rounds=120 -f batch=5000 -f warmup=100000下载 benchmark-matrix-aggregate artifact,review 生成的 benchmark-matrix-ci.md,并且只有当 rows 来自预期 machine/runtime combinations 时才提交到本文件。不要在没有匹配 JSON artifacts 的情况下手写 benchmark rows。
说明:
- 矩阵只证明列出的 machine/runtime/dependency combinations。不要把它扩展成普遍“always faster than pino”。
- 测试新 CPUs、操作系统、Node/V8 versions 或 pino releases 时新增 rows。
- 如果 row 来自 dirty worktree,在 Git 列中标记
*。