Phase 10: Monitoring and automated benchmarks

10.1: Add Criterion dev-dependency and benchmarks for:
  - matching_rules (100 rules)
  - ComputedStyle::compute (empty, 5 props)
  - resolve_string (no vars, 1 var, 3 vars)

10.3: Add --perf CLI flag and src/perf.rs module:
  - PerfScope drop-guard timed scopes (vdom, style, render)
  - Instrumented: VDOM eval (app.rs update), render (app.rs view),
    style matching (style.rs compute_cached)
  - Per-frame report printed to stderr at end of view()

10.2+10.4: Threshold check in perf report:
  - Prints warning if total > 16ms (60 FPS frame budget)

Refactor: Move Message enum to lib.rs so benchmarks can import
the public API. Added lib.rs as library root.
This commit is contained in:
Glint Dev
2026-07-24 19:58:58 +03:00
parent b6fa841d11
commit 938f05f59d
8 changed files with 389 additions and 26 deletions

View File

@@ -20,3 +20,10 @@ rayon = { version = "1.10", optional = true }
[features]
default = []
parallel = ["rayon"]
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "bench"
harness = false