Skip to content

[Performance] Take advantage of new array range check elimination in other collections #20702

@jamesqo

Description

@jamesqo

See dotnet/coreclr#9539 (comment); doing if ((uint)index >= (uint)array.Length) { throw something; } will now elide the range check for array[index] afterwards. Probably won't yield a huge benefit in most placecs, but the perf gains would be essentially free. We should probably do this in collections that are backed by arrays, e.g. here is one place where the new JIT behavior could be put to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.CollectionsenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions