PowerShell / PowerShell/vscode-powershell

Extremelly slow module import in integrated console

Open
#1,556 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Engine Area-Threading Issue-Performance
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

Modules are loaded very slow (20-50 times slower), particularly if made by bunch of ps1 files that are included in psm1. The integrated console starts very slow too, around the same time slower then when adding new terminal which starts way faster even with bunch of stuff in my profile.

The following gif shows a) native powershell loads moudle in 1s, integrated in 22s

super-meh

This of course makes debugging virtually impossible, particularly if you have import-module xyz -force as you need to wait a long time for module to reimport on each F11. In my company everybody stopped debugging in vscode because of this.

This wasn't the case lets say a year from now, it started happening after some version and I hopped it was going to be intermittent quirk but its still there.

This was recorded on very good machine with 32 CPUs and 32GB Ram and fast SSD disc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source files, tests, or entry points. First reproduce the timing difference between native PowerShell and the integrated console with a module composed of included ps1 files, then trace the integrated console's module-import and startup path. Done means module imports and console startup no longer show the reported severe slowdown, with a regression test if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.