Skip to content

Feature Request: add [list] type accelerator #9853

@rkeithhill

Description

@rkeithhill

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 array

If 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions