一键导入
benchmark
Benchmark a change to prove it is faster. Runs Criterion and PHP benchmarks before and after, compares results, and rejects regressions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Benchmark a change to prove it is faster. Runs Criterion and PHP benchmarks before and after, compares results, and rejects regressions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add a WordPress function replacement. Full workflow from WP source to Rust implementation, testing, and registration.
Debug when a Rust implementation produces different output than the WordPress fixture. Identifies the exact behavioral difference and fixes it.
Profile WordPress to identify functions suitable for Rust replacement.
Build the extension for PHP 8.3, install in the WordPress profiling stack, and verify it works end-to-end.
| name | benchmark |
| description | Benchmark a change to prove it is faster. Runs Criterion and PHP benchmarks before and after, compares results, and rejects regressions. |
| disable-model-invocation | true |
| argument-hint | [function_name or 'all'] |
Every performance change must be proven with numbers. "Should be faster" is not evidence.
Stash or commit your changes, then run on the CURRENT code:
# Rust micro-benchmarks (reports MB/s and ns/iter)
cargo bench -p patina-bench -- $ARGUMENTS 2>&1 | tee /tmp/bench-before.txt
# PHP benchmarks (reports Rust vs PHP speedup)
make bench 2>&1 | tee /tmp/php-bench-before.txt
cargo bench -p patina-bench -- $ARGUMENTS 2>&1 | tee /tmp/bench-after.txt
make bench 2>&1 | tee /tmp/php-bench-after.txt
Criterion prints change percentages automatically on the second run. Look for:
-X.XX%): faster. Good.+X.XX%): slower. Reject unless there's a correctness reason.No change: within noise. Not worth the complexity.For PHP benchmarks, compare the speedup columns side by side.
make bench-jit shows whether the improvement holds when PHP has JIT enabled — JIT narrows the gap on simple functions.State the function, what changed, and the measured impact:
esc_html (medium input, 500B):
Before: 1.20 µs/iter, 420 MB/s
After: 0.85 µs/iter, 590 MB/s
Change: -29% (Criterion: p < 0.05)