Large colored diffs and revision file trees block the UI thread
Environment
- Git Extensions: upstream master
e265607b631a7fd32b60c317ba096209fabf0135, Release build - Windows 10 Enterprise LTSC 2021, 8-vCPU / 16-GiB VM
- Git 2.55.0.windows.5; .NET SDK 10.0.201
Issue description
Large colored patch documents spend substantial time scanning overlapping color markers and computing inline highlighting synchronously. Large revision file trees also build their managed nodes on the UI thread. These operations interrupt interaction even when Git data is already available.
In controlled WinForms measurements, a synthetic 60,000-line colored patch produced a median 5,834 ms UI timer gap. Restoring a 96,045-file revision tree by clearing its filter produced a 403 ms gap. This report concerns normal patch diffs and large revision file trees; it does not establish the cause of the merge-specific issue #6837.
Steps to reproduce / measurement workload
- Host the actual
FileViewer(includingFileViewerInternal) orFileStatusListin a visible 1100×800 STA WinForms form, using Release binaries. - For the viewer, load a valid unified diff containing 30,000 adjacent removed/added pairs, changing numbers between the lines, with red/green reverse ANSI line colors matching the application defaults (approximately 3.5 million characters).
- For the tree, populate it with 96,045 real Linux kernel paths from revision
fd179f8a05be3ccae366b9b96e176b51fbe54aab, apply a selective filter, and then clear it to restore the full tree. A mock Git module supplies the paths, excluding Git I/O. - Measure the operation and the longest gap in a 16 ms WinForms timer. Run one warm-up followed by five measured samples; report medians. Keep the timer running for 80 ms after completion to include queued painting.
These are warm-cache control benchmarks, not timings for application startup, staging, or arbitrary real commits. An ordinary UI reproduction is to view a very large colored patch or clear a filter in a repository with a large File tree; exact timings depend on the document, repository and hardware.
Diagnostics
The marker overlap lookup scans all markers repeatedly. An incremental lookup reduced complete highlighting from 5,834 ms to 1,085 ms in the matched full viewer. Computing inline markers in the background further reduced the initial synchronous load to 336 ms, with complete marker publication at 1,062 ms. Moving detached file-tree construction off the UI thread reduced the longest timer gap to 87 ms while total completion remained approximately 390 ms.
No historical regression version has been established. A PR with the implementation, correctness tests, full measurements and limitations follows.
This work was done using GPT 6 Astra.
Source: gitextensions/gitextensions