[llvm] [Symbolizer, DebugInfo] Clean up LLVMSymbolizer API: const string& -> StringRef (PR #104541)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 07:30:55 PDT 2024
itrofimow wrote:
I didn't mean to request your immediate attention to this, but rather to notify that this work-item is now actionable.
Sorry for the irritation, and thank you for the quick response.
----
About the performance impact:
I've averaged real time of this invocation
`for i in $(seq 1 10); do time taskset -c 2 ./llvm-symbolizer-[main|patch] -e /home/itrofimow/work/perfs/llvm_symbolizer/nginx < addresses.txt > /dev/null; done`,
where
* `/home/itrofimow/work/perfs/llvm_symbolizer/nginx` is `nginx version: nginx/1.18.0 (Ubuntu)`, which is just a binary of somewhat moderate size (1.2Mb). The path is intentionally longer than `/usr/sbin/nginx` to avoid SSO,
* `addresses.txt` is `10'000'000` addresses of the same arbitrary (`ngx_http_process_request`) function,
* `taskset -c 2` is `isolcpus`-one,
* `llvm-symbolizer-[main|patch]` is the result of `cmake -G Ninja -S llvm -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_PROJECTS="llvm" -DLLVM_USE_LINKER=lld-16 -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16` on the current main/with the patch correspondingly,
and the results are:
`llvm-symbolizer-main`: 6.9244s
`llvm-symbolizer-patch`: 6.6213s
which is ~4% improvement. The benchmarking methodology is far from ideal, but should still prove the point of the `std::string` in question being not-noise
Current `main` flamegraph:
![llvm_symbolizer_main](https://raw.githubusercontent.com/itrofimow/random_assets/main/llvm_symbolizer_main.svg)
and the patch flamegraph (note the `getOrCreateModuleInfo` difference):
![llvm_symbolizer_patch](https://raw.githubusercontent.com/itrofimow/random_assets/main/llvm_symbolizer_patch.svg)
https://github.com/llvm/llvm-project/pull/104541
More information about the llvm-commits
mailing list