Skip to content

Quadratic behavior during tab completion #13432

@xavierd

Description

@xavierd

Steps to reproduce

Open procmon and filter only syscall made by pwsh.exe,

cd C:/a/directory/with/lots/of/files
cd <tab>

Notice how pwsh.exe attempts to list all the files in C:/, then C:/a, then C:/directory, etc, for every directory present in C:/a/directory/with/lots/of/files. Assuming this is a pretty large directory, tab completion could take a very long time.

Screenshot of procmon:
pwsh

I have a feeling #12795 might be related to this issue.

Expected behavior

pwsh.exe should only be listing files/directory once in CWD to do the tab completion. This doesn't reproduce with PowerShell 5.1.

Screenshot of procmon:
powershell

Environment data

% $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productKeepOpenThe bot will ignore these and not auto-closeWG-Engine-Performancecore PowerShell engine, interpreter, and runtime performanceWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions