Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
CssParsePerfBench.cpp File Reference

CSS parser micro-benchmark suite. More...

#include <benchmark/benchmark.h>
#include <string_view>
#include "donner/base/ParseWarningSink.h"
#include "donner/css/CSS.h"
Include dependency graph for CssParsePerfBench.cpp:

Functions

 BENCHMARK_MAIN ()

Detailed Description

CSS parser micro-benchmark suite.

Baseline measurement harness for the css_token_stream design doc (docs/design_docs/css_token_stream.md). Measures wall time for the three public CSS parser entry points on a set of representative inputs, from small inline style="..." attributes to a medium stylesheet typical of an SVG <style> block.

Allocation counts are intentionally not collected here — run this binary under heaptrack (Linux) or Instruments (macOS) to attribute allocations per call site if the wall-time numbers suggest the parser is a hotspot.

Usage:

bazel run -c opt //donner/benchmarks:css_parse_perf_bench -- \
--benchmark_min_time=0.5s