ITADN

perf: optimize git-gutter:view-for-unchanged with range-based processing

#243Pull Requesteval-exec 创建于 2025-09-05
E
eval-execcommented
## Summary - Replace O(n×m) line-by-line checking with O(m) range-based algorithm - Pre-compute unchanged line ranges from diff hunks instead of checking each line individually ## Performance Results **Before (profiler output):** ``` git-gutter:unchanged-line-p: 44% CPU (561,222 samples) git-gutter:view-for-unchanged: 48% CPU (615,209 samples) ``` **After (profiler output):** ``` git-gutter:view-for-unchanged: 1% CPU (36,736 samples) ``` **Performance improvement: ~97% reduction in CPU usage** ## Test Plan - [x] All existing tests pass - [x] Profiler confirms dramatic performance improvement - [x] Functionality remains unchanged
合并状态:未合并 0 条评论