Skip to content

Performance regression: few Span Indexer benchmarks are 30% slower #13090

@adamsitnik

Description

@adamsitnik

Some of the Span Indexer benchmarks are 30% slower when compared to 2.2.

https://github.com/dotnet/performance/blob/master/src/benchmarks/micro/coreclr/Span/Indexer.cs

Repro

git clone https://github.com/dotnet/performance.git
cd performance
# if you don't have cli installed and want python script to download the latest cli for you
py .\scripts\benchmarks_ci.py -f netcoreapp2.2 netcoreapp3.0 --filter *IndexerBench*
# if you do
dotnet run -p .\src\benchmarks\micro\MicroBenchmarks.csproj -c Release -f netcoreapp2.2 --filter *IndexerBench* --runtimes netcoreapp2.2 netcoreapp3.0
BenchmarkDotNet=v0.11.3.1003-nightly, OS=Windows 10.0.18362
Intel Xeon CPU E5-1650 v4 3.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.0.100-preview8-013262
   [Host]     : .NET Core 2.2.6 (CoreCLR 4.6.27817.03, CoreFX 4.6.27818.02), 64bit RyuJIT
   Job-BYJCMJ : .NET Core 2.2.6 (CoreCLR 4.6.27817.03, CoreFX 4.6.27818.02), 64bit RyuJIT
   Job-JSSCYO : .NET Core 3.0.0-preview8-27916-02 (CoreCLR 4.700.19.36302, CoreFX 4.700.19.36514), 64bit RyuJIT
Method Toolchain length Mean Ratio
Ref netcoreapp2.2 1024 426.5 ns 1.00
Ref netcoreapp3.0 1024 548.0 ns 1.28
Fixed1 netcoreapp2.2 1024 422.8 ns 1.00
Fixed1 netcoreapp3.0 1024 545.8 ns 1.29
Fixed2 netcoreapp2.2 1024 424.3 ns 1.00
Fixed2 netcoreapp3.0 1024 546.4 ns 1.29
Indexer1 netcoreapp2.2 1024 424.2 ns 1.00
Indexer1 netcoreapp3.0 1024 546.5 ns 1.29
Indexer2 netcoreapp2.2 1024 425.0 ns 1.00
Indexer2 netcoreapp3.0 1024 545.6 ns 1.28
Indexer3 netcoreapp2.2 1024 421.0 ns 1.00
Indexer3 netcoreapp3.0 1024 545.0 ns 1.29
Indexer4 netcoreapp2.2 1024 4,162.4 ns 1.00
Indexer4 netcoreapp3.0 1024 5,453.6 ns 1.31
Indexer5 netcoreapp2.2 1024 492.8 ns 1.00
Indexer5 netcoreapp3.0 1024 551.0 ns 1.12
Indexer6 netcoreapp2.2 1024 548.7 ns 1.00
Indexer6 netcoreapp3.0 1024 550.4 ns 1.00
ReadOnlyIndexer1 netcoreapp2.2 1024 422.7 ns 1.00
ReadOnlyIndexer1 netcoreapp3.0 1024 547.6 ns 1.29
ReadOnlyIndexer2 netcoreapp2.2 1024 419.7 ns 1.00
ReadOnlyIndexer2 netcoreapp3.0 1024 546.9 ns 1.30
WriteViaIndexer1 netcoreapp2.2 1024 1,602.3 ns 1.00
WriteViaIndexer1 netcoreapp3.0 1024 1,607.8 ns 1.00
WriteViaIndexer2 netcoreapp2.2 1024 581.7 ns 1.00
WriteViaIndexer2 netcoreapp3.0 1024 583.5 ns 1.00
KnownSizeArray netcoreapp2.2 1024 416.8 ns 1.00
KnownSizeArray netcoreapp3.0 1024 545.5 ns 1.31
KnownSizeCtor netcoreapp2.2 1024 417.5 ns 1.00
KnownSizeCtor netcoreapp3.0 1024 544.0 ns 1.30
KnownSizeCtor2 netcoreapp2.2 1024 426.4 ns 1.00
KnownSizeCtor2 netcoreapp3.0 1024 486.2 ns 1.14
SameIndex1 netcoreapp2.2 1024 693.3 ns 1.00
SameIndex1 netcoreapp3.0 1024 787.4 ns 1.14
SameIndex2 netcoreapp2.2 1024 820.6 ns 1.00
SameIndex2 netcoreapp3.0 1024 821.9 ns 1.00
CoveredIndex1 netcoreapp2.2 1024 977.9 ns 1.00
CoveredIndex1 netcoreapp3.0 1024 978.1 ns 1.00
CoveredIndex2 netcoreapp2.2 1024 833.1 ns 1.00
CoveredIndex2 netcoreapp3.0 1024 825.5 ns 0.99
CoveredIndex3 netcoreapp2.2 1024 1,098.8 ns 1.00

/cc @AndyAyersMS @danmosemsft

category:cq
theme:register-allocator
skill-level:expert
cost:large

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions