dotnet/runtime

Indexer.Set of List is much slower than Array

Open

#29,091 创建于 2019年3月27日

在 GitHub 查看
 (10 评论) (4 反应) (0 负责人)C# (5,445 fork)batch import
area-CodeGen-coreclrhelp wantedtenet-performance

仓库指标

Star
 (17,886 star)
PR 合并指标
 (平均合并 12天 11小时) (30 天内合并 661 个 PR)

描述

How to run the benchmarks:

git clone https://github.com/dotnet/performance.git
# if you have .NET Core 3.0 installed
dotnet run -c Release -f netcoreapp3.0 -p .\performance\src\benchmarks\micro\MicroBenchmarks.csproj --filter *IndexerSet*.List *IndexerSet*.Array --join
# if you don't have .NET Core 3.0 installed
py .\performance\scripts\benchmarks_ci.py -f netcoreapp3.0 --filter *IndexerSet*.List *IndexerSet*.Array --bdn-arguments="--join true"
Type Method Size Mean
IndexerSet<Int32> Array 512 198.7 ns
IndexerSet<String> Array 512 199.5 ns
IndexerSetReverse<Int32> Array 512 215.6 ns
IndexerSetReverse<String> Array 512 219.7 ns
IndexerSet<Int32> List 512 986.2 ns
IndexerSet<String> List 512 930.1 ns
IndexerSetReverse<Int32> List 512 947.0 ns
IndexerSetReverse<String> List 512 817.4 ns

Full docs for the new benchmarking workflow: https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-corefx.md

category:performance theme:benchmarks

贡献者指南