Repository navigation
⚡ Optimize Dominator Analysis inner loop - #234
Conversation
Replaced a costly `all_blocks.clone()` and `.intersection().cloned().collect()` combination with a significantly more efficient `Option<HashSet>` and `.retain()` approach. This calculates dataflow intersection in-place and avoids allocating large memory sets on every iteration for nodes with initialized predecessors. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Optimized the inner dataflow solver loop in
DominatorAnalysis::analyzeby using an in-placeretainapproach instead of repeatedly callingall_blocks.clone()and.intersection().🎯 Why: The previous code created large, unnecessary HashSet allocations on each iteration, causing significant memory and CPU overhead for large CFGs (like those generated with 2000+ blocks).
📊 Measured Improvement: Measured a ~25% reduction in analysis time for a 2000-block CFG (from 50.60 ms down to 37.75 ms).
PR created automatically by Jules for task 8715738396227382268 started by @Tcode-Motion