rust/clippy_utils/src
blyxyas 6cd55b966f 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.
2025-06-13 02:08:35 +02:00
..
ast_utils Merge remote-tracking branch 'upstream/master' into rustup 2025-05-31 14:09:03 +02:00
mir Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
ty Rename unpack to kind 2025-05-27 11:14:45 +00:00
attrs.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
check_proc_macro.rs Move hir::Item::ident into hir::ItemKind. 2025-03-18 06:29:50 +11:00
comparisons.rs Merge commit 'd9c24d1b1e' into clippyup 2023-07-17 10:22:32 +02:00
consts.rs Use builin_index instead of hand-rolling it 2025-05-28 10:03:01 +00:00
diagnostics.rs Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
eager_or_lazy.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
higher.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
hir_utils.rs Merge commit '03a5b6b976' into clippy-subtree-update 2025-05-01 10:22:55 +02:00
lib.rs Optimize by 99.75% strlen_on_c_strings, 8.5% globally 2025-06-13 02:08:35 +02:00
macros.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
msrvs.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
numeric_literal.rs Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
paths.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
ptr.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
qualify_min_const_fn.rs missing_const_for_fn: consider constness of instance (#14759) 2025-06-03 14:03:51 +00:00
source.rs Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
str_utils.rs Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
sugg.rs Merge remote-tracking branch 'upstream/master' into rustup 2025-05-31 14:09:03 +02:00
sym.rs Use interned strings when possible, for efficiency purposes 2025-06-03 20:50:40 +02:00
usage.rs Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
visitors.rs Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00