microsoft / Windows-Dev-Performance

A repo for developers on Windows to file issues that impede their productivity, efficiency, and efficacy
MIT License
438 stars 21 forks source link

PowerShell takes a long time to load profile #46

Closed nmoinvaz closed 3 years ago

nmoinvaz commented 3 years ago

Environment

Item Value
OS, Version / Build Microsoft Windows NT 10.0.19041.0
Processor Architecture AMD64
Processor Type & Model Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz, 2112 Mhz, 4 Core(s), 8 Logical Processor(s)
Memory 16.0 GB
Storage Type, free / capacity (e.g. C: SSD 128GB / 512GB) SSD 512GB
Relevant apps installed Windows Terminal

Description

When opening PowerShell, it takes quite some time before I get the first prompt. With Command Prompt it is nearly instant. Anything that can be done to improve load times can help all developers.

image

In this screenshot it took 14 seconds to load the profile.

Steps to reproduce

  1. Use PowerShell or Windows Terminal or Visual Studio Code Terminal to open a PowerShell command prompt.

I do not have any PowerShell extensions installed.

Expected behavior

  1. It should not take as long to open PowerShell.

Actual behavior

I have attached a process monitor log of PowerShell.exe.

LogFile.zip It seems that there is a lot of opening and closing of registry keys. Maybe that is one area that could be investigated. There is also one thread that appears to takes a few seconds to run.

bitcrazed commented 3 years ago

Hey @nmoinvaz Thanks for filing the issue, but could you file it over in the PowerShell repo where @joeyaiello @SteveL-MSFT can triage and address?