File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
compiler/rustc_data_structures/src Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -521,13 +521,18 @@ impl SelfProfilerRef {
521
521
let builder = EventIdBuilder :: new ( & profiler. profiler ) ;
522
522
let thread_id = get_thread_id ( ) ;
523
523
for ( query_invocation, hit_count) in query_hits. iter ( ) . enumerate ( ) {
524
- let event_id = builder. from_label ( StringId :: new_virtual ( query_invocation as u64 ) ) ;
525
- profiler. profiler . record_integer_event (
526
- profiler. query_cache_hit_count_event_kind ,
527
- event_id,
528
- thread_id,
529
- hit_count. load ( Ordering :: Relaxed ) ,
530
- ) ;
524
+ let hit_count = hit_count. load ( Ordering :: Relaxed ) ;
525
+ // No need to record empty cache hit counts
526
+ if hit_count > 0 {
527
+ let event_id =
528
+ builder. from_label ( StringId :: new_virtual ( query_invocation as u64 ) ) ;
529
+ profiler. profiler . record_integer_event (
530
+ profiler. query_cache_hit_count_event_kind ,
531
+ event_id,
532
+ thread_id,
533
+ hit_count,
534
+ ) ;
535
+ }
531
536
}
532
537
}
533
538
}
You can’t perform that action at this time.
0 commit comments