diff options
| author | Paul Kirth <paulkirth@google.com> | 2025-09-26 15:46:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-26 15:46:57 -0700 |
| commit | f9065fce8fd2bb664ed8dcb7582432b83c2114c4 (patch) | |
| tree | 33a7a32f11fd65ab731f1be0b7b5311ff865a928 /llvm/tools/llvm-diff/lib | |
| parent | 220ad03d5b28dbd83dbb90896a7eb55b74004818 (diff) | |
| download | llvm-f9065fce8fd2bb664ed8dcb7582432b83c2114c4.zip llvm-f9065fce8fd2bb664ed8dcb7582432b83c2114c4.tar.gz llvm-f9065fce8fd2bb664ed8dcb7582432b83c2114c4.tar.bz2 | |
[llvm][mustache] Avoid excessive hash lookups in EscapeStringStream (#160166)
The naive char-by-char lookup performed OK, but we can skip ahead to the
next match, avoiding all the extra hash lookups in the key map. Likely
there is a faster method than this, but its already a 42% win in the
BM_Mustache_StringRendering/Escaped benchmark, and an order of magnitude
improvement for BM_Mustache_LargeOutputString.
| Benchmark | Before (ns) | After (ns) | Speedup |
| :--- | ---: | ---: | ---: |
| `StringRendering/Escaped` | 29,440,922 | 16,583,603 | ~44% |
| `LargeOutputString` | 15,139,251 | 929,891 | ~94% |
| `HugeArrayIteration` | 102,148,245 | 95,943,960 | ~6% |
| `PartialsRendering` | 308,330,014 | 303,556,563 | ~1.6% |
Unreported benchmarks, like those for parsing, had no significant
change.
Diffstat (limited to 'llvm/tools/llvm-diff/lib')
0 files changed, 0 insertions, 0 deletions
