dotnet/runtime

Span<ReferenceType>.CopyTo is 10-20% slower than Array<ReferenceType>.CopyTo

已关闭

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

 (21 条评论) (3 个反应) (0 位负责人)C# (5,445 个派生)batch import
area-CodeGen-coreclrhelp wantedtenet-performance

仓库指标

星标
 (17,886 个星标)
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 *CopyTo<String>*.Array *CopyTo<String>.Span --join --affinity 2
# if you don't have .NET Core 3.0 installed
py .\performance\scripts\benchmarks_ci.py -f netcoreapp3.0 --filter *CopyTo<String>*.Array *CopyTo<String>.Span --bdn-arguments="--join true --affinity 2"
Method Size Mean
Array 2048 511.1 ns
Span 2048 609.9 ns

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

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

贡献者指南