File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/librustc_data_structures/obligation_forest Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -484,13 +484,16 @@ impl<O: ForestObligation> ObligationForest<O> {
484
484
debug ! ( "process_cycles()" ) ;
485
485
486
486
for ( index, node) in self . nodes . iter ( ) . enumerate ( ) {
487
- // For rustc-benchmarks/inflate-0.1.0 this state test is extremely
488
- // hot and the state is almost always `Pending` or `Waiting`. It's
489
- // a win to handle the no-op cases immediately to avoid the cost of
490
- // the function call.
487
+ // For some benchmarks this state test is extremely
488
+ // hot. It's a win to handle the no-op cases immediately to avoid
489
+ // the cost of the function call.
491
490
match node. state . get ( ) {
492
- NodeState :: Waiting | NodeState :: Pending | NodeState :: Done | NodeState :: Error => { } ,
493
- _ => self . find_cycles_from_node ( & mut stack, processor, index) ,
491
+ // Match arms are in order of frequency. Pending, Success and
492
+ // Waiting dominate; the others are rare.
493
+ NodeState :: Pending => { } ,
494
+ NodeState :: Success => self . find_cycles_from_node ( & mut stack, processor, index) ,
495
+ NodeState :: Waiting | NodeState :: Done | NodeState :: Error => { } ,
496
+ NodeState :: OnDfsStack => self . find_cycles_from_node ( & mut stack, processor, index) ,
494
497
}
495
498
}
496
499
You can’t perform that action at this time.
0 commit comments