microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.89k stars 6.48k forks source link

PT Run is not instantly available after login #6886

Closed 29axe closed 3 years ago

29axe commented 3 years ago

ℹ Computer information

📝 Provide detailed reproduction steps (if any)

  1. Start computer
  2. Open user session
  3. Press alt + space

✔️ Expected result

Open PowerToys Run right after session opens

❌ Actual result

Opens default alt + space menu at the top corner of the current window (restore, collapse, close alt+f4, ...) PowerToys run is available after some time.

The thing is that PowerToys starts from scheduler task and is starting after all other startup apps. Is there a way to start it with system instead? or with a higher priority?

📷 Screenshots

image

crutkas commented 3 years ago

On a fresh login, applications take time to start up, PowerToys Run is no different. We may be able to improve startup time but it will never be instant.

crutkas commented 3 years ago

In the logs folder %localappdata%\Microsoft\PowerToys\PowerToys Run\Logs, on a fresh boot of PowerToys, you should see a line like this Message: Startup cost <4463ms> that will tell you how long we take from cold start to active. Can you share that

29axe commented 3 years ago

In the logs folder %localappdata%\Microsoft\PowerToys\PowerToys Run\Logs, on a fresh boot of PowerToys, you should see a line like this Message: Startup cost <4463ms> that will tell you how long we take from cold start to active. Can you share that

I don't have such message in any of the log files. Should I enable some advanced logging option?

crutkas commented 3 years ago

Do a full quit of powertoys and restart it. That will cycle all the utilities.

29axe commented 3 years ago

Tried it but it doesn't log this information. I also tried to reboot.

crutkas commented 3 years ago

Can you share the log file? I may be able to parse it out.

29axe commented 3 years ago

I sent you the log file following your issues guidelines. I also updated to the latest version today. I'll send another log file if I see anything interesting.

29axe commented 3 years ago

I installed v0.23.0 and after a reboot I see now the startup cost:

2020-10-06 08:27:01.0672|INFO|Wox.Infrastructure.Stopwatch.Normal| Message: |App.OnStartup|Startup cost <20305ms> Area: Wox.Infrastructure.Stopwatch.Normal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::40

crutkas commented 3 years ago

Can I get that file?

29axe commented 3 years ago

I thought you would receive it. I sent it to the email address for dumps/logs provided in the 'add issue' template. Anyway, here is a recent anonymized log:

2020-10-07 07:58:27.3542|INFO|PowerLauncher.App.OnStartup| Message: Begin PowerToys Run startup ---------------------------------------------------- Area: PowerLauncher.App.OnStartup Source Path: S:\src\modules\launcher\PowerLauncher\App.xaml.cs::85

2020-10-07 07:58:27.3769|INFO|PowerLauncher.App.OnStartup| Message: Runtime info: Version: 0.23.0.0 OS Version: Microsoft Windows NT 10.0.19041.0 IntPtr Length: 8 x64: True Area: PowerLauncher.App.OnStartup Source Path: S:\src\modules\launcher\PowerLauncher\App.xaml.cs::86

2020-10-07 07:58:27.8731|ERROR|Wox.Infrastructure.Image.ImageLoader.LoadInternal| Message: Failed to get thumbnail for C:\Users\USER\Documents\CLOUD-STORAGE\Y\Z\logo.ai Area: Wox.Infrastructure.Image.ImageLoader.LoadInternal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Image\ImageLoader.cs::193

2020-10-07 07:58:27.8884|ERROR|Wox.Infrastructure.Image.ImageLoader.LoadInternal|-------------------------- Begin exception -------------------------- 2020-10-07 07:58:27.9196|ERROR|Wox.Infrastructure.Image.ImageLoader.LoadInternal| Message: Failed to get thumbnail for C:\Users\USER\Documents\CLOUD-STORAGE\Y\Z\logo.ai 2020-10-07 07:58:28.2323|ERROR|Wox.Infrastructure.Image.ImageLoader.LoadInternal| Exception full name:

Exception message: Exception stack trace: < at Wox.Infrastructure.Image.WindowsThumbnailProvider.GetHBitmap(String fileName, Int32 width, Int32 height, ThumbnailOptions options) at Wox.Infrastructure.Image.WindowsThumbnailProvider.GetThumbnail(String fileName, Int32 width, Int32 height, ThumbnailOptions options) at Wox.Infrastructure.Image.ImageLoader.LoadInternal(String path, Boolean loadFullImage)> Exception source: Exception target site: Exception HResult: <-2147467259> 2020-10-07 07:58:28.2323|ERROR|Wox.Infrastructure.Image.ImageLoader.LoadInternal| Exception full name: Exception message: Exception stack trace: <> Exception source: <> Exception target site: <> Exception HResult: <-2147483638> 2020-10-07 07:58:28.2323|ERROR|Wox.Infrastructure.Image.ImageLoader.LoadInternal|-------------------------- End exception -------------------------- 2020-10-07 07:58:28.6649|INFO|Wox.Infrastructure.Stopwatch.Normal| Message: |Wox.Infrastructure.Alphabet.Initialize|Preload pinyin cache <410ms> Area: Wox.Infrastructure.Stopwatch.Normal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::40 2020-10-07 07:58:28.6740|INFO|Wox.Infrastructure.Alphabet.InitializePinyinHelpers| Message: Number of preload pinyin combination<0> Area: Wox.Infrastructure.Alphabet.InitializePinyinHelpers Source Path: S:\src\modules\launcher\Wox.Infrastructure\Alphabet.cs::44 2020-10-07 07:58:28.7907|INFO|Wox.Infrastructure.Stopwatch.Normal| Message: |ImageLoader.Initialize|Preload images cost <1020ms> Area: Wox.Infrastructure.Stopwatch.Normal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::40 2020-10-07 07:58:28.7907|INFO|Wox.Infrastructure.Image.ImageLoader+<>c.Initialize| Message: Number of preload images is <51>, Images Number: 54, Unique Items 32 Area: Wox.Infrastructure.Image.ImageLoader+<>c.Initialize Source Path: S:\src\modules\launcher\Wox.Infrastructure\Image\ImageLoader.cs::67 2020-10-07 07:58:30.0092|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram| Message: Error status: KNOWN Program path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows Media Player.lnk Exception thrown in called method: Void GetDescription(System.Text.StringBuilder, Int32) Possible interpretation of the error: An unexpected error occurred in the calling method LnkProgram Possible resolution: Can be ignored and Wox should still continue, however the program may not be loaded Area: Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram Source Path: S:\src\modules\launcher\Plugins\Microsoft.Plugin.Program\Programs\Win32Program.cs::475 2020-10-07 07:58:30.0250|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram|-------------------------- Begin exception -------------------------- 2020-10-07 07:58:30.0400|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram| Message: Error status: KNOWN Program path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows Media Player.lnk Exception thrown in called method: Void GetDescription(System.Text.StringBuilder, Int32) Possible interpretation of the error: An unexpected error occurred in the calling method LnkProgram Possible resolution: Can be ignored and Wox should still continue, however the program may not be loaded 2020-10-07 07:58:30.0875|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram| Exception full name: Exception message: Exception stack trace: < at Microsoft.Plugin.Program.Programs.ShellLinkHelper.IShellLinkW.GetDescription(StringBuilder pszName, Int32 cchMaxName) at Microsoft.Plugin.Program.Programs.ShellLinkHelper.RetrieveTargetPath(String path) at Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram(String path)> Exception source: Exception target site: Exception HResult: <-2147467259> 2020-10-07 07:58:30.1030|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram|-------------------------- End exception -------------------------- 2020-10-07 07:58:30.5774|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram| Message: Error status: KNOWN Program path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\ODBC Data Sources (32-bit).lnk Exception thrown in called method: Void GetDescription(System.Text.StringBuilder, Int32) Possible interpretation of the error: An unexpected error occurred in the calling method LnkProgram Possible resolution: Can be ignored and Wox should still continue, however the program may not be loaded Area: Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram Source Path: S:\src\modules\launcher\Plugins\Microsoft.Plugin.Program\Programs\Win32Program.cs::475 2020-10-07 07:58:30.5935|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram|-------------------------- Begin exception -------------------------- 2020-10-07 07:58:30.6092|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram| Message: Error status: KNOWN Program path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\ODBC Data Sources (32-bit).lnk Exception thrown in called method: Void GetDescription(System.Text.StringBuilder, Int32) Possible interpretation of the error: An unexpected error occurred in the calling method LnkProgram Possible resolution: Can be ignored and Wox should still continue, however the program may not be loaded 2020-10-07 07:58:30.6254|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram| Exception full name: Exception message: Exception stack trace: < at Microsoft.Plugin.Program.Programs.ShellLinkHelper.IShellLinkW.GetDescription(StringBuilder pszName, Int32 cchMaxName) at Microsoft.Plugin.Program.Programs.ShellLinkHelper.RetrieveTargetPath(String path) at Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram(String path)> Exception source: Exception target site: Exception HResult: <-2147467259> 2020-10-07 07:58:30.6561|ERROR|Microsoft.Plugin.Program.Programs.Win32Program.LnkProgram|-------------------------- End exception -------------------------- 2020-10-07 07:58:36.4415|INFO|Wox.Infrastructure.Stopwatch.Normal| Message: |Microsoft.Plugin.Program.Main|Win32Program index cost <7610ms> Area: Wox.Infrastructure.Stopwatch.Normal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::40 2020-10-07 07:58:37.1563|INFO|Wox.Infrastructure.Stopwatch.Normal| Message: |Microsoft.Plugin.Program.Main|Win32Program index cost <8325ms> Area: Wox.Infrastructure.Stopwatch.Normal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::40 2020-10-07 07:58:37.4411|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <4ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.4411|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <3ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.4411|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <3ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.4411|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <11ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.4580|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <18ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.4580|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <20ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.5004|INFO|Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins| Message: Total init cost for is <8451ms> Area: Wox.Core.Plugin.PluginManager+<>c__DisplayClass22_0.InitializePlugins Source Path: S:\src\modules\launcher\Wox.Core\Plugin\PluginManager.cs::107 2020-10-07 07:58:37.7888|INFO|PowerLauncher.App.OnStartup| Message: End PowerToys Run startup ---------------------------------------------------- Area: PowerLauncher.App.OnStartup Source Path: S:\src\modules\launcher\PowerLauncher\App.xaml.cs::122 2020-10-07 07:58:37.7888|INFO|Wox.Infrastructure.Stopwatch.Normal| Message: |App.OnStartup|Startup cost <10611ms> Area: Wox.Infrastructure.Stopwatch.Normal Source Path: S:\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::40
crutkas commented 3 years ago

on this instance, startup time was 10 seconds, prior was 20. Looking at this, almost all the time is actually spent in querying / searching for Win32 apps and getting the icons and names.

We can see what we can do about improving the perf here but this isn't something i would put as high priority since other apps don't instantly startup as well and we're competing for CPU cycles on start.

I'm going to create a new issue and basically call it "improve Win32 1start up speed for PT Run"