Skip to content

Performance issues with Range type #11848

@AndyAyersMS

Description

@AndyAyersMS

Ideally the following two methods should generate similar code.

[MethodImpl(MethodImplOptions.NoInlining)]
static Span<int> TrimFirstLast_OpenCoded(Span<int> s) => s.Slice(1, s.Length - 1);
 
[MethodImpl(MethodImplOptions.NoInlining)]
static Span<int> TrimFirstLast_Range(Span<int> s) => s[Range.Create(1, new Index(1, true))];

Currently the Range-based version runs into a number of issues:

cc @stephentoub

Will fill in more details later.

Marking as 3.0 for now.

category:cq
theme:optimization
skill-level:expert
cost:large

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimization

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions