From 01b0048cbe84ec96f85defa767ea4e45cffa8605 Mon Sep 17 00:00:00 2001 From: Saravanan Ganapathi Date: Thu, 11 Sep 2025 21:37:08 +0530 Subject: [PATCH] Code Quality: Moved IAddItemService.InitializeAsync() and ContextMenu.WarmUpQueryContextMenuAsync() to run sequentially at the end, reducing resource contention --- src/Files.App/Helpers/Application/AppLifecycleHelper.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Files.App/Helpers/Application/AppLifecycleHelper.cs b/src/Files.App/Helpers/Application/AppLifecycleHelper.cs index 3b68bc259d31..ea722d1e378a 100644 --- a/src/Files.App/Helpers/Application/AppLifecycleHelper.cs +++ b/src/Files.App/Helpers/Application/AppLifecycleHelper.cs @@ -116,7 +116,11 @@ await Task.WhenAll( App.LibraryManager.UpdateLibrariesAsync(), OptionalTaskAsync(WSLDistroManager.UpdateDrivesAsync(), generalSettingsService.ShowWslSection), OptionalTaskAsync(App.FileTagsManager.UpdateFileTagsAsync(), generalSettingsService.ShowFileTagsSection), - jumpListService.InitializeAsync(), + jumpListService.InitializeAsync() + ); + + //Start the tasks separately to reduce resource contention + await Task.WhenAll( addItemService.InitializeAsync(), ContextMenu.WarmUpQueryContextMenuAsync() );