diff options
| author | blyxyas <blyxyas@gmail.com> | 2025-06-13 01:41:03 +0200 |
|---|---|---|
| committer | blyxyas <blyxyas@gmail.com> | 2025-06-13 02:08:35 +0200 |
| commit | 6cd55b966f75aeb94b3f2cd17b806f0330c009fb (patch) | |
| tree | e1edff875c00b57c4b3ec04424a79ef62168af2c /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | a76c2b34e718b9a04adf47fb1a4110e84c1557d2 (diff) | |
| download | rust-6cd55b966f75aeb94b3f2cd17b806f0330c009fb.tar.gz rust-6cd55b966f75aeb94b3f2cd17b806f0330c009fb.zip | |
Optimize by 99.75% strlen_on_c_strings, 8.5% globally
So this is funny, the query `tcx.module_children` was top 3 in most time consuming functions in Clippy, it was being called 24384 times in tokio. "Unacceptable!" I thought. Digging a bit around, turns out that `clippy::strlen_on_c_strings` was calling for `get_def_path` via `match_libc_symbol`. This query pretty-prints things and performs some analysis. Yes, we were running early lint checks to see if symbols were from `libc`. I don't really trust callgrind when it says I've turn 81 billion instructions into like 10 million. So I benchmarked this the good ol' "compiling 20 times without incr" method and it went from 0.31s-0.45s to 0.25s constistently. (Profiled, and "benchmarked") on tokio.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions
