Initial commit

This commit is contained in:
2026-09-05 00:36:02 +00:00
commit b9664aabe4
14 changed files with 19829 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# Benchmark scripts
Recreate every statistic and table quoted in the top-level README.
`uarite` must be importable (e.g. `pip install -e .` or run with
`PYTHONPATH` pointing at the repo root); the reference parsers are
benchmark-only dependencies, pulled ad hoc via `uv run --with`.
- `download_data.py` — fetch the external datasets into `data/`:
the 100 modern browser UAs (top-user-agents npm package) and the
crawler corpus (monperrus/crawler-user-agents). `data/ua.txt` is a
committed real-traffic sample, not downloaded.
```
uv run scripts/download_data.py
```
- `prettytable.py` — prints the accuracy-comparison markdown table:
```
uv run --with ua-parser --with user-agents python scripts/prettytable.py
```
- `bench.py` — prints browser-accuracy counts, crawler-detection rates,
URL-extraction coverage, and the timing tables (unique UAs, realistic
mix, bot storm) with cache statistics:
```
uv run --with ua-parser --with user-agents --with user-agent-parser \
python scripts/bench.py
```