Skip to main content

render-bench

Run RaTeX rendering performance benchmarks (100-formula PNG/SVG/PDF, cold-vs-hot font cache timing, phase breakdown). Use when profiling render performance or comparing before/after optimization changes.

소스 정보

저장소
erweixin/RaTeX
최근 소스 활동
2026년 7월 25일 18:45
감지된 SKILL.md 언어
영어
스타
1,534
포크
79

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
render-bench
description
Run RaTeX rendering performance benchmarks (100-formula PNG/SVG/PDF, cold-vs-hot font cache timing, phase breakdown). Use when profiling render performance or comparing before/after optimization changes.
# Render performance benchmarks ## Prerequisites - Rust toolchain with `--release`. - KaTeX TTFs in `fonts/` (committed in-repo; 20 `.ttf` files). - (Optional) CJK/emoji system fonts for the full CJK/emoji categories. ## Commands ### 1. Full 100-formula benchmark ```bash cargo test -p ratex-render --test bench_render --release -- --ignored --nocapture ``` Renders 100 formulas across 6 categories (math, complex, matrix, cjk, emoji, chem) in PNG, SVG, SVG-standalone, and PDF. Prints per-category averages and overall throughput (formulas/sec). Warmup: 1 iteration per formula. Measurement: 3 iterations, averaged. ### 2. Font cache cold vs hot timing ```bash cargo test -p ratex-render --test font_cache_timing --release -- --ignored --nocapture ``` Measures 3 formulas: first pass (cold — disk I/O for font loading), second pass (hot — `OnceLock` cache hits). Reports speedup ratio. ### 3. Render phase breakdown ```bash cargo test -p ratex-render --test phase_breakdown --release -- --ignored --nocapture ``` Per-formula breakdown: parse+layout vs render phase timing. 6 formulas including CJK and emoji cases. Warmup: 3 iterations, Measurement: 10 iterations, averaged. ### 4. Compare before/after (quick diff) Useful when optimizing a specific path: ```bash # Before (on main) cargo test -p ratex-render --test phase_breakdown --release -- --ignored --nocapture 2>&1 | tee /tmp/before.txt # After (on branch) cargo test -p ratex-render --test phase_breakdown --release -- --ignored --nocapture 2>&1 | tee /tmp/after.txt # Diff the tables diff /tmp/before.txt /tmp/after.txt ``` ## Quick checklist 1. Run `cargo test -p ratex-render --test bench_render --release -- --ignored --nocapture` for the full picture. 2. For quick iteration, use `phase_breakdown` (faster, 6 formulas). 3. For font-loading specific changes, use `font_cache_timing`. 4. Always use `--release` — debug builds are 10-50× slower and meaningless for perf comparison.
GitHub에서 보기