Files
carbon-lang/common
Chandler Carruth 21c825a3f7 Hot-path optimizations for (Canonical)ValueStore::Add (#8031)
Extract the allocation path (which is inherently cold due to growth).
Making the outlining effective requires both blocking further inlining
and using `preserve_most` so that the existence of the call doesn't
disrupt the register allocation.

We also mark the insertion statements with callbacks as `always_inline`
so it being cold doesn't cause it to be left out-of-line and further
disrupt register allocation. It's a bit strange to force inlining of a
cold-path function, but the register impact of the call extends back
into the hot-path.

Agy's benchmarks (`./scripts/bench_runner.py --runs=12`, `-c opt
--copt=-march=x86-64-v3`, vs. `trunk`):
- `BM_ValidIdentifiers<3, 5, true>`: -6.277% CPU time
- `BM_ValidIdentifiers<3, 16, true>`: -4.525% CPU time
- `BM_CompileApiFileDenseDecls<Lang::Carbon, Phase::Lex>/262144`:
-2.012% CPU time (47.5 ms ± 6.358% -> 46.54 ms ± 1.773%, p=0.0167)

Assisted-by: Antigravity with Gemini
2026-10-26 06:38:17 +00:00
..
2025-05-16 01:39:19 +00:00
2025-10-13 18:49:48 +00:00
2026-10-06 15:13:10 +00:00
2024-10-13 17:47:57 +00:00
2024-01-05 23:01:47 +00:00
2024-09-16 22:55:55 +00:00