Files
clang-p2996/llvm/lib/Support/MemoryBuffer.cpp
serge-sans-paille 37048d04d8 Cache memory buffer's name length
This avoids repeated calls to strlen while we already know its value.

When preprocessing sqlite3.c, this gives a surprising 2% speedup.

Full benchmark available here:

https://llvm-compile-time-tracker.com/compare.php?from=d14c2d408dccd8c6defa7d151e9a96be3cac8cc3&to=04f0641c1cbdcd0bdbd11cd910ca6091420bf52e&stat=instructions:u

Recommit 1824432174, with restored '\0' at the end of buffer name.

Differential Revision: https://reviews.llvm.org/D138555
2022-12-01 09:38:16 +01:00

20 KiB