Skip to content

Get-ChildItem 3x: Replace NoteProperties on FileSystem- and RegistryProvider by class backed CodeProperties. #7501

@powercode

Description

@powercode

When using Get-ChildItem, the ProviderBase adds these note properties:

PSChildName
PSDrive
PSIsContainer
PSParentPath
PSPath
PSProvider

This is quite expensive, both in terms of memory and execution time.

By replacing the noteproperties with a classes that lazily can compute most of the values, we can save both storage and time.

Timing:

Command 6.1-preview After change Speedup
GCI -rec -for d:\source\powershell 0.446 0.144 3.1 x
GCI -rec -for c:\windows -ea:0 12.24 6.05 2 x
GCI -rec hkcu:\ -ea:0 7.86 2.99 2.6 x

Cred to @lzybkr - this was his idea, not mine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FileSystem-Providerspecific to the FileSystem providerBreaking-Changebreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionResolution-No ActivityIssue has had no activity for 6 months or moreWG-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