Add UTF-8 string access benchmarks
Add four UTF-8 string workloads to the interpreter benchmark suite:
- Random character access in ~99% ASCII prose in a 131,072-character document, with 4,096 reads.
- Random character access in multilingual prose in a 131,072-character document, with 4,096 reads.
- Sequential indexing and word-boundary scanning over mostly-ASCII prose.
- Paragraph start/end indexing with successive
find()calls in a 131,072-character document.
Build reproducible inputs from a compact JSON corpus using a seeded LCG, expanding the generated prose for larger documents. The existing harness discovers the scripts for local Monty/CPython comparisons and CodSpeed.
Each module docstring explains its workload, and comments mark setup, benchmark and validation sections. Script setup—including JSON decoding, text construction and expansion, and random-offset generation—and assertions are timed. Corpus file loading and compilation are outside timing.
Validation: all four workloads pass in Monty and CPython; Python lint, Rust Clippy (including all features), import checks and focused Ruff formatting/lint checks pass.
Summary by cubic
Adds four UTF-8 string access workloads to the interpreter benchmark suite: random character access in mostly-ASCII and multilingual 128K-character prose (4,096 reads each), sequential indexing with word-boundary scanning, and paragraph start/end scanning over a 131,072-character document.
- Generates reproducible text and lookup offsets from a new JSON corpus using seeded LCG streams.
- Times setup and assertions while excluding corpus loading and compilation.
- Excludes the multilingual corpus from codespell in
pyproject.toml. - All four workloads pass validation in Monty and CPython.