angular/angular
@angular/benchpress
A browser benchmarking library used by Angular's own performance suite. Lets test code drive a browser through repeated iterations of a workload and collect statistics from Chrome's tracing/performance APIs.
Purpose
@angular/benchpress provides:
- A
Runnerthat drives the browser through a configurable sample loop. - Metrics collectors that read browser performance traces (heap, paint, layout, script).
- Validators that decide when a benchmark has gathered enough samples to be statistically meaningful.
- Reporters that write CSV / JSON output for the perf comparison workflow.
Directory layout
packages/benchpress/
├── src/
│ ├── runner.ts
│ ├── metric/ # Metric implementations
│ ├── validator/ # Sample-count validators
│ ├── reporter/ # CSV / JSON / multi-reporter
│ ├── webdriver/ # Webdriver adapters
│ └── ...
└── public_api.tsKey abstractions
| Type | File | What it is |
|---|---|---|
Runner |
packages/benchpress/src/runner.ts |
The top-level driver. |
Metric |
packages/benchpress/src/metric.ts |
Base class for metric collectors. |
Validator |
packages/benchpress/src/validator.ts |
Decides when a sample set is sufficient. |
Reporter |
packages/benchpress/src/reporter.ts |
Writes results. |
Usage
The benchmark suites under modules/benchmarks/ drive Benchpress. The pnpm benchmarks script runs a representative subset locally; CI runs the full set on dedicated hardware via the perf.yml and benchmark-compare.yml workflows.
Integration points
modules/benchmarks/— the actual benchmark workloads.scripts/benchmarks/index.mts— the local-runner orchestration.- CI perf workflows —
.github/workflows/perf.ymlandbenchmark-compare.ymlconsume Benchpress output.
Status
Benchpress is internal-leaning: it ships on npm but is rarely used outside Angular and a few sister projects. Treat it as a stable but unflashy testing tool.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.