Min-Yih Hsu 3edf82d556
[XRay] Reserve memory space ahead-of-time when reading native format log (#76853)
XRay used to struggle reading large log files. It turned out the
bottleneck was primarily caused by the reallocation happens when
appending log entries into a std::vector.
This patch reserves the memory space ahead-of-time since the number of
entries is known for most cases. Making llvm-xray runs 1.8 times faster
and uses 1.4 times less physical memory when reading large (~2.6GB) log
files.
2024-01-12 16:34:39 -08:00
..