-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Feature Request: add [list] type accelerator #9853
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
Description
Summary of the new feature/enhancement
Arrays work fine for a lot of scenarios in PowerShell except with size gets large and the number of additions to the array is big. In the community, we encourage folks to use a list for "perf critical" scenarios. It would be nice if we could make it simpler for folks to use lists.
Proposed technical implementation details (optional)
A good start is to create a type accelerator for list. Now I don't know if the type accelerator mechanism supports type parameters allowing me to do this:
$list = [list[string]]::new() # explicitly create with explicit type parameter
$list = [list][foo.bar]::HugeArrayOfStrings # infer type parameter and initialize the list from the arrayIf it doesn't I suppose we could internally use PSObject as the type parameter. This wouldn't be as strongly typesafe but it would largely address the perf issue for reference types. Not so much for value types though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.