From 556ab45596b5d1f732b17f8be6bf32edfd83f1e0 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 5 Jun 2026 22:12:13 +0200 Subject: [PATCH] Drop the 5s cooldown before the background assembly-load sweep ScheduleBackgroundLoadSweep waited for TreeReady and then an extra unconditional 5s before populating sibling-assembly icons -- an artificial wall-clock delay on top of the TreeReady gate. Fire the sweep as soon as the tree is on screen; the TreeReady gate already keeps it off slow startups and the SemaphoreSlim(4) throttle still bounds the load storm. --- ILSpy/AssemblyTree/AssemblyTreeModel.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ILSpy/AssemblyTree/AssemblyTreeModel.cs b/ILSpy/AssemblyTree/AssemblyTreeModel.cs index 5157d478d..22e345c9f 100644 --- a/ILSpy/AssemblyTree/AssemblyTreeModel.cs +++ b/ILSpy/AssemblyTree/AssemblyTreeModel.cs @@ -498,8 +498,8 @@ namespace ILSpy.AssemblyTree /// quietly into "the user never sees a populated icon for assemblies they don't /// touch". /// - /// To strike a middle ground, schedule a one-shot sweep that fires after the tree - /// view is on screen () plus a small visibility cooldown. + /// To strike a middle ground, schedule a one-shot sweep that fires once the tree + /// view is on screen (). /// Gating on rather than a wall-clock delay keeps the sweep /// off slow startups (heavy layout, debugger attached) and ensures the user has /// genuinely seen the tree before the thread pool fills with sibling-assembly loads. @@ -510,14 +510,6 @@ namespace ILSpy.AssemblyTree try { await TreeReady.ConfigureAwait(false); - // Generous cooldown so the first decompile (selected via path-restore or - // --navigateto) has fully landed in the editor before the sweep fires. - // The earlier 500 ms cooldown overlapped with the decompile's - // Dispatcher.InvokeAsync marshal-back, triggering Server-GC pauses on the - // UI thread mid-apply-text. 5 s puts the sweep solidly past the typical - // foreground-work window without making sibling-icon population feel - // unreasonably delayed to a user scanning the list. - await Task.Delay(TimeSpan.FromSeconds(5)).ConfigureAwait(false); AppEnv.AppLog.Mark("Background-load sweep starting"); // Cap concurrent loads so a 200-assembly list doesn't kick off 200 // simultaneous Task.Run + GetLoadResultAsync chains. Each load reads PE