mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 20:32:39 +00:00
This uses SSE2 to optimize the horizontal space skipping path when there is more than a single character. That helps with indentation and other edge cases and doesn't cost much because we only begin when >1 horizontal space to skip. We use SSE2 here which is available ubiquitously as AVX2 doesn't provide any significant advantage. Agy's benchmarks (`./scripts/bench_runner.py --runs=12`, `-c opt --copt=-march=x86-64-v3`, vs. `trunk`): - `BM_HorizontalWhitespace/16`: -4.610% CPU time, +4.832% bytes/s & tokens/s - `BM_HorizontalWhitespace/64`: -45.977% CPU time, +85.106% bytes/s & tokens/s - `BM_HorizontalWhitespace/128`: 0.428x CPU time, 2.338x bytes/s & tokens/s Assisted-by: Antigravity with Gemini --------- Co-authored-by: Geoff Romer <gromer@google.com>