From b5a574355e7e8246cce35d3c7a8509b1c3394406 Mon Sep 17 00:00:00 2001 From: Marek Lemanczyk Date: Tue, 8 Sep 2026 22:49:08 +0200 Subject: [PATCH] Migrated to git.privacyguard.company --- .github/workflows/dotnet.yml | 56 +- .gitignore | 700 +- .vscode/launch.json | 50 +- .vscode/settings.json | 1 + .vscode/tasks.json | 144 +- AGENTS.md | 58 +- LICENSE.md | 18 +- README.md | 866 +- .../Benchmarks/Add.cs | 124 +- .../Benchmarks/AddRangeWhenSourceIsArray.cs | 84 +- .../AddRangeWhenSourceIsIEnumerable.cs | 94 +- .../Benchmarks/AddRangeWhenSourceIsIList.cs | 84 +- .../Benchmarks/AddRangeWhenSourceIsList.cs | 84 +- .../AddRangeWhenSourceIsSameType.cs | 56 +- .../Benchmarks/AddRange_WithCapacity.cs | 94 +- .../Benchmarks/Add_WithCapacity.cs | 102 +- .../BinarySearch_BestAndWorstCases.cs | 130 +- .../Benchmarks/Contains_FirstItems.cs | 120 +- .../Benchmarks/Contains_LastItems.cs | 120 +- .../Benchmarks/ConvertAll.cs | 96 +- .../Benchmarks/Count.cs | 70 +- .../Benchmarks/Create.cs | 78 +- .../Benchmarks/Create_WithCapacity.cs | 74 +- .../Benchmarks/Exists_BestAndWorstCases.cs | 130 +- .../Benchmarks/FindAll_BestAndWorstCases.cs | 160 +- .../FindLastIndex_BestAndWorstCases.cs | 126 +- .../Benchmarks/FindLast_BestAndWorstCases.cs | 106 +- .../Benchmarks/Find_BestAndWorstCases.cs | 106 +- .../Benchmarks/ForEach.cs | 170 +- .../Benchmarks/GetItem..cs | 316 +- .../Benchmarks/IndexOf_BestAndWorstCases.cs | 154 +- .../Benchmarks/IndexOf_FirstItems.cs | 142 +- .../Benchmarks/IndexOf_LastItems.cs | 142 +- .../Benchmarks/LongCount.cs | 34 +- .../RecyclableCollections.Benchmarks.cs | 204 +- .../Benchmarks/RemoveAt_FirstItems.cs | 102 +- .../Benchmarks/RemoveAt_LastItems.cs | 102 +- .../Benchmarks/Remove_FirstItems.cs | 102 +- .../Benchmarks/Remove_LastItems.cs | 102 +- .../Benchmarks/SetItem.cs | 112 +- .../Core/DataGenerator.cs | 36 +- .../POC/ArraySizeLimitPoc.Benchmarks.cs | 140 +- .../POC/BoolOrComparePoc.Benchmarks.cs | 124 +- .../POC/DelegateVsComparerPoc.Benchmarks.cs | 692 +- ...lVsContainsInConsecutiveOrderBenchmarks.cs | 80 +- ...peratorvsDoesntEqualOperator.Benchmarks.cs | 114 +- .../LessOperatorvsAndOperatorBenchmarks.cs | 108 +- .../POC/ModuloPoc.Benchmarks.cs | 750 +- .../POC/PocBenchmarkBase.cs | 284 +- .../POC/RecyclableLongListPoc.Benchmarks.cs | 94 +- ...cyclableLongListPos.Benchmarks.IndexOf.txt | 52 +- .../POC/RefVsInstanceMemberPoc.Benchmarks.cs | 728 +- .../POC/RoundBenchmarks.cs | 90 +- .../POC/RoundUpToPowerOf2vsOthers.cs | 292 +- ...SpanConstructorVsTypecasting.Benchmarks.cs | 126 +- .../POC/SpanVsArrayBenchmarks.cs | 198 +- .../POC/SpanVsArrayBenchmarks.txt | 2448 +-- ...TaskRunVsTaskFactoryStartNew.Benchmarks.cs | 124 +- Recyclable.Collections.Benchmarks/Program.cs | 130 +- .../Properties/launchSettings.json | 22 +- .../Recyclable.Collections.Benchmarks.csproj | 44 +- .../RecyclableBenchmarkBase.cs | 680 +- .../Results/Benchmarks.md | 17158 ++++++++-------- Recyclable.Collections.sln | 102 +- Recyclable.Collections/CompareResult.cs | 18 +- .../ComparisonToComparerAdapter.cs | 64 +- Recyclable.Collections/ExceptionExtensions.cs | 24 +- .../FrequencyTupleComparer.cs | 20 +- Recyclable.Collections/GlobalSuppressions.cs | 16 +- .../IRandomNumberGenerator.cs | 12 +- Recyclable.Collections/IRecyclableOwner.cs | 20 +- .../IRecyclableVersionedList.cs | 14 +- .../IRecyclableVersionedLongList.cs | 14 +- .../Linq/QuickSortExtensions.cs | 264 +- Recyclable.Collections/MathUtils.cs | 70 +- Recyclable.Collections/MemoryBucket.cs | 48 +- .../Parallel/BarrierSlimmer.cs | 234 +- .../Parallel/IndexOfSynchronizationContext.cs | 220 +- .../IndexOfSynchronizationContextPool.cs | 98 +- .../Parallel/ManualResetEventSlimmer.cs | 76 +- .../Parallel/ManualResetEventSlimmerPool.cs | 58 +- .../Parallel/SpinLockSlimmer.cs | 52 +- .../BiDirectionalRecyclableArrayPoolChunk.cs | 40 +- ...DirectionalRecyclableArrayPoolChunkPool.cs | 74 +- Recyclable.Collections/Pools/MemoryUtils.cs | 62 +- .../Pools/OneSizeArrayPool.cs | 288 +- .../Pools/RecyclableArrayPool.cs | 106 +- .../Pools/RecyclableArrayPoolChunk.cs | 38 +- .../Pools/RecyclableArrayPoolChunkPool.cs | 68 +- .../Recyclable.Collections.csproj | 84 +- Recyclable.Collections/RecyclableDefaults.cs | 28 +- .../RecyclableDictionary.AddRange.cs | 2284 +- .../RecyclableDictionary.cs | 812 +- .../RecyclableHashSet.AddRange.cs | 3264 +-- Recyclable.Collections/RecyclableHashSet.cs | 724 +- .../RecyclableLinkedList.AddRange.cs | 2292 +-- .../RecyclableLinkedList.cs | 646 +- .../RecyclableList.AddRange.cs | 1412 +- .../RecyclableList.Compatibility.List.Find.cs | 544 +- ...cyclableList.Compatibility.List.IndexOf.cs | 52 +- ...ableList.Compatibility.List.InsertRange.cs | 754 +- .../RecyclableList.Compatibility.List.cs | 460 +- .../RecyclableList.Enumerator.cs | 106 +- .../RecyclableList.Extensions.cs | 90 +- .../RecyclableList.Helpers.cs | 178 +- .../RecyclableList.IList.cs | 244 +- .../RecyclableList.VersionedEnumerator.cs | 138 +- Recyclable.Collections/RecyclableList.cs | 830 +- .../RecyclableLongList.AddRange.cs | 2586 +-- ...lableLongList.Compatibility.List.Sorted.cs | 94 +- .../RecyclableLongList.Enumerator.cs | 180 +- .../RecyclableLongList.Extensions.cs | 90 +- .../RecyclableLongList.Helpers.cs | 414 +- .../RecyclableLongList.IList.cs | 236 +- .../RecyclableLongList.IndexOfHelpers.cs | 698 +- .../RecyclableLongList.VersionedEnumerator.cs | 220 +- Recyclable.Collections/RecyclableLongList.cs | 1420 +- .../RecyclablePriorityQueue.AddRange.cs | 2670 +-- .../RecyclablePriorityQueue.cs | 488 +- .../RecyclableQueue.AddRange.cs | 1856 +- .../RecyclableQueue.Helpers.cs | 220 +- Recyclable.Collections/RecyclableQueue.cs | 514 +- .../RecyclableSortedDictionary.cs | 574 +- .../RecyclableSortedList.cs | 562 +- Recyclable.Collections/RecyclableSortedSet.cs | 430 +- .../RecyclableStack.AddRange.cs | 2092 +- Recyclable.Collections/RecyclableStack.cs | 476 +- Recyclable.Collections/SearchConfiguration.cs | 56 +- .../SystemRandomNumberGenerator.cs | 16 +- Recyclable.Collections/ThrowHelper.cs | 32 +- Recyclable.CollectionsTests/CustomIList.cs | 64 +- .../EnumerableWithoutCount.cs | 32 +- Recyclable.CollectionsTests/MathUtilsTests.cs | 170 +- .../Recyclable.CollectionsTests.csproj | 82 +- .../RecyclableDictionaryTests.cs | 646 +- .../RecyclableHashSetTests.cs | 586 +- .../RecyclableLinkedListTests.cs | 1178 +- .../RecyclableListTests.cs | 3686 ++-- .../RecyclableLongListTestData.cs | 562 +- .../RecyclableLongListTests.cs | 2144 +- .../RecyclablePriorityQueueTests.cs | 990 +- .../RecyclableQueueTests.cs | 1324 +- .../RecyclableSortedDictionaryTests.cs | 192 +- .../RecyclableSortedListTests.cs | 194 +- .../RecyclableSortedSetTests.cs | 136 +- .../RecyclableStackTests.cs | 1634 +- Recyclable.CollectionsTests/xunit.runner.json | 12 +- .../RecyclableCollectionsGenerator.cs | 38 +- .../SourceCodeGenerator.Net.csproj | 34 +- .../VersionedCollectionsGenerator.cs | 266 +- .../VersionedCollectionsGenerator.csproj | 38 +- 151 files changed, 38551 insertions(+), 38550 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a190a6f..07f51cd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,28 +1,28 @@ -# This workflow will build a .NET project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net - -name: .NET - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --framework net8.0 --verbosity normal +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --framework net8.0 --verbosity normal diff --git a/.gitignore b/.gitignore index dfcfd56..cb43218 100644 --- a/.gitignore +++ b/.gitignore @@ -1,350 +1,350 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/.vscode/launch.json b/.vscode/launch.json index 34abc08..a65dc43 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,26 +1,26 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Recyclable.Collections.Benchmarks/bin/Debug/net8.0/Recyclable.Collections.Benchmarks.dll", - "args": [], - "cwd": "${workspaceFolder}/Recyclable.Collections.Benchmarks", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/Recyclable.Collections.Benchmarks/bin/Debug/net8.0/Recyclable.Collections.Benchmarks.dll", + "args": [], + "cwd": "${workspaceFolder}/Recyclable.Collections.Benchmarks", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d67f306..3b18015 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,73 +1,73 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "isBuildCommand": true, - "label": "build", - "dependsOn": ["build debug", "build release"], - "problemMatcher": "$msCompile", - "group": { - "kind": "build", - "isDefault": true - } - }, - { - "isBuildCommand": true, - "label": "build debug", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/Recyclable.Collections.sln", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary", - ], - "problemMatcher": "$msCompile", - "group": { - "kind": "build", - "isDefault": false - } - }, - { - "label": "build release", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/Recyclable.Collections.sln", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary", - "-c", "Release", - ], - "problemMatcher": "$msCompile", - "group": { - "kind": "build", - "isDefault": false - } - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/Recyclable.Collections.sln", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "--project", - "${workspaceFolder}/Recyclable.Collections.sln" - ], - "problemMatcher": "$msCompile" - } - ] +{ + "version": "2.0.0", + "tasks": [ + { + "isBuildCommand": true, + "label": "build", + "dependsOn": ["build debug", "build release"], + "problemMatcher": "$msCompile", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "isBuildCommand": true, + "label": "build debug", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Recyclable.Collections.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary", + ], + "problemMatcher": "$msCompile", + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "build release", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Recyclable.Collections.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary", + "-c", "Release", + ], + "problemMatcher": "$msCompile", + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/Recyclable.Collections.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/Recyclable.Collections.sln" + ], + "problemMatcher": "$msCompile" + } + ] } \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 3b9641b..7ef3097 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,29 +1,29 @@ -# AGENTS - -This repository hosts various libraries distributed as NuGet packages. Keep these links up to date so contributors and tools can easily locate them. - -Only the .NET SDK **8.0** is available in the execution environment. Use this version when building or running tests. - -## Implementation Guidelines -1. All `*.csproj` files should enable nullable reference types with `enable`. -1. Implementations should be optimized for maximum performance even if that introduces some code duplication. -1. Consider applying attributes such as `MethodImplOptions.AggressiveInlining` or faster alternatives to common operations when appropriate. Another would be modulo "%" or division "/" operations, which could be often replaced with faster alternatives, possibly under specific conditions. - -## Running Tests -1. When running `dotnet test`, do **not** pass `--no-build` because that leads to missing assemblies, test failures without logs and other issues. -1. When running `dotnet test` specify the `--framework` argument matching the SDK available in the environment (currently `net8.0`). If you omit this parameter, the tests will fail running with no logs etc. -1. The tests run for a very long time, because there are 61_000+ unit tests for all the collections. Set timeout when running them to 15 mis. -1. All tests must use **xUnit** together with **FluentAssertions**. - -## Source Code Formatting Guidelines -1. Indent code using four spaces or a single tab per level. -1. Place one blank line after each closing curly brace of a code block, except when several closing braces appear sequentially. -1. Always use braces for `if` and `else` bodies. - -## NuGet packages -- [Recyclable.Collections](https://github.com/mlemanczyk/Recyclable.Collections) -- [Recyclable.Collections.Compatibility.List](https://github.com/mlemanczyk/Recyclable.Collections.Compatibility.List) -- [Recyclable.Collections.Concurrent](https://github.com/mlemanczyk/Recyclable.Collections.Concurrent) -- [Recyclable.Collections.Linq](https://github.com/mlemanczyk/Recyclable.Collections.Linq) -- [Recyclable.Collections.Searching](https://github.com/mlemanczyk/Recyclable.Collections.Searching) -- [Recyclable.Collections.TestData](https://github.com/mlemanczyk/Recyclable.Collections.TestData) +# AGENTS + +This repository hosts various libraries distributed as NuGet packages. Keep these links up to date so contributors and tools can easily locate them. + +Only the .NET SDK **8.0** is available in the execution environment. Use this version when building or running tests. + +## Implementation Guidelines +1. All `*.csproj` files should enable nullable reference types with `enable`. +1. Implementations should be optimized for maximum performance even if that introduces some code duplication. +1. Consider applying attributes such as `MethodImplOptions.AggressiveInlining` or faster alternatives to common operations when appropriate. Another would be modulo "%" or division "/" operations, which could be often replaced with faster alternatives, possibly under specific conditions. + +## Running Tests +1. When running `dotnet test`, do **not** pass `--no-build` because that leads to missing assemblies, test failures without logs and other issues. +1. When running `dotnet test` specify the `--framework` argument matching the SDK available in the environment (currently `net8.0`). If you omit this parameter, the tests will fail running with no logs etc. +1. The tests run for a very long time, because there are 61_000+ unit tests for all the collections. Set timeout when running them to 15 mis. +1. All tests must use **xUnit** together with **FluentAssertions**. + +## Source Code Formatting Guidelines +1. Indent code using four spaces or a single tab per level. +1. Place one blank line after each closing curly brace of a code block, except when several closing braces appear sequentially. +1. Always use braces for `if` and `else` bodies. + +## NuGet packages +- [Recyclable.Collections](https://github.com/mlemanczyk/Recyclable.Collections) +- [Recyclable.Collections.Compatibility.List](https://github.com/mlemanczyk/Recyclable.Collections.Compatibility.List) +- [Recyclable.Collections.Concurrent](https://github.com/mlemanczyk/Recyclable.Collections.Concurrent) +- [Recyclable.Collections.Linq](https://github.com/mlemanczyk/Recyclable.Collections.Linq) +- [Recyclable.Collections.Searching](https://github.com/mlemanczyk/Recyclable.Collections.Searching) +- [Recyclable.Collections.TestData](https://github.com/mlemanczyk/Recyclable.Collections.TestData) diff --git a/LICENSE.md b/LICENSE.md index b345ef8..34f30fc 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,10 +1,10 @@ -# License -The project & source code is free for educational & personal use. **Any kind** of commercial use requires a donation, as prescribed below. - -# Donation requirements for a life-time, commercial use -* Commercial license is paid one time. -* It can be obtained by donaiting $10 for each developer seat, using the link provided below. If you hire 2 developers, you need to donate $20 for a life-time, commercial use of this package. -* Your license stays with you, if your developer moves somewhere else. - -# Link for donations +# License +The project & source code is free for educational & personal use. **Any kind** of commercial use requires a donation, as prescribed below. + +# Donation requirements for a life-time, commercial use +* Commercial license is paid one time. +* It can be obtained by donaiting $10 for each developer seat, using the link provided below. If you hire 2 developers, you need to donate $20 for a life-time, commercial use of this package. +* Your license stays with you, if your developer moves somewhere else. + +# Link for donations [![Donate](buy-me-a-coffee.svg)](https://www.buymeacoffee.com/mlemanczyk) \ No newline at end of file diff --git a/README.md b/README.md index 6555228..22aa7ad 100644 --- a/README.md +++ b/README.md @@ -1,433 +1,433 @@ -# Recyclable.Collections -`Recyclable.Collections` project is an open source framework for operating dynamic lists at performance close to raw arrays, but fairly unlimited in size. It aims at providing minimal memory footprint. It implements `IList` interface and is targeted as direct replacements of `List`, `SortableList`, `PriorityQueue` & similar. - -## Included -* `RecyclableList` -* `RecyclableLongList` - -## NuGet packages -- [Recyclable.Collections](https://github.com/mlemanczyk/Recyclable.Collections) -- [Recyclable.Collections.Compatibility.List](https://github.com/mlemanczyk/Recyclable.Collections.Compatibility.List) -- [Recyclable.Collections.Concurrent](https://github.com/mlemanczyk/Recyclable.Collections.Concurrent) -- [Recyclable.Collections.Linq](https://github.com/mlemanczyk/Recyclable.Collections.Linq) -- [Recyclable.Collections.Searching](https://github.com/mlemanczyk/Recyclable.Collections.Searching) -- [Recyclable.Collections.TestData](https://github.com/mlemanczyk/Recyclable.Collections.TestData) - -# Milestones -1. ✅ Create basic classes - 1. ✅ `RecyclableList` - 1. ✅ `RecyclableLongList` - 1. 🅿️ `RecyclableQueue` - 1. 🅿️ `RecyclableSortedList` - 1. 🅿️ `RecyclableStack` - 1. 🅿️ `RecyclableUnorderedList` -1. ✅ Create basic unit tests - 1. ✅ `RecyclableList` - 1. ✅ `RecyclableLongList` - 1. 🅿️ `RecyclableQueue` - 1. 🅿️ `RecyclableSortedList` - 1. 🅿️ `RecyclableStack` - 1. 🅿️ `RecyclableUnorderedList` -1. ✅ Optimize `RecyclableList` - 1. ✅ `Add` - 1. ✅ `AddRange` - 1. ✅ when source is `array` - 1. ✅ when source is `List` - 1. ✅ when source is `IList` - 1. ✅ when source is `RecyclableList` - 1. ✅ when source is `RecyclableLongList` - 1. ✅ when source is `IEnumerable` - 1. ✅ when source has non-enumerated count - 1. ✅ `Clear` - 1. ✅ `Contains` - 1. ✅ `CopyTo` - 1. ✅ `Dispose` - 1. ✅ `EnsureCapacity` - 1. ✅ `GetEnumerator` - 1. ✅ `IndexOf` - 1. ✅ `Insert` - 1. ✅ `Remove` - 1. ✅ `RemoveAt` - 1. ✅ `Resize` - 1. ✅ `this[int index]` -1. ✅ Port `RecyclableList` implementation to `RecyclableLongList` -1. 👉 Optimize `RecyclableLongList` - 1. ✅ `Add` - 1. ✅ `AddRange` - 1. ✅ when source is `array` - 1. ✅ when source is `List` - 1. ✅ when source is `IList` - 1. ✅ when source is `RecyclableList` - 1. ✅ when source is `RecyclableLongList` - 1. ✅ when source is `IEnumerable` - 1. ✅ when source has non-enumerated count - 1. ✅ `Clear` - 1. ✅ `Contains` - 1. 🅿️ `CopyTo` - 1. ✅ `Dispose` - 1. ✅ `EnsureCapacity` - 1. ✅ `GetEnumerator` - 1. ✅ `IndexOf` - 1. ✅ `LongIndexOf` - 1. ✅ `Insert` - 1. ✅ `Remove` - 1. ✅ `RemoveAt(int index)` - 1. ✅ `RemoveAt(long index)` - 1. ✅ `RemoveAt` - 1. ✅ `Resize` - 1. ✅ `this[int index]` - 1. ✅ `this[long index]` - 1. ✅ Rename `RecyclableList` to `RecyclableLongList` - 1. ✅ Rename `RecyclableArrayList` to `RecyclableList` - 1. ✅ Fix failing tests - 1. ✅ Hide not ready classes - 1. ✅ `RecyclableQueue` - 1. ✅ `RecyclableSortedList` - 1. ✅ `RecyclableStack` - 1. ✅ `RecyclableUnorderedList` - 1. ✅ Add support for `ReadOnlySpan` - 1. ✅ Release 0.0.3-alpha - 1. ✅ Implement `List` interfaces - 1. ✅ `IList` - 1. ✅ `ICollection` - 1. ✅ `IEnumerable` - 1. ✅ `IEnumerable` - 1. ✅ `IReadOnlyList` - 1. ✅ `IReadOnlyCollection` - 1. ✅ `IList` - 1. ✅ `ICollection` - 1. ✅ Implement list versioning to allow data change identification - 1. ✅ Make sure that `NeedsClearing` is used & items are cleared in - 1. ✅ `RecyclableList` - 1. ✅ `Clear` - 1. ✅ `Dispose` - 1. ✅ `Remove` - 1. ✅ `RemoveAt` - 1. ✅ Properties - 1. ✅ Non-versioned & Versioned Enumerators - 1. ✅ `RecyclableListHelpers` - 1. ✅ `EnsureCapacity` - 1. ✅ `Resize` - 1. ✅ `IList` implementation - 1. ✅ `RecyclableLongList` - 1. ✅ `Clear` - 1. ✅ `Dispose` - 1. ✅ `Remove` - 1. ✅ `RemoveAt` - 1. ✅ `RemoveBlock` - 1. ✅ Properties - 1. ✅ Non-versioned & Versioned Enumerators - 1. ✅ `RecyclableLongListHelpers` - 1. ✅ `CopyFollowingItems` - 1. ✅ `CopyTo` - 1. ✅ `EnsureCapacity` - 1. ✅ `Resize` - 1. ✅ `RecyclableLongList.IndexOfHelpers` - 1. ✅ Complete the implementation of `RecyclableLongList` - 1. ✅ `InsertAt` to allow inserting items anywhere - 1. ✅ `RemoveAt` to allow removing item at any index - 1. ✅ Release 0.0.4 - 1. ✅ Extend unit tests - 1. ✅ `.Add` / `.AddRange` must accept `null` values - 1. ✅ `.AddRange` must accept empty collections - 1. ✅ `.Remove` / `.RemoveAt` / `.Clear` / `.Dispose` must clear reference when reference type - 1. ✅ `.Clear` / `.Dispose` must return arrays to pools - 1. ✅ `int` / `long` variants of `.Count` / `.LongCount`, `.IndexOf` / `.LongIndexOf`, `.Insert`, `.RemoveAt`, `this[]` - 1. ✅ Add `.ToRecyclableList` / `.ToRecyclableLongList` variants for all supported collection types - 1. ✅ `Array` - 1. ✅ `ICollection` - 1. ✅ `ICollection` - 1. ✅ `IEnumerable` - 1. ✅ `IEnumerable` - 1. ✅ `IReadOnlyList` - 1. ✅ `ReadOnlySpan` - 1. ✅ `RecyclableList` - 1. ✅ `RecyclableLongList` - 1. ✅ `Span` - 1. ✅ `T[]` - 1. ✅ Release 0.0.5 - 1. ✅ Implement `List` compatibility pack for `RecyclableList` - 1. ✅ Overflow review - 1. ✅ Add type casting to `long` for `<<` & `>>` operations, where required - 1. ✅ Make type castings `checked`, where required - 1. ✅ Release 0.0.6 - 1. 👉 Implement `List` compatibility pack for `RecyclableLongList` - 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableList` - 1. `IndexOf` parallelization - 1. 🅿️ Release 0.0.7 -1. 🅿️ Implement `ILongList` interface - 1. 🅿️ `RecyclableList` - 1. 🅿️ `RecyclableLongList` -1. 🅿️ Implement `RecyclableQueue` - 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableQueue` - 1. 🅿️ Release 0.0.8 -1. 🅿️ Implement `RecyclableStack` - 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableStack` - 1. 🅿️ Release 0.0.9 -1. 🅿️ Implement `RecyclableSortedList` - 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableSortedList` - 1. 🅿️ Release 0.0.10 -1. 🅿️ Implement `RecyclableUnorderedList` - 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableUnorderedList` - 1. 🅿️ Release 0.0.11 -1. 🅿️ Implement `RecyclableVersionedList` - 1. 🅿️ Port `RecyclableList` to `RecyclableVersionedList` - 1. 🅿️ Port `RecyclableLongList` to `RecyclableVersionedLongList` - 1. 🅿️ Release 0.0.12 -1. 🅿️ Optimize `OneSizeArrayPool` - 1. 🅿️ Review locks - 1. 🅿️ Measure multi-threading performance - 1. 🅿️ Implement memory bucket disposal in high RAM pressure scenario -1. 🅿️ Optimize `RecyclableCollectionVersionObjectPool` - 1. 🅿️ Implement custom `ObjectPool` - 1. 🅿️ Measure multi-threading performance - 1. 🅿️ Implement memory bucket disposal in high RAM pressure scenario -1. 🅿️ Review `RecyclableArrayPool` - 1. 🅿️ Review locks - 1. 🅿️ Measure multi-threading performance - 1. 🅿️ Implement array disposal in high RAM pressure scenario -1. 🅿️ Optimize `MemoryBucket` - 1. 🅿️ Convert to `struct`, if possible - 1. 🅿️ Find out if there are better replacements - 1. 🅿️ Release 0.0.13 -1. 🅿️ Optimize - 1. 🅿️ `IndexOfSynchronizationContext` - 1. 🅿️ `IndexOfSynchronizationContextPool` - 1. 🅿️ `ManualResetEventSlimmer` - 1. 🅿️ Multi-threading benchmarks - 1. 🅿️ `ManualResetEventSlimmerPool` - 1. 🅿️ Multi-threading benchmarks - 1. 🅿️ `SpinLockSlimmer` - 1. 🅿️ Multi-threading benchmarks - 1. 🅿️ Remove range operators, where possible -1. 🅿️ Release 0.0.14 -1. 🅿️ Extend unit tests - 1. 🅿️ `RecyclableLongListExtensions.CopyTo` - 1. 🅿️ `RecyclableLongList` cases for large items count (>`int.MaxValue`) - 1. 🅿️ Pools - 1. 🅿️ Multi-threading - 1. 🅿️ Add comparison tests vs `T[]` / `List` equivalents - 1. 🅿️ Add test cases for indexes beyond items count - 1. 🅿️ Cover border cases - 1. 🅿️ Non-existing items in `.Contains...()`, `.Exists...()`, `.Find...()`, `.IndexOf...()`, `.Last...()` - 1. 🅿️ Duplicated items in `.Contains...()`, `.Exists...()`, `.Find...()`, `.IndexOf...()`, `.Last...()` - 1. 🅿️ Append test data in reversed order in `.AddRange()`, `.InsertRange()` and similar tests - 1. 🅿️ Switch tests to use Source / Target data variants in `.AddRange()`, `.InsertRange()` and similar tests -1. 🅿️ Cleanup - 1. 🅿️ Replace `LastBlockWithData` property with `_lastBlockWithData` field - 1. 🅿️ Replace all internal properties refs with fields, where possible - 1. ✅ `RecyclableLongListExtensions` - 1. ✅ `ListExtensions` - 1. 🅿️ `MathUtils` - 1. 🅿️ Resolve TODOs - 1. 🅿️ Remove obsolete methods - 1. 🅿️ Add`RecyclableLongListHelpers.Enumerate` to benchmarks - 1. 🅿️ Review all classes & add `volatile`, where needed - 1. 🅿️ Remove `expectedItemsCount` parameter from `RecyclableLongList`'s constructor - 1. 🅿️ Remove `array` slicing in favor for indexing, like in `RecyclableCompatibilityListExtensions` -1. 🅿️ Release 0.0.15 -1. 🅿️ Optimize - 1. 🅿️ `ListExtensions` - 1. 🅿️ `MathUtils` - 1. 🅿️ `SystemRandomNumberGenerator` - 1. 🅿️ `RecyclableLongListExtensions` - 1. 🅿️ Memory release in pools to utilize GC events in case of memory pressure -1. 🅿️ Release 0.0.16 -1. ✅ Review and remove warnings & hints - 1. ✅ Warnings - 1. ✅ Hints -1. Documentation - 1. 🅿️ Document the most efficient iteration over array collections - 1. 🅿️ Document the most efficient iteration over blocked collections - 1. 🅿️ Document differences in behavior - 1. 🅿️ Document other specifics -1. 🅿️ Release 1.0.0 -1. 🅿️ Implement source code generators - 1. 🅿️ Add attributes - 1. 🅿️ `GeneratorBaseClassAttribute` for marking base class used for generation - 1. 🅿️ `VersionedAttribute` for marking classes as versioned - 1. 🅿️ `IncVersionAttribute` for marking methods & setters as resulting in version increase - 1. 🅿️ Implement source code generator - 1. 🅿️ Generate partial class for classes marked with `GeneratorBaseClassAttribute` - 1. 🅿️ Add support for fields - 1. 🅿️ Add support for properties - 1. 🅿️ Add support for methods - 1. 🅿️ Add support for constructor - 1. 🅿️ Skip base fields, methods, properties etc. when they're overridden in the child class -1. 🅿️ Add support for `ulong` indexing - 1. 🅿️ Convert `_memoryBlocks` to `Array` to allow `ulong` lengths - 1. 🅿️ Convert block indexes from `int` to `ulong` or `long` -1. 🅿️ Optimize - 1. 🅿️ `RecyclableLongList.Resize` - 1. 🅿️ `RecyclableLongList.CopyTo` - 1. 🅿️ Check if we can benefit from Sse2 in `.IndexOf`/`.Contains` methods as given in [MS blog](https://devblogs.microsoft.com/dotnet/hardware-intrinsics-in-net-core/). - 1. 🅿️ Memory pools - 1. 🅿️ `OneSizeArrayPool` - 1. 🅿️ `RecyclableArrayPool` -1. 🅿️ Add support for `ICollection` interface in `.AddRange` & `constructor` -1. 🅿️ Final optimizations - 1. 🅿️ Replace `Math` class usages with `if` statements - 1. 🅿️ Replace `a - b > 0` & `a - b < 0` comparisons with `a > b` & `a < b` - 1. 🅿️ Replace `a + b > 0` & `a + b < 0` comparisons with `a > b` & `a < b` - 1. 🅿️ Replace `a / b` & `a * b` calculations with equivalents, where possible - 1. 🅿️ Replace virtual calls with static calls - 1. 🅿️ Separate `++number`, `number++`, `--number` & `number--` operations to their own lines (they add extra variable) - 1. 🅿️ Replace `blockSize` sums by powers of 2, minus 1 - 1. 🅿️ Remove type castings, if possible - 1. 🅿️ Convert generic methods to non-generic - 1. 🅿️ Replace integer comparisons with comparisons to 0 / 1, if possible -1. 🅿️ Release 2.0.0 - -# Characteristics of the classes - -## Common -* All classes implement `IDisposable` interface & SHOULD be disposed after use. That's to return block arrays taken from the shared pool. It may be foreseen as an issue for replacement in existing code, which obviously is missing `using` clause. But considering that `Dispose` will be called by `GC` anyway, it should cause issues in specific scenarios, only. In either case the fix is one-word addition of `using`. -* Memory blocks are created in 2 ways, depending on `blockSize` value - * when `blockSize < 128` ⇨ blocks are created as regular `arrays`. - * when `blockSize >= 128` ⇨ blocks are taken from and returned to `ArrayPool.Shared`, when blocks are removed. - * maximum `blockSize` value is `2_147_483_591`, which corresponds more or less to the maximum array size. - * `blockSize` MUST be a power of 2. It will be rounded up to the closest power of 2, if needed. That is due to high performance gain on some operations, like the calculation of item index in a block. -* Array pools are shared between the same `T` type. I.e. `List` will use a different pool from `List` and so on. For high concurrency environments you may want to provide your own pools, when this feature becomes available in the upcoming releases. -* Trying to access `this[int index]`, `this[long index]`, `Count`, `LongCount` etc. when `Capacity == 0` will raise `NullReferenceException`. This is by design to remove all non-critical code from the constructor. -* ⚠️ The default enumerators don't check if the collection was modified. That's by design due to high performance hit of the check. That should be fine in most use-cases. If you need to check for modifications, you're welcomed to use `.GetVersionedEnumerator()` / `IRecyclableVersionedXxxList` type-casting, e.g. in `foreach` loops. - ```csharp - foreach (var item in (IRecyclableVersionedList)recyclableList) - { - ... - ... - ... - } - - foreach (var item in (IRecyclableVersionedLongList)recyclableLongList) - { - ... - ... - ... - } - ``` -* ⚠️ The state of the default enumerators before the first & after the last call to `.MoveNext()` is undefined, but no exception is raised. That's by design due to high performance hit of the checks. This behavior is compatible with `foreach` loops, which will never access `.Current` property - * when the collection is empty, or - * when `.MoveNext()` returned `false`, after reaching the end of the collection. - -* ⚠️ If you decide to use `.GetEnumerator()` / `.GetVersionedEnumerator()`, instead of relying on `foreach` loops - * you MUST ensure that you always respect the result of `.MoveNext()` call, and - * you MUST NOT access `.Current` property before calling `.MoveNext()` or after reaching the end of the collection. - - \ - **Failing to do so WILL result in unpredictable behavior.** - - ### [Benchmark results](https://github.com/mlemanczyk/Recyclable.Collections/blob/main/Recyclable.Collections.Benchmarks/Results/Benchmarks.md) - -## `RecyclableList` -* Range: `int` -* Interfaces: `IList`, `IEnumerable`, `IDisposable`\ -\ -This is the direct equivalent of `List` class, except that the arrays are taken from the shared pool, instead of directly being allocated. It proves to out perform `List` & the standard arrays in certain operations and is fairly close in others. But they may perform worse in certain scenarios. If you're interested in details, please refer to benchmarks. - -## `RecyclableLongList`, `RecyclableSortableList`, `RecyclableQueue`, `RecyclableStack` -* Range: `long` -* Interfaces: `IList`, `ILongList`, `IEnumerable`, `IDisposable` -* All classes provide large storage capabilities, in practice limited only by the memory available in your system. -* All data is stored in blocks, with the provided `int blockSize` or the default, currently being `10,240` items in each block. It's recommended to use smaller numbers, if you foresee storing low no. of items on the list. -* There is no memory copying to increase the capacity of the recyclable classes, unless the no. of items exceeds the no. of allocated blocks. In that case, a new array of blocks is created to accommodate . If more capacity is needed, a new memory block is allocate & added to the internal list of blocks. This is the only list that may re-allocate memory block & copy their content to grow. That shouldn't be an issue considering limited no. of blocks stored by each class in practical scenarios. Currently I'm not planning any works around that. Shall there be a need to eliminate it, you're welcomed to file a PR with the proposed changes. -* ⚠️ `IndexOf` will automatically switch to parallel search mode. Collections bigger than (currently) 850_000 items will be scanned using parallelization. In either case it'll return the index of the first matching item. This note also applies to `Contains`, because it internally uses `IndexOf`. The value of 850_000 may become configurable in the future, unless it proves to result in much worse performance. - - The parallelization utilizes default `Task` scheduling, resulting in non-deterministic order in which search tasks are executed. In most cases it resulted in significant performance improvements. Below you can find the benchmarks for various item counts. - - As `RecyclableLongList` is foreseen for use-cases with big data, you should automatically benefit from it in many use-cases. - - ### [Benchmark Results](https://github.com/mlemanczyk/Recyclable.Collections/blob/main/Recyclable.Collections.Benchmarks/Results/Benchmarks.md) - -# Architecture Decisions -The architecture of the classes included in this project is driven primarily by performance & memory footprints. The following decisions were made to support it. - -## Code duplication -There is high level of code duplication in each of the classes. When you look at them, you will see they are alike & some of the code could be extracted to extension methods. It has been done & has proven to perform worse. For this reason, properties & methods expected to be on the hot-path, duplicate much of the code to get the most out of it. - -## Common base - `ILongList` -Having a common base class for all the classes looks very attractive. But it is also proved to perform worse, if you start making properties & methods virtual & there are subsequent calls to `base`. For this reason, each of the classes is the root class & there are hardly any virtual methods & properties. All classes are meant to be `final`, but I've not marked them as `sealed`. If you feel that you'd benefit from it, you're welcomed to inherit from them. The protected stuff is there for your use. - -If you desire to have a common base for calls, each of the classes implements `IList` & `ILongList` interfaces. `ILongList` is a new interface, made alike `IList`, but unlocking full support for `long` indexing & use. Considering the characteristics of the classes I feel that the generic name is justified, instead of `IRecyclableList` what you could expect. - -## Protection against incorrect use & state -Having protection against invalid state of the object is an important part of software engineering. The classes included in this project provide the same level of protection as the regular `array` & `List` class. They will raise exceptions when invalid index is given. But there is no additional protection that the content & state of the objects internally used by these classes are valid. You can break them, if you want to. - -This decision is driven by performance measures. Considering wide use of the lists on the hot-paths, each additional check & operation starts counting. I've decided to eliminate all the checks for the sake of performance. If you feel that you need additional protection, feel free to inherit or reuse any of the provided classes to provide that. - -## `this[int index]`, `Count`, `IndexOf(T item)` etc. may overflow, but... -All the classes included in this package support `long` indexing and addressing. The `LongCount` property will always provide the total no. of items stored on the list. Since `Count` is just `LongCount` type-casted to `int`, its value may overflow. - -But `List` addressing is kind of currently limited to `int` ranges anyway in practical scenarios. As such `Count` overflowing shouldn't be an issue when using the classes with existing code. If you use `Count` in your loops, it's recommended to replace it with `LongCount`, tough. You don't need to make any changes in `foreach` or other iterator loops. They are expected to transparently use the new classes & yield all items, beyond `int.MaxValue` range. - -This is by design, for the best performance. Initially there have been checks in place to prevent overflowing & return `int.MaxValue` instead, but they proved to slow down the operations. Considering low risk for existing code, I've decided to take it out. - -If you foresee the overflowing as an issue, you're welcomed to propose an improvement & file a PR with proposed solution. - -# Auto-properties, new language features & code style -When you look at the code you may note, that it looks like in early c# days. Where the new language features yield the same or better performance, they are & will be used. - -However, many of the new language features have proved to provide worse performance at some point in my testing. It includes auto-properties, for which I could see getters & setters generated in IL, instead of fields. Because all the classes are expected to be on the hot-paths, I've eliminated most of them. - -Similarly, you will find places in code with hints or warnings disabled. The decision was always driven by performance measures. The use case & business logic was carefully reviewed to ensure it's safe to take shortcuts, before making the change. If you run into failing scenario, please feel free to create a work item against it and/or file a PR to fix it. - -Finally, you'll find places with code commented out. That's to easily track what has been tried & what proved to perform worse. - -At any time, if you know & can show in your benchmarks that the code can be simplified without impacting the performance, feel free to file a PR with proposed changes. Please include benchmark results from your testing to speed up things. - -# Thread Safety -The `public static` members of the classes are thread safe. Any instance members are not guaranteed to be thread safe. You need to implement locking mechanism to safely use the classes in a multi-threading environment. - -# Use -All the classes included in this package are meant to be direct replacements of their corresponding system classes. -* `IList` ⇨ `ILongList` -* `List` ⇨ `RecyclableLongList` -* `Queue` ⇨ `RecyclableQueue` -* `PriorityQueue` ⇨ `RecyclableSortedList` -* `SortedList` ⇨ `RecyclableSortedList` -* `Stack` ⇨ `RecyclableStack` - -Examples of each of the above classes are provided below. Please refer automated tests for more. - -## `RecyclableList` -It's the closest equivalent to `List` in regards to functionality. It supports items' removal & delivers the best performance in most scenarios. But it's limited to `int` range, tough. If you find that acceptable, my recommendation is to use this class as the direct replacement for `List`. - -Do note, that it implements `ILongList` interface, too. This is to allow having common code base regardless, if you use the basic `RecyclableList` or it's `long`-range version - `RecyclableLongList`. By doing that you can switch between them with highly limited changes in code. - -## `RecyclableLongList` - -```CSharp -public void RecyclableListExample() -{ - int[] testNumbers = new[] { 1, 2, 2, 3 }; - - // Create - using var list = new RecyclableLongList(); - - // Add items - foreach (var index in testNumbers) - { - list.Add(index); - } - - foreach (var item in list) - { - Console.WriteLine(item); - } - - // This will iterate over this[long index] - for (var itemIdx = 0; itemIdx <= list.LongCount; itemIdx++) - { - Console.WriteLine(list[itemIdx]); - } - - // This will iterate over this[int index] and may overflow if there are > int.MaxValue no. of items on the list. See: Architecture Decisions - for (var itemIdx = 0; itemIdx <= list.LongCount; itemIdx++) - { - Console.WriteLine(list[itemIdx]); - } - - list.Clear(); -} -``` - -### [Benchmark results](https://github.com/mlemanczyk/Recyclable.Collections/blob/main/Recyclable.Collections.Benchmarks/Results/Benchmarks.md) +# Recyclable.Collections +`Recyclable.Collections` project is an open source framework for operating dynamic lists at performance close to raw arrays, but fairly unlimited in size. It aims at providing minimal memory footprint. It implements `IList` interface and is targeted as direct replacements of `List`, `SortableList`, `PriorityQueue` & similar. + +## Included +* `RecyclableList` +* `RecyclableLongList` + +## NuGet packages +- [Recyclable.Collections](https://github.com/mlemanczyk/Recyclable.Collections) +- [Recyclable.Collections.Compatibility.List](https://github.com/mlemanczyk/Recyclable.Collections.Compatibility.List) +- [Recyclable.Collections.Concurrent](https://github.com/mlemanczyk/Recyclable.Collections.Concurrent) +- [Recyclable.Collections.Linq](https://github.com/mlemanczyk/Recyclable.Collections.Linq) +- [Recyclable.Collections.Searching](https://github.com/mlemanczyk/Recyclable.Collections.Searching) +- [Recyclable.Collections.TestData](https://github.com/mlemanczyk/Recyclable.Collections.TestData) + +# Milestones +1. ✅ Create basic classes + 1. ✅ `RecyclableList` + 1. ✅ `RecyclableLongList` + 1. 🅿️ `RecyclableQueue` + 1. 🅿️ `RecyclableSortedList` + 1. 🅿️ `RecyclableStack` + 1. 🅿️ `RecyclableUnorderedList` +1. ✅ Create basic unit tests + 1. ✅ `RecyclableList` + 1. ✅ `RecyclableLongList` + 1. 🅿️ `RecyclableQueue` + 1. 🅿️ `RecyclableSortedList` + 1. 🅿️ `RecyclableStack` + 1. 🅿️ `RecyclableUnorderedList` +1. ✅ Optimize `RecyclableList` + 1. ✅ `Add` + 1. ✅ `AddRange` + 1. ✅ when source is `array` + 1. ✅ when source is `List` + 1. ✅ when source is `IList` + 1. ✅ when source is `RecyclableList` + 1. ✅ when source is `RecyclableLongList` + 1. ✅ when source is `IEnumerable` + 1. ✅ when source has non-enumerated count + 1. ✅ `Clear` + 1. ✅ `Contains` + 1. ✅ `CopyTo` + 1. ✅ `Dispose` + 1. ✅ `EnsureCapacity` + 1. ✅ `GetEnumerator` + 1. ✅ `IndexOf` + 1. ✅ `Insert` + 1. ✅ `Remove` + 1. ✅ `RemoveAt` + 1. ✅ `Resize` + 1. ✅ `this[int index]` +1. ✅ Port `RecyclableList` implementation to `RecyclableLongList` +1. 👉 Optimize `RecyclableLongList` + 1. ✅ `Add` + 1. ✅ `AddRange` + 1. ✅ when source is `array` + 1. ✅ when source is `List` + 1. ✅ when source is `IList` + 1. ✅ when source is `RecyclableList` + 1. ✅ when source is `RecyclableLongList` + 1. ✅ when source is `IEnumerable` + 1. ✅ when source has non-enumerated count + 1. ✅ `Clear` + 1. ✅ `Contains` + 1. 🅿️ `CopyTo` + 1. ✅ `Dispose` + 1. ✅ `EnsureCapacity` + 1. ✅ `GetEnumerator` + 1. ✅ `IndexOf` + 1. ✅ `LongIndexOf` + 1. ✅ `Insert` + 1. ✅ `Remove` + 1. ✅ `RemoveAt(int index)` + 1. ✅ `RemoveAt(long index)` + 1. ✅ `RemoveAt` + 1. ✅ `Resize` + 1. ✅ `this[int index]` + 1. ✅ `this[long index]` + 1. ✅ Rename `RecyclableList` to `RecyclableLongList` + 1. ✅ Rename `RecyclableArrayList` to `RecyclableList` + 1. ✅ Fix failing tests + 1. ✅ Hide not ready classes + 1. ✅ `RecyclableQueue` + 1. ✅ `RecyclableSortedList` + 1. ✅ `RecyclableStack` + 1. ✅ `RecyclableUnorderedList` + 1. ✅ Add support for `ReadOnlySpan` + 1. ✅ Release 0.0.3-alpha + 1. ✅ Implement `List` interfaces + 1. ✅ `IList` + 1. ✅ `ICollection` + 1. ✅ `IEnumerable` + 1. ✅ `IEnumerable` + 1. ✅ `IReadOnlyList` + 1. ✅ `IReadOnlyCollection` + 1. ✅ `IList` + 1. ✅ `ICollection` + 1. ✅ Implement list versioning to allow data change identification + 1. ✅ Make sure that `NeedsClearing` is used & items are cleared in + 1. ✅ `RecyclableList` + 1. ✅ `Clear` + 1. ✅ `Dispose` + 1. ✅ `Remove` + 1. ✅ `RemoveAt` + 1. ✅ Properties + 1. ✅ Non-versioned & Versioned Enumerators + 1. ✅ `RecyclableListHelpers` + 1. ✅ `EnsureCapacity` + 1. ✅ `Resize` + 1. ✅ `IList` implementation + 1. ✅ `RecyclableLongList` + 1. ✅ `Clear` + 1. ✅ `Dispose` + 1. ✅ `Remove` + 1. ✅ `RemoveAt` + 1. ✅ `RemoveBlock` + 1. ✅ Properties + 1. ✅ Non-versioned & Versioned Enumerators + 1. ✅ `RecyclableLongListHelpers` + 1. ✅ `CopyFollowingItems` + 1. ✅ `CopyTo` + 1. ✅ `EnsureCapacity` + 1. ✅ `Resize` + 1. ✅ `RecyclableLongList.IndexOfHelpers` + 1. ✅ Complete the implementation of `RecyclableLongList` + 1. ✅ `InsertAt` to allow inserting items anywhere + 1. ✅ `RemoveAt` to allow removing item at any index + 1. ✅ Release 0.0.4 + 1. ✅ Extend unit tests + 1. ✅ `.Add` / `.AddRange` must accept `null` values + 1. ✅ `.AddRange` must accept empty collections + 1. ✅ `.Remove` / `.RemoveAt` / `.Clear` / `.Dispose` must clear reference when reference type + 1. ✅ `.Clear` / `.Dispose` must return arrays to pools + 1. ✅ `int` / `long` variants of `.Count` / `.LongCount`, `.IndexOf` / `.LongIndexOf`, `.Insert`, `.RemoveAt`, `this[]` + 1. ✅ Add `.ToRecyclableList` / `.ToRecyclableLongList` variants for all supported collection types + 1. ✅ `Array` + 1. ✅ `ICollection` + 1. ✅ `ICollection` + 1. ✅ `IEnumerable` + 1. ✅ `IEnumerable` + 1. ✅ `IReadOnlyList` + 1. ✅ `ReadOnlySpan` + 1. ✅ `RecyclableList` + 1. ✅ `RecyclableLongList` + 1. ✅ `Span` + 1. ✅ `T[]` + 1. ✅ Release 0.0.5 + 1. ✅ Implement `List` compatibility pack for `RecyclableList` + 1. ✅ Overflow review + 1. ✅ Add type casting to `long` for `<<` & `>>` operations, where required + 1. ✅ Make type castings `checked`, where required + 1. ✅ Release 0.0.6 + 1. 👉 Implement `List` compatibility pack for `RecyclableLongList` + 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableList` + 1. `IndexOf` parallelization + 1. 🅿️ Release 0.0.7 +1. 🅿️ Implement `ILongList` interface + 1. 🅿️ `RecyclableList` + 1. 🅿️ `RecyclableLongList` +1. 🅿️ Implement `RecyclableQueue` + 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableQueue` + 1. 🅿️ Release 0.0.8 +1. 🅿️ Implement `RecyclableStack` + 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableStack` + 1. 🅿️ Release 0.0.9 +1. 🅿️ Implement `RecyclableSortedList` + 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableSortedList` + 1. 🅿️ Release 0.0.10 +1. 🅿️ Implement `RecyclableUnorderedList` + 1. 🅿️ Port `RecyclableLongList` optimizations to `RecyclableUnorderedList` + 1. 🅿️ Release 0.0.11 +1. 🅿️ Implement `RecyclableVersionedList` + 1. 🅿️ Port `RecyclableList` to `RecyclableVersionedList` + 1. 🅿️ Port `RecyclableLongList` to `RecyclableVersionedLongList` + 1. 🅿️ Release 0.0.12 +1. 🅿️ Optimize `OneSizeArrayPool` + 1. 🅿️ Review locks + 1. 🅿️ Measure multi-threading performance + 1. 🅿️ Implement memory bucket disposal in high RAM pressure scenario +1. 🅿️ Optimize `RecyclableCollectionVersionObjectPool` + 1. 🅿️ Implement custom `ObjectPool` + 1. 🅿️ Measure multi-threading performance + 1. 🅿️ Implement memory bucket disposal in high RAM pressure scenario +1. 🅿️ Review `RecyclableArrayPool` + 1. 🅿️ Review locks + 1. 🅿️ Measure multi-threading performance + 1. 🅿️ Implement array disposal in high RAM pressure scenario +1. 🅿️ Optimize `MemoryBucket` + 1. 🅿️ Convert to `struct`, if possible + 1. 🅿️ Find out if there are better replacements + 1. 🅿️ Release 0.0.13 +1. 🅿️ Optimize + 1. 🅿️ `IndexOfSynchronizationContext` + 1. 🅿️ `IndexOfSynchronizationContextPool` + 1. 🅿️ `ManualResetEventSlimmer` + 1. 🅿️ Multi-threading benchmarks + 1. 🅿️ `ManualResetEventSlimmerPool` + 1. 🅿️ Multi-threading benchmarks + 1. 🅿️ `SpinLockSlimmer` + 1. 🅿️ Multi-threading benchmarks + 1. 🅿️ Remove range operators, where possible +1. 🅿️ Release 0.0.14 +1. 🅿️ Extend unit tests + 1. 🅿️ `RecyclableLongListExtensions.CopyTo` + 1. 🅿️ `RecyclableLongList` cases for large items count (>`int.MaxValue`) + 1. 🅿️ Pools + 1. 🅿️ Multi-threading + 1. 🅿️ Add comparison tests vs `T[]` / `List` equivalents + 1. 🅿️ Add test cases for indexes beyond items count + 1. 🅿️ Cover border cases + 1. 🅿️ Non-existing items in `.Contains...()`, `.Exists...()`, `.Find...()`, `.IndexOf...()`, `.Last...()` + 1. 🅿️ Duplicated items in `.Contains...()`, `.Exists...()`, `.Find...()`, `.IndexOf...()`, `.Last...()` + 1. 🅿️ Append test data in reversed order in `.AddRange()`, `.InsertRange()` and similar tests + 1. 🅿️ Switch tests to use Source / Target data variants in `.AddRange()`, `.InsertRange()` and similar tests +1. 🅿️ Cleanup + 1. 🅿️ Replace `LastBlockWithData` property with `_lastBlockWithData` field + 1. 🅿️ Replace all internal properties refs with fields, where possible + 1. ✅ `RecyclableLongListExtensions` + 1. ✅ `ListExtensions` + 1. 🅿️ `MathUtils` + 1. 🅿️ Resolve TODOs + 1. 🅿️ Remove obsolete methods + 1. 🅿️ Add`RecyclableLongListHelpers.Enumerate` to benchmarks + 1. 🅿️ Review all classes & add `volatile`, where needed + 1. 🅿️ Remove `expectedItemsCount` parameter from `RecyclableLongList`'s constructor + 1. 🅿️ Remove `array` slicing in favor for indexing, like in `RecyclableCompatibilityListExtensions` +1. 🅿️ Release 0.0.15 +1. 🅿️ Optimize + 1. 🅿️ `ListExtensions` + 1. 🅿️ `MathUtils` + 1. 🅿️ `SystemRandomNumberGenerator` + 1. 🅿️ `RecyclableLongListExtensions` + 1. 🅿️ Memory release in pools to utilize GC events in case of memory pressure +1. 🅿️ Release 0.0.16 +1. ✅ Review and remove warnings & hints + 1. ✅ Warnings + 1. ✅ Hints +1. Documentation + 1. 🅿️ Document the most efficient iteration over array collections + 1. 🅿️ Document the most efficient iteration over blocked collections + 1. 🅿️ Document differences in behavior + 1. 🅿️ Document other specifics +1. 🅿️ Release 1.0.0 +1. 🅿️ Implement source code generators + 1. 🅿️ Add attributes + 1. 🅿️ `GeneratorBaseClassAttribute` for marking base class used for generation + 1. 🅿️ `VersionedAttribute` for marking classes as versioned + 1. 🅿️ `IncVersionAttribute` for marking methods & setters as resulting in version increase + 1. 🅿️ Implement source code generator + 1. 🅿️ Generate partial class for classes marked with `GeneratorBaseClassAttribute` + 1. 🅿️ Add support for fields + 1. 🅿️ Add support for properties + 1. 🅿️ Add support for methods + 1. 🅿️ Add support for constructor + 1. 🅿️ Skip base fields, methods, properties etc. when they're overridden in the child class +1. 🅿️ Add support for `ulong` indexing + 1. 🅿️ Convert `_memoryBlocks` to `Array` to allow `ulong` lengths + 1. 🅿️ Convert block indexes from `int` to `ulong` or `long` +1. 🅿️ Optimize + 1. 🅿️ `RecyclableLongList.Resize` + 1. 🅿️ `RecyclableLongList.CopyTo` + 1. 🅿️ Check if we can benefit from Sse2 in `.IndexOf`/`.Contains` methods as given in [MS blog](https://devblogs.microsoft.com/dotnet/hardware-intrinsics-in-net-core/). + 1. 🅿️ Memory pools + 1. 🅿️ `OneSizeArrayPool` + 1. 🅿️ `RecyclableArrayPool` +1. 🅿️ Add support for `ICollection` interface in `.AddRange` & `constructor` +1. 🅿️ Final optimizations + 1. 🅿️ Replace `Math` class usages with `if` statements + 1. 🅿️ Replace `a - b > 0` & `a - b < 0` comparisons with `a > b` & `a < b` + 1. 🅿️ Replace `a + b > 0` & `a + b < 0` comparisons with `a > b` & `a < b` + 1. 🅿️ Replace `a / b` & `a * b` calculations with equivalents, where possible + 1. 🅿️ Replace virtual calls with static calls + 1. 🅿️ Separate `++number`, `number++`, `--number` & `number--` operations to their own lines (they add extra variable) + 1. 🅿️ Replace `blockSize` sums by powers of 2, minus 1 + 1. 🅿️ Remove type castings, if possible + 1. 🅿️ Convert generic methods to non-generic + 1. 🅿️ Replace integer comparisons with comparisons to 0 / 1, if possible +1. 🅿️ Release 2.0.0 + +# Characteristics of the classes + +## Common +* All classes implement `IDisposable` interface & SHOULD be disposed after use. That's to return block arrays taken from the shared pool. It may be foreseen as an issue for replacement in existing code, which obviously is missing `using` clause. But considering that `Dispose` will be called by `GC` anyway, it should cause issues in specific scenarios, only. In either case the fix is one-word addition of `using`. +* Memory blocks are created in 2 ways, depending on `blockSize` value + * when `blockSize < 128` ⇨ blocks are created as regular `arrays`. + * when `blockSize >= 128` ⇨ blocks are taken from and returned to `ArrayPool.Shared`, when blocks are removed. + * maximum `blockSize` value is `2_147_483_591`, which corresponds more or less to the maximum array size. + * `blockSize` MUST be a power of 2. It will be rounded up to the closest power of 2, if needed. That is due to high performance gain on some operations, like the calculation of item index in a block. +* Array pools are shared between the same `T` type. I.e. `List` will use a different pool from `List` and so on. For high concurrency environments you may want to provide your own pools, when this feature becomes available in the upcoming releases. +* Trying to access `this[int index]`, `this[long index]`, `Count`, `LongCount` etc. when `Capacity == 0` will raise `NullReferenceException`. This is by design to remove all non-critical code from the constructor. +* ⚠️ The default enumerators don't check if the collection was modified. That's by design due to high performance hit of the check. That should be fine in most use-cases. If you need to check for modifications, you're welcomed to use `.GetVersionedEnumerator()` / `IRecyclableVersionedXxxList` type-casting, e.g. in `foreach` loops. + ```csharp + foreach (var item in (IRecyclableVersionedList)recyclableList) + { + ... + ... + ... + } + + foreach (var item in (IRecyclableVersionedLongList)recyclableLongList) + { + ... + ... + ... + } + ``` +* ⚠️ The state of the default enumerators before the first & after the last call to `.MoveNext()` is undefined, but no exception is raised. That's by design due to high performance hit of the checks. This behavior is compatible with `foreach` loops, which will never access `.Current` property + * when the collection is empty, or + * when `.MoveNext()` returned `false`, after reaching the end of the collection. + +* ⚠️ If you decide to use `.GetEnumerator()` / `.GetVersionedEnumerator()`, instead of relying on `foreach` loops + * you MUST ensure that you always respect the result of `.MoveNext()` call, and + * you MUST NOT access `.Current` property before calling `.MoveNext()` or after reaching the end of the collection. + + \ + **Failing to do so WILL result in unpredictable behavior.** + + ### [Benchmark results](https://github.com/mlemanczyk/Recyclable.Collections/blob/main/Recyclable.Collections.Benchmarks/Results/Benchmarks.md) + +## `RecyclableList` +* Range: `int` +* Interfaces: `IList`, `IEnumerable`, `IDisposable`\ +\ +This is the direct equivalent of `List` class, except that the arrays are taken from the shared pool, instead of directly being allocated. It proves to out perform `List` & the standard arrays in certain operations and is fairly close in others. But they may perform worse in certain scenarios. If you're interested in details, please refer to benchmarks. + +## `RecyclableLongList`, `RecyclableSortableList`, `RecyclableQueue`, `RecyclableStack` +* Range: `long` +* Interfaces: `IList`, `ILongList`, `IEnumerable`, `IDisposable` +* All classes provide large storage capabilities, in practice limited only by the memory available in your system. +* All data is stored in blocks, with the provided `int blockSize` or the default, currently being `10,240` items in each block. It's recommended to use smaller numbers, if you foresee storing low no. of items on the list. +* There is no memory copying to increase the capacity of the recyclable classes, unless the no. of items exceeds the no. of allocated blocks. In that case, a new array of blocks is created to accommodate . If more capacity is needed, a new memory block is allocate & added to the internal list of blocks. This is the only list that may re-allocate memory block & copy their content to grow. That shouldn't be an issue considering limited no. of blocks stored by each class in practical scenarios. Currently I'm not planning any works around that. Shall there be a need to eliminate it, you're welcomed to file a PR with the proposed changes. +* ⚠️ `IndexOf` will automatically switch to parallel search mode. Collections bigger than (currently) 850_000 items will be scanned using parallelization. In either case it'll return the index of the first matching item. This note also applies to `Contains`, because it internally uses `IndexOf`. The value of 850_000 may become configurable in the future, unless it proves to result in much worse performance. + + The parallelization utilizes default `Task` scheduling, resulting in non-deterministic order in which search tasks are executed. In most cases it resulted in significant performance improvements. Below you can find the benchmarks for various item counts. + + As `RecyclableLongList` is foreseen for use-cases with big data, you should automatically benefit from it in many use-cases. + + ### [Benchmark Results](https://github.com/mlemanczyk/Recyclable.Collections/blob/main/Recyclable.Collections.Benchmarks/Results/Benchmarks.md) + +# Architecture Decisions +The architecture of the classes included in this project is driven primarily by performance & memory footprints. The following decisions were made to support it. + +## Code duplication +There is high level of code duplication in each of the classes. When you look at them, you will see they are alike & some of the code could be extracted to extension methods. It has been done & has proven to perform worse. For this reason, properties & methods expected to be on the hot-path, duplicate much of the code to get the most out of it. + +## Common base - `ILongList` +Having a common base class for all the classes looks very attractive. But it is also proved to perform worse, if you start making properties & methods virtual & there are subsequent calls to `base`. For this reason, each of the classes is the root class & there are hardly any virtual methods & properties. All classes are meant to be `final`, but I've not marked them as `sealed`. If you feel that you'd benefit from it, you're welcomed to inherit from them. The protected stuff is there for your use. + +If you desire to have a common base for calls, each of the classes implements `IList` & `ILongList` interfaces. `ILongList` is a new interface, made alike `IList`, but unlocking full support for `long` indexing & use. Considering the characteristics of the classes I feel that the generic name is justified, instead of `IRecyclableList` what you could expect. + +## Protection against incorrect use & state +Having protection against invalid state of the object is an important part of software engineering. The classes included in this project provide the same level of protection as the regular `array` & `List` class. They will raise exceptions when invalid index is given. But there is no additional protection that the content & state of the objects internally used by these classes are valid. You can break them, if you want to. + +This decision is driven by performance measures. Considering wide use of the lists on the hot-paths, each additional check & operation starts counting. I've decided to eliminate all the checks for the sake of performance. If you feel that you need additional protection, feel free to inherit or reuse any of the provided classes to provide that. + +## `this[int index]`, `Count`, `IndexOf(T item)` etc. may overflow, but... +All the classes included in this package support `long` indexing and addressing. The `LongCount` property will always provide the total no. of items stored on the list. Since `Count` is just `LongCount` type-casted to `int`, its value may overflow. + +But `List` addressing is kind of currently limited to `int` ranges anyway in practical scenarios. As such `Count` overflowing shouldn't be an issue when using the classes with existing code. If you use `Count` in your loops, it's recommended to replace it with `LongCount`, tough. You don't need to make any changes in `foreach` or other iterator loops. They are expected to transparently use the new classes & yield all items, beyond `int.MaxValue` range. + +This is by design, for the best performance. Initially there have been checks in place to prevent overflowing & return `int.MaxValue` instead, but they proved to slow down the operations. Considering low risk for existing code, I've decided to take it out. + +If you foresee the overflowing as an issue, you're welcomed to propose an improvement & file a PR with proposed solution. + +# Auto-properties, new language features & code style +When you look at the code you may note, that it looks like in early c# days. Where the new language features yield the same or better performance, they are & will be used. + +However, many of the new language features have proved to provide worse performance at some point in my testing. It includes auto-properties, for which I could see getters & setters generated in IL, instead of fields. Because all the classes are expected to be on the hot-paths, I've eliminated most of them. + +Similarly, you will find places in code with hints or warnings disabled. The decision was always driven by performance measures. The use case & business logic was carefully reviewed to ensure it's safe to take shortcuts, before making the change. If you run into failing scenario, please feel free to create a work item against it and/or file a PR to fix it. + +Finally, you'll find places with code commented out. That's to easily track what has been tried & what proved to perform worse. + +At any time, if you know & can show in your benchmarks that the code can be simplified without impacting the performance, feel free to file a PR with proposed changes. Please include benchmark results from your testing to speed up things. + +# Thread Safety +The `public static` members of the classes are thread safe. Any instance members are not guaranteed to be thread safe. You need to implement locking mechanism to safely use the classes in a multi-threading environment. + +# Use +All the classes included in this package are meant to be direct replacements of their corresponding system classes. +* `IList` ⇨ `ILongList` +* `List` ⇨ `RecyclableLongList` +* `Queue` ⇨ `RecyclableQueue` +* `PriorityQueue` ⇨ `RecyclableSortedList` +* `SortedList` ⇨ `RecyclableSortedList` +* `Stack` ⇨ `RecyclableStack` + +Examples of each of the above classes are provided below. Please refer automated tests for more. + +## `RecyclableList` +It's the closest equivalent to `List` in regards to functionality. It supports items' removal & delivers the best performance in most scenarios. But it's limited to `int` range, tough. If you find that acceptable, my recommendation is to use this class as the direct replacement for `List`. + +Do note, that it implements `ILongList` interface, too. This is to allow having common code base regardless, if you use the basic `RecyclableList` or it's `long`-range version - `RecyclableLongList`. By doing that you can switch between them with highly limited changes in code. + +## `RecyclableLongList` + +```CSharp +public void RecyclableListExample() +{ + int[] testNumbers = new[] { 1, 2, 2, 3 }; + + // Create + using var list = new RecyclableLongList(); + + // Add items + foreach (var index in testNumbers) + { + list.Add(index); + } + + foreach (var item in list) + { + Console.WriteLine(item); + } + + // This will iterate over this[long index] + for (var itemIdx = 0; itemIdx <= list.LongCount; itemIdx++) + { + Console.WriteLine(list[itemIdx]); + } + + // This will iterate over this[int index] and may overflow if there are > int.MaxValue no. of items on the list. See: Architecture Decisions + for (var itemIdx = 0; itemIdx <= list.LongCount; itemIdx++) + { + Console.WriteLine(list[itemIdx]); + } + + list.Clear(); +} +``` + +### [Benchmark results](https://github.com/mlemanczyk/Recyclable.Collections/blob/main/Recyclable.Collections.Benchmarks/Results/Benchmarks.md) diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Add.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Add.cs index 9993bc9..9f28070 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Add.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Add.cs @@ -1,62 +1,62 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Add() - { - var data = TestObjects; - var dataCount = TestObjectCount; - var list = new long[dataCount]; - for (var i = 0; i < dataCount; i++) - { - list[i] = data[i]; - } - } - - public void List_Add() - { - var data = TestObjects; - var dataCount = TestObjectCount; - var list = new List(); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - - public void PooledList_Add() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new PooledList(ClearMode.Auto); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - - public void RecyclableList_Add() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new RecyclableList(); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - - public void RecyclableLongList_Add() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new RecyclableLongList(); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Add() + { + var data = TestObjects; + var dataCount = TestObjectCount; + var list = new long[dataCount]; + for (var i = 0; i < dataCount; i++) + { + list[i] = data[i]; + } + } + + public void List_Add() + { + var data = TestObjects; + var dataCount = TestObjectCount; + var list = new List(); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + + public void PooledList_Add() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new PooledList(ClearMode.Auto); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + + public void RecyclableList_Add() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new RecyclableList(); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + + public void RecyclableLongList_Add() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new RecyclableLongList(); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsArray.cs b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsArray.cs index 823f861..ae1f1f9 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsArray.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsArray.cs @@ -1,42 +1,42 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_AddRangeWhenSourceIsArray() - { - var data = TestObjects; - var list = new long[TestObjectCount]; - data.CopyTo(list, 0); - } - - public void List_AddRangeWhenSourceIsArray() - { - var data = TestObjects; - var list = new List(); - list.AddRange(data); - } - - public void PooledList_AddRangeWhenSourceIsArray() - { - var data = TestObjects; - using var list = new PooledList(ClearMode.Auto); - list.AddRange(data); - } - - public void RecyclableList_AddRangeWhenSourceIsArray() - { - var data = TestObjects; - using var list = new RecyclableList(); - list.AddRange(data); - } - - public void RecyclableLongList_AddRangeWhenSourceIsArray() - { - var data = TestObjects; - using var list = new RecyclableLongList(minBlockSize: BlockSize); - list.AddRange(data); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_AddRangeWhenSourceIsArray() + { + var data = TestObjects; + var list = new long[TestObjectCount]; + data.CopyTo(list, 0); + } + + public void List_AddRangeWhenSourceIsArray() + { + var data = TestObjects; + var list = new List(); + list.AddRange(data); + } + + public void PooledList_AddRangeWhenSourceIsArray() + { + var data = TestObjects; + using var list = new PooledList(ClearMode.Auto); + list.AddRange(data); + } + + public void RecyclableList_AddRangeWhenSourceIsArray() + { + var data = TestObjects; + using var list = new RecyclableList(); + list.AddRange(data); + } + + public void RecyclableLongList_AddRangeWhenSourceIsArray() + { + var data = TestObjects; + using var list = new RecyclableLongList(minBlockSize: BlockSize); + list.AddRange(data); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIEnumerable.cs b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIEnumerable.cs index da5d00c..24b90a8 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIEnumerable.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIEnumerable.cs @@ -1,47 +1,47 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_AddRangeWhenSourceIsIEnumerable() - { - var data = TestObjectsAsIEnumerable; - var list = new long[TestObjectCount]; - int itemIndex = 0; - - foreach (var item in data) - { - list[itemIndex++] = item; - } - } - - public void List_AddRangeWhenSourceIsIEnumerable() - { - var data = TestObjectsAsIEnumerable; - var list = new List(); - list.AddRange(data); - } - - public void PooledList_AddRangeWhenSourceIsIEnumerable() - { - var data = TestObjectsAsIEnumerable; - using var list = new PooledList(ClearMode.Auto); - list.AddRange(data); - } - - public void RecyclableList_AddRangeWhenSourceIsIEnumerable() - { - var data = TestObjectsAsIEnumerable; - using var list = new RecyclableList(); - list.AddRange(data); - } - - public void RecyclableLongList_AddRangeWhenSourceIsIEnumerable() - { - var data = TestObjectsAsIEnumerable; - using var list = new RecyclableLongList(minBlockSize: BlockSize); - list.AddRange(data); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_AddRangeWhenSourceIsIEnumerable() + { + var data = TestObjectsAsIEnumerable; + var list = new long[TestObjectCount]; + int itemIndex = 0; + + foreach (var item in data) + { + list[itemIndex++] = item; + } + } + + public void List_AddRangeWhenSourceIsIEnumerable() + { + var data = TestObjectsAsIEnumerable; + var list = new List(); + list.AddRange(data); + } + + public void PooledList_AddRangeWhenSourceIsIEnumerable() + { + var data = TestObjectsAsIEnumerable; + using var list = new PooledList(ClearMode.Auto); + list.AddRange(data); + } + + public void RecyclableList_AddRangeWhenSourceIsIEnumerable() + { + var data = TestObjectsAsIEnumerable; + using var list = new RecyclableList(); + list.AddRange(data); + } + + public void RecyclableLongList_AddRangeWhenSourceIsIEnumerable() + { + var data = TestObjectsAsIEnumerable; + using var list = new RecyclableLongList(minBlockSize: BlockSize); + list.AddRange(data); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIList.cs b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIList.cs index e09ce55..ece11ae 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIList.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsIList.cs @@ -1,42 +1,42 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_AddRangeWhenSourceIsIList() - { - var data = (IList)TestObjectsAsRecyclableLongList; - var list = new long[TestObjectCount]; - data.CopyTo(list, 0); - } - - public void List_AddRangeWhenSourceIsIList() - { - var data = (IList)TestObjectsAsRecyclableLongList; - var list = new List(); - list.AddRange(data); - } - - public void PooledList_AddRangeWhenSourceIsIList() - { - var data = (IList)TestObjectsAsRecyclableLongList; - using var list = new PooledList(ClearMode.Auto); - list.AddRange(data); - } - - public void RecyclableList_AddRangeWhenSourceIsIList() - { - var data = (IList)TestObjectsAsRecyclableLongList; - using var list = new RecyclableList(); - list.AddRange(data); - } - - public void RecyclableLongList_AddRangeWhenSourceIsIList() - { - var data = (IList)TestObjectsAsRecyclableLongList; - using var list = new RecyclableLongList(minBlockSize: BlockSize); - list.AddRange(data); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_AddRangeWhenSourceIsIList() + { + var data = (IList)TestObjectsAsRecyclableLongList; + var list = new long[TestObjectCount]; + data.CopyTo(list, 0); + } + + public void List_AddRangeWhenSourceIsIList() + { + var data = (IList)TestObjectsAsRecyclableLongList; + var list = new List(); + list.AddRange(data); + } + + public void PooledList_AddRangeWhenSourceIsIList() + { + var data = (IList)TestObjectsAsRecyclableLongList; + using var list = new PooledList(ClearMode.Auto); + list.AddRange(data); + } + + public void RecyclableList_AddRangeWhenSourceIsIList() + { + var data = (IList)TestObjectsAsRecyclableLongList; + using var list = new RecyclableList(); + list.AddRange(data); + } + + public void RecyclableLongList_AddRangeWhenSourceIsIList() + { + var data = (IList)TestObjectsAsRecyclableLongList; + using var list = new RecyclableLongList(minBlockSize: BlockSize); + list.AddRange(data); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsList.cs b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsList.cs index 6409998..f283b7c 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsList.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsList.cs @@ -1,42 +1,42 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_AddRangeWhenSourceIsList() - { - var data = TestObjectsAsList; - var list = new long[TestObjectCount]; - data.CopyTo(list, 0); - } - - public void List_AddRangeWhenSourceIsList() - { - var data = TestObjectsAsList; - var list = new List(); - list.AddRange(data); - } - - public void PooledList_AddRangeWhenSourceIsList() - { - var data = TestObjectsAsList; - using var list = new PooledList(ClearMode.Auto); - list.AddRange(data); - } - - public void RecyclableList_AddRangeWhenSourceIsList() - { - var data = TestObjectsAsList; - using var list = new RecyclableList(); - list.AddRange(data); - } - - public void RecyclableLongList_AddRangeWhenSourceIsList() - { - var data = TestObjectsAsList; - using var list = new RecyclableLongList(minBlockSize: BlockSize); - list.AddRange(data); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_AddRangeWhenSourceIsList() + { + var data = TestObjectsAsList; + var list = new long[TestObjectCount]; + data.CopyTo(list, 0); + } + + public void List_AddRangeWhenSourceIsList() + { + var data = TestObjectsAsList; + var list = new List(); + list.AddRange(data); + } + + public void PooledList_AddRangeWhenSourceIsList() + { + var data = TestObjectsAsList; + using var list = new PooledList(ClearMode.Auto); + list.AddRange(data); + } + + public void RecyclableList_AddRangeWhenSourceIsList() + { + var data = TestObjectsAsList; + using var list = new RecyclableList(); + list.AddRange(data); + } + + public void RecyclableLongList_AddRangeWhenSourceIsList() + { + var data = TestObjectsAsList; + using var list = new RecyclableLongList(minBlockSize: BlockSize); + list.AddRange(data); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsSameType.cs b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsSameType.cs index 293192f..e8c3ebf 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsSameType.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/AddRangeWhenSourceIsSameType.cs @@ -1,28 +1,28 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void PooledList_AddRangeWhenSourceIsPooledList() - { - var data = TestObjectsAsPooledList; - using var list = new PooledList(capacity: TestObjectCount, ClearMode.Auto); - list.AddRange(data); - } - - public void RecyclableList_AddRangeWhenSourceIsRecyclableList() - { - var data = TestObjectsAsRecyclableList; - using var list = new RecyclableList(TestObjectCount); - list.AddRange(data); - } - - public void RecyclableLongList_AddRangeWhenSourceIsRecyclableLongList() - { - var data = TestObjectsAsRecyclableList; - using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: TestObjectCount); - list.AddRange(data); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void PooledList_AddRangeWhenSourceIsPooledList() + { + var data = TestObjectsAsPooledList; + using var list = new PooledList(capacity: TestObjectCount, ClearMode.Auto); + list.AddRange(data); + } + + public void RecyclableList_AddRangeWhenSourceIsRecyclableList() + { + var data = TestObjectsAsRecyclableList; + using var list = new RecyclableList(TestObjectCount); + list.AddRange(data); + } + + public void RecyclableLongList_AddRangeWhenSourceIsRecyclableLongList() + { + var data = TestObjectsAsRecyclableList; + using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: TestObjectCount); + list.AddRange(data); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/AddRange_WithCapacity.cs b/Recyclable.Collections.Benchmarks/Benchmarks/AddRange_WithCapacity.cs index 3eac8f4..70813b2 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/AddRange_WithCapacity.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/AddRange_WithCapacity.cs @@ -1,47 +1,47 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_AddRange_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - var list = new long[dataCount]; - data.CopyTo(list, 0); - } - - public void List_AddRange_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - var list = new List(dataCount); - list.AddRange(data); - } - - public void PooledList_AddRange_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new PooledList(capacity: dataCount, ClearMode.Auto); - list.AddRange(data); - } - - public void RecyclableList_AddRange_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new RecyclableList(dataCount); - list.AddRange(data); - } - - public void RecyclableLongList_AddRange_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: dataCount); - list.AddRange(data); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_AddRange_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + var list = new long[dataCount]; + data.CopyTo(list, 0); + } + + public void List_AddRange_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + var list = new List(dataCount); + list.AddRange(data); + } + + public void PooledList_AddRange_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new PooledList(capacity: dataCount, ClearMode.Auto); + list.AddRange(data); + } + + public void RecyclableList_AddRange_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new RecyclableList(dataCount); + list.AddRange(data); + } + + public void RecyclableLongList_AddRange_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: dataCount); + list.AddRange(data); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Add_WithCapacity.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Add_WithCapacity.cs index 7d01ee0..be0fc15 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Add_WithCapacity.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Add_WithCapacity.cs @@ -1,51 +1,51 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void List_Add_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - var list = new List(dataCount); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - - public void PooledList_Add_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new PooledList(capacity: dataCount, ClearMode.Auto); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - - public void RecyclableList_Add_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new RecyclableList(dataCount); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - - public void RecyclableLongList_Add_WithCapacity() - { - var data = TestObjects; - var dataCount = TestObjectCount; - using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: dataCount); - for (var i = 0; i < dataCount; i++) - { - list.Add(data[i]); - } - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void List_Add_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + var list = new List(dataCount); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + + public void PooledList_Add_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new PooledList(capacity: dataCount, ClearMode.Auto); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + + public void RecyclableList_Add_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new RecyclableList(dataCount); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + + public void RecyclableLongList_Add_WithCapacity() + { + var data = TestObjects; + var dataCount = TestObjectCount; + using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: dataCount); + for (var i = 0; i < dataCount; i++) + { + list.Add(data[i]); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/BinarySearch_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/BinarySearch_BestAndWorstCases.cs index 3f5abd3..26323fb 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/BinarySearch_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/BinarySearch_BestAndWorstCases.cs @@ -1,65 +1,65 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_BinarySearch_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.BinarySearch(list, data[i])); - DoNothing(Array.BinarySearch(list, data[^(i + 1)])); - } - } - - public void List_BinarySearch_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.BinarySearch(data[i])); - DoNothing(list.BinarySearch(data[^(i + 1)])); - } - } - - public void PooledList_BinarySearch_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.BinarySearch(data[i])); - DoNothing(list.BinarySearch(data[^(i + 1)])); - } - } - - public void RecyclableList_BinarySearch_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.BinarySearch(data[i])); - DoNothing(list.BinarySearch(data[^(i + 1)])); - } - } - - // public void RecyclableLongList_BinarySearch_BestAndWorstCases() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // for (var i = 0; i < dataCount; i++) - // { - // DoNothing(list.BinarySearch(data[i])); - // DoNothing(list.BinarySearch(data[^(i + 1)])); - // } - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_BinarySearch_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.BinarySearch(list, data[i])); + DoNothing(Array.BinarySearch(list, data[^(i + 1)])); + } + } + + public void List_BinarySearch_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.BinarySearch(data[i])); + DoNothing(list.BinarySearch(data[^(i + 1)])); + } + } + + public void PooledList_BinarySearch_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.BinarySearch(data[i])); + DoNothing(list.BinarySearch(data[^(i + 1)])); + } + } + + public void RecyclableList_BinarySearch_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.BinarySearch(data[i])); + DoNothing(list.BinarySearch(data[^(i + 1)])); + } + } + + // public void RecyclableLongList_BinarySearch_BestAndWorstCases() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // for (var i = 0; i < dataCount; i++) + // { + // DoNothing(list.BinarySearch(data[i])); + // DoNothing(list.BinarySearch(data[^(i + 1)])); + // } + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Contains_FirstItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Contains_FirstItems.cs index 07c1901..0812b83 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Contains_FirstItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Contains_FirstItems.cs @@ -1,60 +1,60 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Contains_FirstItems() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.IndexOf(list, data[i]) >= 0); - } - } - - public void List_Contains_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[i])); - } - } - - public void PooledList_Contains_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[i])); - } - } - - public void RecyclableList_Contains_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[i])); - } - } - - public void RecyclableLongList_Contains_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[i])); - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Contains_FirstItems() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.IndexOf(list, data[i]) >= 0); + } + } + + public void List_Contains_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[i])); + } + } + + public void PooledList_Contains_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[i])); + } + } + + public void RecyclableList_Contains_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[i])); + } + } + + public void RecyclableLongList_Contains_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[i])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Contains_LastItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Contains_LastItems.cs index 30a5dfe..f32a32e 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Contains_LastItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Contains_LastItems.cs @@ -1,60 +1,60 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Contains_LastItems() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[^(i + 1)])); - } - } - - public void List_Contains_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[^(i + 1)])); - } - } - - public void PooledList_Contains_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[^(i + 1)])); - } - } - - public void RecyclableList_Contains_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[^(i + 1)])); - } - } - - public void RecyclableLongList_Contains_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Contains(data[^(i + 1)])); - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Contains_LastItems() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[^(i + 1)])); + } + } + + public void List_Contains_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[^(i + 1)])); + } + } + + public void PooledList_Contains_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[^(i + 1)])); + } + } + + public void RecyclableList_Contains_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[^(i + 1)])); + } + } + + public void RecyclableLongList_Contains_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Contains(data[^(i + 1)])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/ConvertAll.cs b/Recyclable.Collections.Benchmarks/Benchmarks/ConvertAll.cs index 55ec249..fe3c03c 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/ConvertAll.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/ConvertAll.cs @@ -1,48 +1,48 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_ConvertAll() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - DoNothing(Array.ConvertAll(list, static (item) => (long) item)); - } - - public void List_ConvertAll() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - DoNothing(list.ConvertAll(static (item) => (long)item)); - } - - public void PooledList_ConvertAll() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - using var converted = list.ConvertAll(static (item) => (long)item); - DoNothing(converted); - } - - public void RecyclableList_ConvertAll() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - using RecyclableList converted = list.ConvertAll(static (item) => (long)item); - DoNothing(converted); - } - - // public void RecyclableLongList_ConvertAll() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // using RecyclableList converted = list.ConvertAll(static (item) => (long)item); - // DoNothing(converted); - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_ConvertAll() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + DoNothing(Array.ConvertAll(list, static (item) => (long) item)); + } + + public void List_ConvertAll() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + DoNothing(list.ConvertAll(static (item) => (long)item)); + } + + public void PooledList_ConvertAll() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + using var converted = list.ConvertAll(static (item) => (long)item); + DoNothing(converted); + } + + public void RecyclableList_ConvertAll() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + using RecyclableList converted = list.ConvertAll(static (item) => (long)item); + DoNothing(converted); + } + + // public void RecyclableLongList_ConvertAll() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // using RecyclableList converted = list.ConvertAll(static (item) => (long)item); + // DoNothing(converted); + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Count.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Count.cs index 7c30a64..574fe89 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Count.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Count.cs @@ -1,35 +1,35 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Count() - { - var data = TestObjects; - DoNothing(data.Length); - } - - public void List_Count() - { - var data = TestObjectsAsList; - DoNothing(data.Count); - } - - public void PooledList_Count() - { - var data = TestObjectsAsPooledList; - DoNothing(data.Count); - } - - public void RecyclableList_Count() - { - var data = TestObjectsAsRecyclableList; - DoNothing(data.Count); - } - - public void RecyclableLongList_Count() - { - var data = TestObjectsAsRecyclableLongList; - DoNothing(data.Count); - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Count() + { + var data = TestObjects; + DoNothing(data.Length); + } + + public void List_Count() + { + var data = TestObjectsAsList; + DoNothing(data.Count); + } + + public void PooledList_Count() + { + var data = TestObjectsAsPooledList; + DoNothing(data.Count); + } + + public void RecyclableList_Count() + { + var data = TestObjectsAsRecyclableList; + DoNothing(data.Count); + } + + public void RecyclableLongList_Count() + { + var data = TestObjectsAsRecyclableLongList; + DoNothing(data.Count); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Create.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Create.cs index 4a85c5a..cea6aea 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Create.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Create.cs @@ -1,39 +1,39 @@ -using Collections.Pooled; - -#pragma warning disable CA1822, CA1825 - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Create() - { - var list = new long[0]; - DoNothing(list); - } - - public void List_Create() - { - var list = new List(); - DoNothing(list); - } - - public void PooledList_Create() - { - using var list = new PooledList(ClearMode.Auto); - DoNothing(list); - } - - public void RecyclableList_Create() - { - using var list = new RecyclableList(); - DoNothing(list); - } - - public void RecyclableLongList_Create() - { - using var list = new RecyclableLongList(); - DoNothing(list); - } - } -} +using Collections.Pooled; + +#pragma warning disable CA1822, CA1825 + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Create() + { + var list = new long[0]; + DoNothing(list); + } + + public void List_Create() + { + var list = new List(); + DoNothing(list); + } + + public void PooledList_Create() + { + using var list = new PooledList(ClearMode.Auto); + DoNothing(list); + } + + public void RecyclableList_Create() + { + using var list = new RecyclableList(); + DoNothing(list); + } + + public void RecyclableLongList_Create() + { + using var list = new RecyclableLongList(); + DoNothing(list); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Create_WithCapacity.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Create_WithCapacity.cs index b27c3ec..f401479 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Create_WithCapacity.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Create_WithCapacity.cs @@ -1,37 +1,37 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Create_WithCapacity() - { - var data = new long[TestObjectCount]; - DoNothing(data); - } - - public void List_Create_WithCapacity() - { - var list = new List(TestObjectCount); - DoNothing(list); - } - - public void PooledList_Create_WithCapacity() - { - using var list = new PooledList(capacity: TestObjectCount, ClearMode.Auto); - DoNothing(list); - } - - public void RecyclableList_Create_WithCapacity() - { - using var list = new RecyclableList(TestObjectCount); - DoNothing(list); - } - - public void RecyclableLongList_Create_WithCapacity() - { - using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: TestObjectCount); - DoNothing(list); - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Create_WithCapacity() + { + var data = new long[TestObjectCount]; + DoNothing(data); + } + + public void List_Create_WithCapacity() + { + var list = new List(TestObjectCount); + DoNothing(list); + } + + public void PooledList_Create_WithCapacity() + { + using var list = new PooledList(capacity: TestObjectCount, ClearMode.Auto); + DoNothing(list); + } + + public void RecyclableList_Create_WithCapacity() + { + using var list = new RecyclableList(TestObjectCount); + DoNothing(list); + } + + public void RecyclableLongList_Create_WithCapacity() + { + using var list = new RecyclableLongList(minBlockSize: BlockSize, initialCapacity: TestObjectCount); + DoNothing(list); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Exists_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Exists_BestAndWorstCases.cs index f2d7b3f..eacd0be 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Exists_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Exists_BestAndWorstCases.cs @@ -1,65 +1,65 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Exists_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.Exists(list, (x) => x == data[i])); - DoNothing(Array.Exists(list, (x) => x == data[^(i + 1)])); - } - } - - public void List_Exists_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Exists((x) => x == data[i])); - DoNothing(list.Exists((x) => x == data[^(i + 1)])); - } - } - - public void PooledList_Exists_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Exists((x) => x == data[i])); - DoNothing(list.Exists((x) => x == data[^(i + 1)])); - } - } - - public void RecyclableList_Exists_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Exists((x) => x == data[i])); - DoNothing(list.Exists((x) => x == data[^(i + 1)])); - } - } - - // public void RecyclableLongList_Exists_BestAndWorstCases() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // for (var i = 0; i < dataCount; i++) - // { - // DoNothing(list.Exists((x) => x == data[i])); - // DoNothing(list.Exists((x) => x == data[^(i + 1)])); - // } - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Exists_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.Exists(list, (x) => x == data[i])); + DoNothing(Array.Exists(list, (x) => x == data[^(i + 1)])); + } + } + + public void List_Exists_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Exists((x) => x == data[i])); + DoNothing(list.Exists((x) => x == data[^(i + 1)])); + } + } + + public void PooledList_Exists_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Exists((x) => x == data[i])); + DoNothing(list.Exists((x) => x == data[^(i + 1)])); + } + } + + public void RecyclableList_Exists_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Exists((x) => x == data[i])); + DoNothing(list.Exists((x) => x == data[^(i + 1)])); + } + } + + // public void RecyclableLongList_Exists_BestAndWorstCases() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // for (var i = 0; i < dataCount; i++) + // { + // DoNothing(list.Exists((x) => x == data[i])); + // DoNothing(list.Exists((x) => x == data[^(i + 1)])); + // } + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/FindAll_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/FindAll_BestAndWorstCases.cs index fb4443c..d87e8d2 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/FindAll_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/FindAll_BestAndWorstCases.cs @@ -1,80 +1,80 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_FindAll_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.FindAll(list, (item) => item == data[i])); - DoNothing(Array.FindAll(list, (item) => item == data[^(i + 1)])); - } - } - - public void List_FindAll_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.FindAll((item) => item == data[i])); - DoNothing(list.FindAll((item) => item == data[^(i + 1)])); - } - } - - public void PooledList_FindAll_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - var temp = list.FindAll((item) => item == data[i]); - DoNothing(temp); - temp.Dispose(); - - temp = list.FindAll((item) => item == data[^(i + 1)]); - DoNothing(temp); - temp.Dispose(); - } - } - - public void RecyclableList_FindAll_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - var temp = list.FindAll((item) => item == data[i]); - DoNothing(temp); - temp.Dispose(); - - temp = list.FindAll((item) => item == data[^(i + 1)]); - DoNothing(temp); - temp.Dispose(); - } - } - - // public void RecyclableLongList_FindAll_BestAndWorstCases() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // for (var i = 0; i < dataCount; i++) - // { - // var temp = list.FindAll((item) => item == data[i]); - // DoNothing(temp); - // temp.Dispose(); - - // temp = list.FindAll((item) => item == data[^(i + 1)]); - // DoNothing(temp); - // temp.Dispose(); - // } - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_FindAll_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.FindAll(list, (item) => item == data[i])); + DoNothing(Array.FindAll(list, (item) => item == data[^(i + 1)])); + } + } + + public void List_FindAll_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.FindAll((item) => item == data[i])); + DoNothing(list.FindAll((item) => item == data[^(i + 1)])); + } + } + + public void PooledList_FindAll_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + var temp = list.FindAll((item) => item == data[i]); + DoNothing(temp); + temp.Dispose(); + + temp = list.FindAll((item) => item == data[^(i + 1)]); + DoNothing(temp); + temp.Dispose(); + } + } + + public void RecyclableList_FindAll_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + var temp = list.FindAll((item) => item == data[i]); + DoNothing(temp); + temp.Dispose(); + + temp = list.FindAll((item) => item == data[^(i + 1)]); + DoNothing(temp); + temp.Dispose(); + } + } + + // public void RecyclableLongList_FindAll_BestAndWorstCases() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // for (var i = 0; i < dataCount; i++) + // { + // var temp = list.FindAll((item) => item == data[i]); + // DoNothing(temp); + // temp.Dispose(); + + // temp = list.FindAll((item) => item == data[^(i + 1)]); + // DoNothing(temp); + // temp.Dispose(); + // } + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/FindLastIndex_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/FindLastIndex_BestAndWorstCases.cs index b7338e1..0f77b35 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/FindLastIndex_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/FindLastIndex_BestAndWorstCases.cs @@ -1,63 +1,63 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_FindLastIndex_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); - // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); - for (var i = 0; i < dataCount; i++) - { - // Console.WriteLine($"data.Length={data.Length}"); - // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); - // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); - DoNothing(Array.FindLastIndex(list, 0, (x) => x == data[i])); - DoNothing(Array.FindLastIndex(list, 0, (x) => x == data[^(i + 1)])); - } - } - - public void List_FindLastIndex_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); - // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); - for (var i = 0; i < dataCount; i++) - { - // Console.WriteLine($"data.Length={data.Length}"); - // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); - // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); - DoNothing(list.FindLastIndex(0, (x) => x == data[i])); - DoNothing(list.FindLastIndex(0, (x) => x == data[^(i + 1)])); - } - } - - public void RecyclableList_FindLastIndex_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.FindLastIndex(0, (x) => x == data[i])); - DoNothing(list.FindLastIndex(0, (x) => x == data[^(i + 1)])); - } - } - - // public void RecyclableLongList_FindLastIndex_BestAndWorstCases() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // for (var i = 0; i < dataCount; i++) - // { - // DoNothing(list.FindLastIndex(0, (x) => x == data[i])); - // DoNothing(list.FindLastIndex(0, (x) => x == data[^(i + 1)])); - // } - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_FindLastIndex_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); + // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); + for (var i = 0; i < dataCount; i++) + { + // Console.WriteLine($"data.Length={data.Length}"); + // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); + // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); + DoNothing(Array.FindLastIndex(list, 0, (x) => x == data[i])); + DoNothing(Array.FindLastIndex(list, 0, (x) => x == data[^(i + 1)])); + } + } + + public void List_FindLastIndex_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); + // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); + for (var i = 0; i < dataCount; i++) + { + // Console.WriteLine($"data.Length={data.Length}"); + // Console.WriteLine($"{nameof(TestObjectCount)}={TestObjectCount}"); + // Console.WriteLine($"{nameof(TestObjectCountForSlowMethods)}={TestObjectCountForSlowMethods}"); + DoNothing(list.FindLastIndex(0, (x) => x == data[i])); + DoNothing(list.FindLastIndex(0, (x) => x == data[^(i + 1)])); + } + } + + public void RecyclableList_FindLastIndex_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.FindLastIndex(0, (x) => x == data[i])); + DoNothing(list.FindLastIndex(0, (x) => x == data[^(i + 1)])); + } + } + + // public void RecyclableLongList_FindLastIndex_BestAndWorstCases() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // for (var i = 0; i < dataCount; i++) + // { + // DoNothing(list.FindLastIndex(0, (x) => x == data[i])); + // DoNothing(list.FindLastIndex(0, (x) => x == data[^(i + 1)])); + // } + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/FindLast_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/FindLast_BestAndWorstCases.cs index ef7ac79..03948fe 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/FindLast_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/FindLast_BestAndWorstCases.cs @@ -1,53 +1,53 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_FindLast_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.FindLast(list, (x) => x == data[i])); - DoNothing(Array.FindLast(list, (x) => x == data[^(i + 1)])); - } - } - - public void List_FindLast_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.FindLast((x) => x == data[i])); - DoNothing(list.FindLast((x) => x == data[^(i + 1)])); - } - } - - public void RecyclableList_FindLast_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.FindLast((x) => x == data[i])); - DoNothing(list.FindLast((x) => x == data[^(i + 1)])); - } - } - - // public void RecyclableLongList_FindLast_BestAndWorstCases() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // for (var i = 0; i < dataCount; i++) - // { - // DoNothing(list.FindLast((x) => x == data[i])); - // DoNothing(list.FindLast((x) => x == data[^(i + 1)])); - // } - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_FindLast_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.FindLast(list, (x) => x == data[i])); + DoNothing(Array.FindLast(list, (x) => x == data[^(i + 1)])); + } + } + + public void List_FindLast_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.FindLast((x) => x == data[i])); + DoNothing(list.FindLast((x) => x == data[^(i + 1)])); + } + } + + public void RecyclableList_FindLast_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.FindLast((x) => x == data[i])); + DoNothing(list.FindLast((x) => x == data[^(i + 1)])); + } + } + + // public void RecyclableLongList_FindLast_BestAndWorstCases() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // for (var i = 0; i < dataCount; i++) + // { + // DoNothing(list.FindLast((x) => x == data[i])); + // DoNothing(list.FindLast((x) => x == data[^(i + 1)])); + // } + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Find_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Find_BestAndWorstCases.cs index 4f677da..e02ea56 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Find_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Find_BestAndWorstCases.cs @@ -1,53 +1,53 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_Find_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.Find(list, (x) => x == data[i])); - DoNothing(Array.Find(list, (x) => x == data[^(i + 1)])); - } - } - - public void List_Find_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Find((x) => x == data[i])); - DoNothing(list.Find((x) => x == data[^(i + 1)])); - } - } - - public void RecyclableList_Find_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Find((x) => x == data[i])); - DoNothing(list.Find((x) => x == data[^(i + 1)])); - } - } - - // public void RecyclableLongList_Find_BestAndWorstCases() - // { - // var data = TestObjects; - // var list = TestObjectsAsRecyclableLongList; - // var dataCount = TestObjectCountForSlowMethods; - // for (var i = 0; i < dataCount; i++) - // { - // DoNothing(list.Find((x) => x == data[i])); - // DoNothing(list.Find((x) => x == data[^(i + 1)])); - // } - // } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_Find_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.Find(list, (x) => x == data[i])); + DoNothing(Array.Find(list, (x) => x == data[^(i + 1)])); + } + } + + public void List_Find_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Find((x) => x == data[i])); + DoNothing(list.Find((x) => x == data[^(i + 1)])); + } + } + + public void RecyclableList_Find_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Find((x) => x == data[i])); + DoNothing(list.Find((x) => x == data[^(i + 1)])); + } + } + + // public void RecyclableLongList_Find_BestAndWorstCases() + // { + // var data = TestObjects; + // var list = TestObjectsAsRecyclableLongList; + // var dataCount = TestObjectCountForSlowMethods; + // for (var i = 0; i < dataCount; i++) + // { + // DoNothing(list.Find((x) => x == data[i])); + // DoNothing(list.Find((x) => x == data[^(i + 1)])); + // } + // } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/ForEach.cs b/Recyclable.Collections.Benchmarks/Benchmarks/ForEach.cs index b3df02a..fe146ce 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/ForEach.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/ForEach.cs @@ -1,85 +1,85 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_ForEach() - { - foreach (var item in TestObjects) - { - DoNothing(item); - } - } - - public void Array_VersionedForEach() - { - foreach (var item in TestObjects) - { - DoNothing(item); - } - } - - public void List_ForEach() - { - foreach (var item in TestObjectsAsList) - { - DoNothing(item); - } - } - - public void List_VersionedForEach() - { - foreach (var item in TestObjectsAsList) - { - DoNothing(item); - } - } - - public void PooledList_ForEach() - { - foreach (var item in TestObjectsAsPooledList) - { - DoNothing(item); - } - } - - public void PooledList_VersionedForEach() - { - foreach (var item in TestObjectsAsPooledList) - { - DoNothing(item); - } - } - - public void RecyclableList_ForEach() - { - foreach (var item in TestObjectsAsRecyclableList) - { - DoNothing(item); - } - } - - public void RecyclableList_VersionedForEach() - { - foreach (var item in (IRecyclableVersionedList)TestObjectsAsRecyclableList) - { - DoNothing(item); - } - } - - public void RecyclableLongList_ForEach() - { - foreach (var item in TestObjectsAsRecyclableLongList) - { - DoNothing(item); - } - } - - public void RecyclableLongList_VersionedForEach() - { - foreach (var item in (IRecyclableVersionedLongList)TestObjectsAsRecyclableLongList) - { - DoNothing(item); - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_ForEach() + { + foreach (var item in TestObjects) + { + DoNothing(item); + } + } + + public void Array_VersionedForEach() + { + foreach (var item in TestObjects) + { + DoNothing(item); + } + } + + public void List_ForEach() + { + foreach (var item in TestObjectsAsList) + { + DoNothing(item); + } + } + + public void List_VersionedForEach() + { + foreach (var item in TestObjectsAsList) + { + DoNothing(item); + } + } + + public void PooledList_ForEach() + { + foreach (var item in TestObjectsAsPooledList) + { + DoNothing(item); + } + } + + public void PooledList_VersionedForEach() + { + foreach (var item in TestObjectsAsPooledList) + { + DoNothing(item); + } + } + + public void RecyclableList_ForEach() + { + foreach (var item in TestObjectsAsRecyclableList) + { + DoNothing(item); + } + } + + public void RecyclableList_VersionedForEach() + { + foreach (var item in (IRecyclableVersionedList)TestObjectsAsRecyclableList) + { + DoNothing(item); + } + } + + public void RecyclableLongList_ForEach() + { + foreach (var item in TestObjectsAsRecyclableLongList) + { + DoNothing(item); + } + } + + public void RecyclableLongList_VersionedForEach() + { + foreach (var item in (IRecyclableVersionedLongList)TestObjectsAsRecyclableLongList) + { + DoNothing(item); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/GetItem..cs b/Recyclable.Collections.Benchmarks/Benchmarks/GetItem..cs index b8fcb3f..31bc635 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/GetItem..cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/GetItem..cs @@ -1,158 +1,158 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_GetItem() - { - var data = TestObjects; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void List_GetItem() - { - var data = TestObjectsAsList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void PooledList_GetItem() - { - var data = TestObjectsAsPooledList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void RecyclableList_GetItem() - { - var data = TestObjectsAsRecyclableList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void RecyclableLongList_GetItem() - { - var data = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void RecyclableLongList_GetItem_AsSpan() - { - var data = TestObjectsAsRecyclableLongList; - int blockSize = data.BlockSize; - int nextItemBlockIndex = data.NextItemBlockIndex; - - var memoryBlocks = new Span(data.AsArray, 0, data.LastBlockWithData + 1); - for (var blockIndex = 0; blockIndex < nextItemBlockIndex; blockIndex++) - { - var memoryBlock = new Span(memoryBlocks[blockIndex], 0, blockSize); - for (var itemIndex = 0; itemIndex < blockSize; itemIndex++) - { - DoNothing(memoryBlock[itemIndex]); - } - } - - if (nextItemBlockIndex == data.LastBlockWithData) - { - var memoryBlock = new Span(memoryBlocks[nextItemBlockIndex], 0, data.NextItemIndex); - for (var itemIndex = 0; itemIndex < memoryBlock.Length; itemIndex++) - { - DoNothing(memoryBlock[itemIndex]); - } - } - } - - public void RecyclableLongList_GetItem_AsArray() - { - var data = TestObjectsAsRecyclableLongList; - int blockSize = data.BlockSize; - int nextItemBlockIndex = data.NextItemBlockIndex; - - var memoryBlocks = data.AsArray; - for (var blockIndex = 0; blockIndex < nextItemBlockIndex; blockIndex++) - { - var memoryBlock = memoryBlocks[blockIndex]; - for (var itemIndex = 0; itemIndex < blockSize; itemIndex++) - { - DoNothing(memoryBlock[itemIndex]); - } - } - - if (nextItemBlockIndex == data.LastBlockWithData) - { - var memoryBlock = memoryBlocks[nextItemBlockIndex]; - blockSize = data.NextItemIndex; - for (var itemIndex = 0; itemIndex < blockSize; itemIndex++) - { - DoNothing(memoryBlock[itemIndex]); - } - } - } - - public void RecyclableLongList_GetItem_AsForEach() - { - var data = TestObjectsAsRecyclableLongList; - foreach (var item in data) - { - DoNothing(item); - } - } - - public void RecyclableLongList_GetItem_AsWhile() - { - var data = TestObjectsAsRecyclableLongList; - long dataCount = TestObjectCount; - if (dataCount == 0) - { - return; - } - - int blockSize = data.BlockSize; - int nextItemBlockIndex = data.NextItemBlockIndex; - int itemIndex = 0; - int blockIndex = 0; - var memoryBlocks = data.AsArray; - var memoryBlock = memoryBlocks[0]; - while (blockIndex < nextItemBlockIndex) - { - DoNothing(memoryBlock[itemIndex]); - if (itemIndex + 1 < blockSize) - { - itemIndex++; - } - else - { - blockIndex++; - memoryBlock = memoryBlocks[blockIndex]; - itemIndex = 0; - } - } - - if (nextItemBlockIndex == data.LastBlockWithData) - { - memoryBlock = memoryBlocks[nextItemBlockIndex]; - blockSize = data.NextItemIndex; - while (itemIndex < blockSize) - { - DoNothing(memoryBlock[itemIndex++]); - } - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_GetItem() + { + var data = TestObjects; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void List_GetItem() + { + var data = TestObjectsAsList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void PooledList_GetItem() + { + var data = TestObjectsAsPooledList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void RecyclableList_GetItem() + { + var data = TestObjectsAsRecyclableList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void RecyclableLongList_GetItem() + { + var data = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void RecyclableLongList_GetItem_AsSpan() + { + var data = TestObjectsAsRecyclableLongList; + int blockSize = data.BlockSize; + int nextItemBlockIndex = data.NextItemBlockIndex; + + var memoryBlocks = new Span(data.AsArray, 0, data.LastBlockWithData + 1); + for (var blockIndex = 0; blockIndex < nextItemBlockIndex; blockIndex++) + { + var memoryBlock = new Span(memoryBlocks[blockIndex], 0, blockSize); + for (var itemIndex = 0; itemIndex < blockSize; itemIndex++) + { + DoNothing(memoryBlock[itemIndex]); + } + } + + if (nextItemBlockIndex == data.LastBlockWithData) + { + var memoryBlock = new Span(memoryBlocks[nextItemBlockIndex], 0, data.NextItemIndex); + for (var itemIndex = 0; itemIndex < memoryBlock.Length; itemIndex++) + { + DoNothing(memoryBlock[itemIndex]); + } + } + } + + public void RecyclableLongList_GetItem_AsArray() + { + var data = TestObjectsAsRecyclableLongList; + int blockSize = data.BlockSize; + int nextItemBlockIndex = data.NextItemBlockIndex; + + var memoryBlocks = data.AsArray; + for (var blockIndex = 0; blockIndex < nextItemBlockIndex; blockIndex++) + { + var memoryBlock = memoryBlocks[blockIndex]; + for (var itemIndex = 0; itemIndex < blockSize; itemIndex++) + { + DoNothing(memoryBlock[itemIndex]); + } + } + + if (nextItemBlockIndex == data.LastBlockWithData) + { + var memoryBlock = memoryBlocks[nextItemBlockIndex]; + blockSize = data.NextItemIndex; + for (var itemIndex = 0; itemIndex < blockSize; itemIndex++) + { + DoNothing(memoryBlock[itemIndex]); + } + } + } + + public void RecyclableLongList_GetItem_AsForEach() + { + var data = TestObjectsAsRecyclableLongList; + foreach (var item in data) + { + DoNothing(item); + } + } + + public void RecyclableLongList_GetItem_AsWhile() + { + var data = TestObjectsAsRecyclableLongList; + long dataCount = TestObjectCount; + if (dataCount == 0) + { + return; + } + + int blockSize = data.BlockSize; + int nextItemBlockIndex = data.NextItemBlockIndex; + int itemIndex = 0; + int blockIndex = 0; + var memoryBlocks = data.AsArray; + var memoryBlock = memoryBlocks[0]; + while (blockIndex < nextItemBlockIndex) + { + DoNothing(memoryBlock[itemIndex]); + if (itemIndex + 1 < blockSize) + { + itemIndex++; + } + else + { + blockIndex++; + memoryBlock = memoryBlocks[blockIndex]; + itemIndex = 0; + } + } + + if (nextItemBlockIndex == data.LastBlockWithData) + { + memoryBlock = memoryBlocks[nextItemBlockIndex]; + blockSize = data.NextItemIndex; + while (itemIndex < blockSize) + { + DoNothing(memoryBlock[itemIndex++]); + } + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_BestAndWorstCases.cs b/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_BestAndWorstCases.cs index e1d182c..8045331 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_BestAndWorstCases.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_BestAndWorstCases.cs @@ -1,77 +1,77 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_IndexOf_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.IndexOf(list, data[i])); - DoNothing(Array.IndexOf(list, data[^(i + 1)])); - } - } - - public void List_IndexOf_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void PooledList_IndexOf_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void RecyclableList_IndexOf_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void RecyclableLongList_IndexOf_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void RecyclableLongList_LongIndexOf_BestAndWorstCases() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - DoNothing(list.LongIndexOf(data[^(i + 1)])); - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_IndexOf_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.IndexOf(list, data[i])); + DoNothing(Array.IndexOf(list, data[^(i + 1)])); + } + } + + public void List_IndexOf_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void PooledList_IndexOf_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void RecyclableList_IndexOf_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void RecyclableLongList_IndexOf_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void RecyclableLongList_LongIndexOf_BestAndWorstCases() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + DoNothing(list.LongIndexOf(data[^(i + 1)])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_FirstItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_FirstItems.cs index f552702..4db3386 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_FirstItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_FirstItems.cs @@ -1,71 +1,71 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_IndexOf_FirstItems() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.IndexOf(list, data[i])); - } - } - - public void List_IndexOf_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - } - } - - public void PooledList_IndexOf_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - } - } - - public void RecyclableList_IndexOf_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - } - } - - public void RecyclableLongList_IndexOf_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[i])); - } - } - - public void RecyclableLongList_LongIndexOf_FirstItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.LongIndexOf(data[i])); - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_IndexOf_FirstItems() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.IndexOf(list, data[i])); + } + } + + public void List_IndexOf_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + } + } + + public void PooledList_IndexOf_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + } + } + + public void RecyclableList_IndexOf_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + } + } + + public void RecyclableLongList_IndexOf_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[i])); + } + } + + public void RecyclableLongList_LongIndexOf_FirstItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.LongIndexOf(data[i])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_LastItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_LastItems.cs index 1b7681f..5c5b20a 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_LastItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/IndexOf_LastItems.cs @@ -1,71 +1,71 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_IndexOf_LastItems() - { - var data = TestObjects; - var list = TestObjects; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(Array.IndexOf(list, data[^(i + 1)])); - } - } - - public void List_IndexOf_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void PooledList_IndexOf_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsPooledList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void RecyclableList_IndexOf_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void RecyclableLongList_IndexOf_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.IndexOf(data[^(i + 1)])); - } - } - - public void RecyclableLongList_LongIndexOf_LastItems() - { - var data = TestObjects; - var list = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCountForSlowMethods; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.LongIndexOf(data[^(i + 1)])); - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_IndexOf_LastItems() + { + var data = TestObjects; + var list = TestObjects; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(Array.IndexOf(list, data[^(i + 1)])); + } + } + + public void List_IndexOf_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void PooledList_IndexOf_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsPooledList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void RecyclableList_IndexOf_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void RecyclableLongList_IndexOf_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.IndexOf(data[^(i + 1)])); + } + } + + public void RecyclableLongList_LongIndexOf_LastItems() + { + var data = TestObjects; + var list = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCountForSlowMethods; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.LongIndexOf(data[^(i + 1)])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/LongCount.cs b/Recyclable.Collections.Benchmarks/Benchmarks/LongCount.cs index 9640ecd..34f122d 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/LongCount.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/LongCount.cs @@ -1,17 +1,17 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_LongCount() - { - var data = TestObjects; - DoNothing(data.LongLength); - } - - public void RecyclableLongList_LongCount() - { - var data = TestObjectsAsRecyclableLongList; - DoNothing(data.LongCount); - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_LongCount() + { + var data = TestObjects; + DoNothing(data.LongLength); + } + + public void RecyclableLongList_LongCount() + { + var data = TestObjectsAsRecyclableLongList; + DoNothing(data.LongCount); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs b/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs index 55f0b46..c1ad25e 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs @@ -1,102 +1,102 @@ -using System.Reflection; -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks -{ - public enum RecyclableCollectionsBenchmarkType - { - Unknown, Add_WithCapacity, Add, AddRange_WithCapacity, AddRangeWhenSourceIsArray, AddRangeWhenSourceIsIEnumerable, - AddRangeWhenSourceIsIList, AddRangeWhenSourceIsList, AddRangeWhenSourceIsSameType, BinarySearch_BestAndWorstCases, - Contains_FirstItems, Contains_LastItems, ConvertAll, Count, Create_WithCapacity, Create, Exists_BestAndWorstCases, - Find_BestAndWorstCases, FindAll_BestAndWorstCases, FindLast_BestAndWorstCases, FindLastIndex_BestAndWorstCases, - ForEach, GetItem, IndexOf_BestAndWorstCases,IndexOf_FirstItems, IndexOf_LastItems, LongCount, - Remove_FirstItems, Remove_LastItems, RemoveAt_FirstItems, RemoveAt_LastItems, - SetItem, VersionedForEach - } - - public partial class RecyclableCollectionsBenchmarks : RecyclableBenchmarkBase - { - public RecyclableCollectionsBenchmarks() - { - TestObjectCount = 1; - //BaseDataType = RecyclableCollectionsBenchmarkSource.List; - DataType = RecyclableCollectionsBenchmarkSource.RecyclableList; - } - - [Params - ( - RecyclableCollectionsBenchmarkType.Add_WithCapacity, - RecyclableCollectionsBenchmarkType.Add, - RecyclableCollectionsBenchmarkType.AddRange_WithCapacity, - RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsArray, - RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsIEnumerable, - RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsIList, - RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsList, - RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsSameType, - RecyclableCollectionsBenchmarkType.BinarySearch_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.Contains_FirstItems, - RecyclableCollectionsBenchmarkType.Contains_LastItems, - RecyclableCollectionsBenchmarkType.ConvertAll, - RecyclableCollectionsBenchmarkType.Count, - RecyclableCollectionsBenchmarkType.Create_WithCapacity, - RecyclableCollectionsBenchmarkType.Create, - RecyclableCollectionsBenchmarkType.Exists_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.Find_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.FindAll_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.FindLast_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.FindLastIndex_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.ForEach, - RecyclableCollectionsBenchmarkType.GetItem, - RecyclableCollectionsBenchmarkType.IndexOf_BestAndWorstCases, - RecyclableCollectionsBenchmarkType.IndexOf_FirstItems, - RecyclableCollectionsBenchmarkType.IndexOf_LastItems, - RecyclableCollectionsBenchmarkType.LongCount, - RecyclableCollectionsBenchmarkType.Remove_FirstItems, - RecyclableCollectionsBenchmarkType.Remove_LastItems, - RecyclableCollectionsBenchmarkType.RemoveAt_FirstItems, - RecyclableCollectionsBenchmarkType.RemoveAt_LastItems, - RecyclableCollectionsBenchmarkType.SetItem, - RecyclableCollectionsBenchmarkType.VersionedForEach - )] - - public RecyclableCollectionsBenchmarkType TestCase { get; set; } = RecyclableCollectionsBenchmarkType.IndexOf_BestAndWorstCases; - - [Params - ( - RecyclableCollectionsBenchmarkSource.List - )] - public override RecyclableCollectionsBenchmarkSource BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } - - [Params - ( - RecyclableCollectionsBenchmarkSource.Array, - RecyclableCollectionsBenchmarkSource.List, - RecyclableCollectionsBenchmarkSource.PooledList, - RecyclableCollectionsBenchmarkSource.RecyclableList, - RecyclableCollectionsBenchmarkSource.RecyclableLongList - )] - public override RecyclableCollectionsBenchmarkSource DataType { get => base.DataType; set => base.DataType = value; } - - protected override Action? GetTestMethod(RecyclableCollectionsBenchmarkSource benchmarkType) - => TestCase switch - { - RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsSameType => (Action?)GetType().GetMethod($"{benchmarkType}_AddRangeWhenSourceIs{benchmarkType}", BindingFlags.Instance | BindingFlags.Public)?.CreateDelegate(typeof(Action), this), - _ => (Action?) GetType().GetMethod($"{benchmarkType}_{TestCase}", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)?.CreateDelegate(typeof(Action), this) ?? throw new InvalidOperationException($"Method {benchmarkType}_{TestCase} not found in class {GetType().FullName}") - }; - - public override void Setup() - { - base.Setup(); - switch(TestCase) - { - case RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsIList: - PrepareData(RecyclableCollectionsBenchmarkSource.RecyclableLongList); - break; - - case RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsSameType: - PrepareData(RecyclableCollectionsBenchmarkSource.RecyclableList); - break; - } - } - } -} +using System.Reflection; +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks +{ + public enum RecyclableCollectionsBenchmarkType + { + Unknown, Add_WithCapacity, Add, AddRange_WithCapacity, AddRangeWhenSourceIsArray, AddRangeWhenSourceIsIEnumerable, + AddRangeWhenSourceIsIList, AddRangeWhenSourceIsList, AddRangeWhenSourceIsSameType, BinarySearch_BestAndWorstCases, + Contains_FirstItems, Contains_LastItems, ConvertAll, Count, Create_WithCapacity, Create, Exists_BestAndWorstCases, + Find_BestAndWorstCases, FindAll_BestAndWorstCases, FindLast_BestAndWorstCases, FindLastIndex_BestAndWorstCases, + ForEach, GetItem, IndexOf_BestAndWorstCases,IndexOf_FirstItems, IndexOf_LastItems, LongCount, + Remove_FirstItems, Remove_LastItems, RemoveAt_FirstItems, RemoveAt_LastItems, + SetItem, VersionedForEach + } + + public partial class RecyclableCollectionsBenchmarks : RecyclableBenchmarkBase + { + public RecyclableCollectionsBenchmarks() + { + TestObjectCount = 1; + //BaseDataType = RecyclableCollectionsBenchmarkSource.List; + DataType = RecyclableCollectionsBenchmarkSource.RecyclableList; + } + + [Params + ( + RecyclableCollectionsBenchmarkType.Add_WithCapacity, + RecyclableCollectionsBenchmarkType.Add, + RecyclableCollectionsBenchmarkType.AddRange_WithCapacity, + RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsArray, + RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsIEnumerable, + RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsIList, + RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsList, + RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsSameType, + RecyclableCollectionsBenchmarkType.BinarySearch_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.Contains_FirstItems, + RecyclableCollectionsBenchmarkType.Contains_LastItems, + RecyclableCollectionsBenchmarkType.ConvertAll, + RecyclableCollectionsBenchmarkType.Count, + RecyclableCollectionsBenchmarkType.Create_WithCapacity, + RecyclableCollectionsBenchmarkType.Create, + RecyclableCollectionsBenchmarkType.Exists_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.Find_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.FindAll_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.FindLast_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.FindLastIndex_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.ForEach, + RecyclableCollectionsBenchmarkType.GetItem, + RecyclableCollectionsBenchmarkType.IndexOf_BestAndWorstCases, + RecyclableCollectionsBenchmarkType.IndexOf_FirstItems, + RecyclableCollectionsBenchmarkType.IndexOf_LastItems, + RecyclableCollectionsBenchmarkType.LongCount, + RecyclableCollectionsBenchmarkType.Remove_FirstItems, + RecyclableCollectionsBenchmarkType.Remove_LastItems, + RecyclableCollectionsBenchmarkType.RemoveAt_FirstItems, + RecyclableCollectionsBenchmarkType.RemoveAt_LastItems, + RecyclableCollectionsBenchmarkType.SetItem, + RecyclableCollectionsBenchmarkType.VersionedForEach + )] + + public RecyclableCollectionsBenchmarkType TestCase { get; set; } = RecyclableCollectionsBenchmarkType.IndexOf_BestAndWorstCases; + + [Params + ( + RecyclableCollectionsBenchmarkSource.List + )] + public override RecyclableCollectionsBenchmarkSource BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } + + [Params + ( + RecyclableCollectionsBenchmarkSource.Array, + RecyclableCollectionsBenchmarkSource.List, + RecyclableCollectionsBenchmarkSource.PooledList, + RecyclableCollectionsBenchmarkSource.RecyclableList, + RecyclableCollectionsBenchmarkSource.RecyclableLongList + )] + public override RecyclableCollectionsBenchmarkSource DataType { get => base.DataType; set => base.DataType = value; } + + protected override Action? GetTestMethod(RecyclableCollectionsBenchmarkSource benchmarkType) + => TestCase switch + { + RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsSameType => (Action?)GetType().GetMethod($"{benchmarkType}_AddRangeWhenSourceIs{benchmarkType}", BindingFlags.Instance | BindingFlags.Public)?.CreateDelegate(typeof(Action), this), + _ => (Action?) GetType().GetMethod($"{benchmarkType}_{TestCase}", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)?.CreateDelegate(typeof(Action), this) ?? throw new InvalidOperationException($"Method {benchmarkType}_{TestCase} not found in class {GetType().FullName}") + }; + + public override void Setup() + { + base.Setup(); + switch(TestCase) + { + case RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsIList: + PrepareData(RecyclableCollectionsBenchmarkSource.RecyclableLongList); + break; + + case RecyclableCollectionsBenchmarkType.AddRangeWhenSourceIsSameType: + PrepareData(RecyclableCollectionsBenchmarkSource.RecyclableList); + break; + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_FirstItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_FirstItems.cs index c4f7059..fe5b2c6 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_FirstItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_FirstItems.cs @@ -1,51 +1,51 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void List_RemoveAt_FirstItems() - { - var data = TestObjects; - var list = new List(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - list.RemoveAt(0); - } - } - - public void PooledList_RemoveAt_FirstItems() - { - var data = TestObjects; - using var list = new PooledList(data, ClearMode.Auto); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - list.RemoveAt(0); - } - } - - public void RecyclableList_RemoveAt_FirstItems() - { - var data = TestObjects; - using var list = new RecyclableList(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - list.RemoveAt(0); - } - } - - public void RecyclableLongList_RemoveAt_FirstItems() - { - var data = TestObjects; - using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity: base.TestObjectCount); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - list.RemoveAt(0); - } - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void List_RemoveAt_FirstItems() + { + var data = TestObjects; + var list = new List(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + list.RemoveAt(0); + } + } + + public void PooledList_RemoveAt_FirstItems() + { + var data = TestObjects; + using var list = new PooledList(data, ClearMode.Auto); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + list.RemoveAt(0); + } + } + + public void RecyclableList_RemoveAt_FirstItems() + { + var data = TestObjects; + using var list = new RecyclableList(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + list.RemoveAt(0); + } + } + + public void RecyclableLongList_RemoveAt_FirstItems() + { + var data = TestObjects; + using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity: base.TestObjectCount); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + list.RemoveAt(0); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_LastItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_LastItems.cs index abbadbb..ac5455d 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_LastItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/RemoveAt_LastItems.cs @@ -1,51 +1,51 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void List_RemoveAt_LastItems() - { - var data = TestObjects; - var list = new List(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - list.RemoveAt(i); - } - } - - public void PooledList_RemoveAt_LastItems() - { - var data = TestObjects; - using var list = new PooledList(data, ClearMode.Auto); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - list.RemoveAt(i); - } - } - - public void RecyclableList_RemoveAt_LastItems() - { - var data = TestObjects; - using var list = new RecyclableList(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - list.RemoveAt(i); - } - } - - public void RecyclableLongList_RemoveAt_LastItems() - { - var data = TestObjects; - using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity: base.TestObjectCount); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - list.RemoveAt(i); - } - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void List_RemoveAt_LastItems() + { + var data = TestObjects; + var list = new List(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + list.RemoveAt(i); + } + } + + public void PooledList_RemoveAt_LastItems() + { + var data = TestObjects; + using var list = new PooledList(data, ClearMode.Auto); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + list.RemoveAt(i); + } + } + + public void RecyclableList_RemoveAt_LastItems() + { + var data = TestObjects; + using var list = new RecyclableList(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + list.RemoveAt(i); + } + } + + public void RecyclableLongList_RemoveAt_LastItems() + { + var data = TestObjects; + using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity: base.TestObjectCount); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + list.RemoveAt(i); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Remove_FirstItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Remove_FirstItems.cs index 659d17f..f43a904 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Remove_FirstItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Remove_FirstItems.cs @@ -1,51 +1,51 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void List_Remove_FirstItems() - { - var data = TestObjects; - var list = new List(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Remove(data[i])); - } - } - - public void PooledList_Remove_FirstItems() - { - var data = TestObjects; - using var list = new PooledList(data, ClearMode.Auto); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Remove(data[i])); - } - } - - public void RecyclableList_Remove_FirstItems() - { - var data = TestObjects; - using var list = new RecyclableList(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Remove(data[i])); - } - } - - public void RecyclableLongList_Remove_FirstItems() - { - var data = TestObjects; - using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity: base.TestObjectCount); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - DoNothing(list.Remove(data[i])); - } - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void List_Remove_FirstItems() + { + var data = TestObjects; + var list = new List(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Remove(data[i])); + } + } + + public void PooledList_Remove_FirstItems() + { + var data = TestObjects; + using var list = new PooledList(data, ClearMode.Auto); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Remove(data[i])); + } + } + + public void RecyclableList_Remove_FirstItems() + { + var data = TestObjects; + using var list = new RecyclableList(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Remove(data[i])); + } + } + + public void RecyclableLongList_Remove_FirstItems() + { + var data = TestObjects; + using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity: base.TestObjectCount); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + DoNothing(list.Remove(data[i])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/Remove_LastItems.cs b/Recyclable.Collections.Benchmarks/Benchmarks/Remove_LastItems.cs index af08df1..622e1bb 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/Remove_LastItems.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/Remove_LastItems.cs @@ -1,51 +1,51 @@ -using Collections.Pooled; - -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void List_Remove_LastItems() - { - var data = TestObjects; - var list = new List(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - DoNothing(list.Remove(data[i])); - } - } - - public void PooledList_Remove_LastItems() - { - var data = TestObjects; - using var list = new PooledList(data, ClearMode.Auto); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - DoNothing(list.Remove(data[i])); - } - } - - public void RecyclableList_Remove_LastItems() - { - var data = TestObjects; - using var list = new RecyclableList(data); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - DoNothing(list.Remove(data[i])); - } - } - - public void RecyclableLongList_Remove_LastItems() - { - var data = TestObjects; - using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity:base.TestObjectCount); - var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; - for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) - { - DoNothing(list.Remove(data[i])); - } - } - } -} +using Collections.Pooled; + +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void List_Remove_LastItems() + { + var data = TestObjects; + var list = new List(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + DoNothing(list.Remove(data[i])); + } + } + + public void PooledList_Remove_LastItems() + { + var data = TestObjects; + using var list = new PooledList(data, ClearMode.Auto); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + DoNothing(list.Remove(data[i])); + } + } + + public void RecyclableList_Remove_LastItems() + { + var data = TestObjects; + using var list = new RecyclableList(data); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + DoNothing(list.Remove(data[i])); + } + } + + public void RecyclableLongList_Remove_LastItems() + { + var data = TestObjects; + using var list = new RecyclableLongList(data, minBlockSize: BlockSize, initialCapacity:base.TestObjectCount); + var dataCount = TestObjectCount / 10 > 0 ? TestObjectCount / 10 : TestObjectCount; + for (var i = data.Length - 1; i > data.Length - dataCount - 1; i--) + { + DoNothing(list.Remove(data[i])); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/SetItem.cs b/Recyclable.Collections.Benchmarks/Benchmarks/SetItem.cs index aad2f78..0636412 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/SetItem.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/SetItem.cs @@ -1,56 +1,56 @@ -namespace Recyclable.Collections.Benchmarks -{ - public partial class RecyclableCollectionsBenchmarks - { - public void Array_SetItem() - { - var data = TestObjects; - var dataCount = TestObjectCount; - long index = 0; - for (var i = 0; i < dataCount; i++) - { - data[index] = TestObjects[index++]; - } - } - - public void List_SetItem() - { - var data = TestObjectsAsList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - data[i] = TestObjects[i]; - } - } - - public void PooledList_SetItem() - { - var data = TestObjectsAsPooledList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - data[i] = TestObjects[i]; - } - } - - public void RecyclableList_SetItem() - { - var data = TestObjectsAsRecyclableList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - data[i] = TestObjects[i]; - } - } - - public void RecyclableLongList_SetItem() - { - var data = TestObjectsAsRecyclableLongList; - var dataCount = TestObjectCount; - for (var i = 0; i < dataCount; i++) - { - data[i] = TestObjects[i]; - } - } - } -} +namespace Recyclable.Collections.Benchmarks +{ + public partial class RecyclableCollectionsBenchmarks + { + public void Array_SetItem() + { + var data = TestObjects; + var dataCount = TestObjectCount; + long index = 0; + for (var i = 0; i < dataCount; i++) + { + data[index] = TestObjects[index++]; + } + } + + public void List_SetItem() + { + var data = TestObjectsAsList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + data[i] = TestObjects[i]; + } + } + + public void PooledList_SetItem() + { + var data = TestObjectsAsPooledList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + data[i] = TestObjects[i]; + } + } + + public void RecyclableList_SetItem() + { + var data = TestObjectsAsRecyclableList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + data[i] = TestObjects[i]; + } + } + + public void RecyclableLongList_SetItem() + { + var data = TestObjectsAsRecyclableLongList; + var dataCount = TestObjectCount; + for (var i = 0; i < dataCount; i++) + { + data[i] = TestObjects[i]; + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Core/DataGenerator.cs b/Recyclable.Collections.Benchmarks/Core/DataGenerator.cs index faaaf4e..0615a16 100644 --- a/Recyclable.Collections.Benchmarks/Core/DataGenerator.cs +++ b/Recyclable.Collections.Benchmarks/Core/DataGenerator.cs @@ -1,19 +1,19 @@ -namespace Recyclable.Collections.Benchmarks.Core -{ - public static class DataGenerator - { - public static long[] EnumerateTestObjects(long testObjectCount) - { - var result = new long[testObjectCount]; - Console.WriteLine("******* TEST DATA ARRAY CREATED *******"); - - Span resultSpan = result; - for (int i = 0; i < testObjectCount; i++) - { - resultSpan[i] = i; - } - - return result; - } - } +namespace Recyclable.Collections.Benchmarks.Core +{ + public static class DataGenerator + { + public static long[] EnumerateTestObjects(long testObjectCount) + { + var result = new long[testObjectCount]; + Console.WriteLine("******* TEST DATA ARRAY CREATED *******"); + + Span resultSpan = result; + for (int i = 0; i < testObjectCount; i++) + { + resultSpan[i] = i; + } + + return result; + } + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/POC/ArraySizeLimitPoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/ArraySizeLimitPoc.Benchmarks.cs index e46231a..af9df5b 100644 --- a/Recyclable.Collections.Benchmarks/POC/ArraySizeLimitPoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/ArraySizeLimitPoc.Benchmarks.cs @@ -1,70 +1,70 @@ -using BenchmarkDotNet.Attributes; -using System.Buffers; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public enum ArraySizeLimitPocBenchmarkType - { - ArraySizeLimit - } - - public class ArraySizeLimitPocBenchmarks : PocBenchmarkBase - { - public static void Run() - { - var benchmark = new ArraySizeLimitPocBenchmarks(); - benchmark.Setup(); - FindArraySizeLimit(); - benchmark.Cleanup(); - } - - [Params(2_147_483_605)] - public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } - - [Benchmark(OperationsPerInvoke = 1)] - public void Max_Allowed_Size_2_147_483_605() - { - long[] arr = ArrayPool.Shared.Rent(TestObjectCount); - DoNothing(arr); - } - - [Benchmark(OperationsPerInvoke = 1)] - public static void FindArraySizeLimit() - { - var pool = ArrayPool.Shared; - var bufferSize = int.MaxValue / 2; - var oldValue = 0; - while (true) - { - try - { - Console.Write($"Allocating {bufferSize}..."); - var arr = pool.Rent(bufferSize); - Console.WriteLine("success"); - pool.Return(arr); - arr = null; - - var nextValue = bufferSize - oldValue; - oldValue = bufferSize; - bufferSize = checked(bufferSize + nextValue); - - GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); - } - catch (Exception) - { - Console.WriteLine("error"); - var nextValue = (bufferSize - oldValue) >> 1; - if (nextValue == 0) - { - break; - } - - bufferSize = oldValue + nextValue; - } - } - - Console.WriteLine("All done"); - throw new Exception($"Everything was successful. You can create {oldValue} byte big arrays. Exception is logged to prevent more benchmarks."); - } - } -} +using BenchmarkDotNet.Attributes; +using System.Buffers; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public enum ArraySizeLimitPocBenchmarkType + { + ArraySizeLimit + } + + public class ArraySizeLimitPocBenchmarks : PocBenchmarkBase + { + public static void Run() + { + var benchmark = new ArraySizeLimitPocBenchmarks(); + benchmark.Setup(); + FindArraySizeLimit(); + benchmark.Cleanup(); + } + + [Params(2_147_483_605)] + public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } + + [Benchmark(OperationsPerInvoke = 1)] + public void Max_Allowed_Size_2_147_483_605() + { + long[] arr = ArrayPool.Shared.Rent(TestObjectCount); + DoNothing(arr); + } + + [Benchmark(OperationsPerInvoke = 1)] + public static void FindArraySizeLimit() + { + var pool = ArrayPool.Shared; + var bufferSize = int.MaxValue / 2; + var oldValue = 0; + while (true) + { + try + { + Console.Write($"Allocating {bufferSize}..."); + var arr = pool.Rent(bufferSize); + Console.WriteLine("success"); + pool.Return(arr); + arr = null; + + var nextValue = bufferSize - oldValue; + oldValue = bufferSize; + bufferSize = checked(bufferSize + nextValue); + + GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); + } + catch (Exception) + { + Console.WriteLine("error"); + var nextValue = (bufferSize - oldValue) >> 1; + if (nextValue == 0) + { + break; + } + + bufferSize = oldValue + nextValue; + } + } + + Console.WriteLine("All done"); + throw new Exception($"Everything was successful. You can create {oldValue} byte big arrays. Exception is logged to prevent more benchmarks."); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/BoolOrComparePoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/BoolOrComparePoc.Benchmarks.cs index 755b2a0..d29a129 100644 --- a/Recyclable.Collections.Benchmarks/POC/BoolOrComparePoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/BoolOrComparePoc.Benchmarks.cs @@ -1,63 +1,63 @@ -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public enum BoolOrComparePocBenchmarkType - { - Bool, - Compare, - } - - [MemoryDiagnoser] - public class BoolOrComparePocBenchmarks : PocBenchmarkBase - { - [Params(BoolOrComparePocBenchmarkType.Bool, BoolOrComparePocBenchmarkType.Compare)] - public override BoolOrComparePocBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } - - [Params(8)] - public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } - - [Params(true)] - public bool TestBool = true; - - public static void Run() - { - var benchmark = new BoolOrComparePocBenchmarks(); - benchmark.Setup(); - benchmark.Bool(); - benchmark.Compare(); - benchmark.Cleanup(); - } - - public void Bool() - { - if (TestBool) - { - DoNothing(TestBool); - } - else - { - DoNothing(TestBool); - } - } - - public void Compare() - { - if (TestObjectCount >= RecyclableDefaults.MinPooledArrayLength) - { - DoNothing(TestBool); - } - else - { - DoNothing(TestBool); - } - } - - protected override Action? GetTestMethod(BoolOrComparePocBenchmarkType benchmarkType) => benchmarkType switch - { - BoolOrComparePocBenchmarkType.Bool => Bool, - BoolOrComparePocBenchmarkType.Compare => Compare, - _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), - }; - } +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public enum BoolOrComparePocBenchmarkType + { + Bool, + Compare, + } + + [MemoryDiagnoser] + public class BoolOrComparePocBenchmarks : PocBenchmarkBase + { + [Params(BoolOrComparePocBenchmarkType.Bool, BoolOrComparePocBenchmarkType.Compare)] + public override BoolOrComparePocBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } + + [Params(8)] + public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } + + [Params(true)] + public bool TestBool = true; + + public static void Run() + { + var benchmark = new BoolOrComparePocBenchmarks(); + benchmark.Setup(); + benchmark.Bool(); + benchmark.Compare(); + benchmark.Cleanup(); + } + + public void Bool() + { + if (TestBool) + { + DoNothing(TestBool); + } + else + { + DoNothing(TestBool); + } + } + + public void Compare() + { + if (TestObjectCount >= RecyclableDefaults.MinPooledArrayLength) + { + DoNothing(TestBool); + } + else + { + DoNothing(TestBool); + } + } + + protected override Action? GetTestMethod(BoolOrComparePocBenchmarkType benchmarkType) => benchmarkType switch + { + BoolOrComparePocBenchmarkType.Bool => Bool, + BoolOrComparePocBenchmarkType.Compare => Compare, + _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), + }; + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs index fea010f..3cb8f55 100644 --- a/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs @@ -1,346 +1,346 @@ -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public enum DelegateVsComparerPocBenchmarkType - { - Comparer, - Delegate, - Func, - ListOfBoxedStructs, - ListOfClasses, - ListOfComparers, - ListOfDelegates, - ListOfFuncs, - ListOfLocalFuncs, - ListOfStructs, - ListOfUnboxedReadOnlyStructs, - ListOfUnboxedStructs, - StaticFunc, - } - - [MemoryDiagnoser] - public class DelegateVsComparerPocBenchmarks : PocBenchmarkBase - { - [Params - ( - DelegateVsComparerPocBenchmarkType.Delegate, - DelegateVsComparerPocBenchmarkType.Func, - DelegateVsComparerPocBenchmarkType.ListOfBoxedStructs, - DelegateVsComparerPocBenchmarkType.ListOfClasses, - DelegateVsComparerPocBenchmarkType.ListOfComparers, - DelegateVsComparerPocBenchmarkType.ListOfDelegates, - DelegateVsComparerPocBenchmarkType.ListOfFuncs, - DelegateVsComparerPocBenchmarkType.ListOfLocalFuncs, - DelegateVsComparerPocBenchmarkType.ListOfStructs, - DelegateVsComparerPocBenchmarkType.ListOfUnboxedReadOnlyStructs, - DelegateVsComparerPocBenchmarkType.ListOfUnboxedStructs, - DelegateVsComparerPocBenchmarkType.StaticFunc - )] - public override DelegateVsComparerPocBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } - - [Params(DelegateVsComparerPocBenchmarkType.Comparer)] - public override DelegateVsComparerPocBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } - - #region Dummy classes - - private delegate T Compare(T x, T y); - - public readonly struct MyComparerReadOnlyStruct : IComparer - { - public int Compare(T? x, T? y) => Comparer.Default.Compare(x, y); - } - - private struct MyComparerStruct : IComparer - { - public readonly int Compare(T? x, T? y) => Comparer.Default.Compare(x, y); - } - - private class MyComparer : IComparer - { - public int Compare(long x, long y) => (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0, - }; - } - - #endregion - - public static void Run() - { - var benchmark = new DelegateVsComparerPocBenchmarks(); - benchmark.Setup(); - benchmark.Comparer(); - benchmark.Delegate(); - benchmark.Func(); - benchmark.ListOfBoxedStructs(); - benchmark.ListOfClasses(); - benchmark.ListOfComparers(); - benchmark.ListOfDelegates(); - benchmark.ListOfFuncs(); - benchmark.ListOfLocalFuncs(); - benchmark.ListOfStructs(); - benchmark.ListOfUnboxedReadOnlyStructs(); - benchmark.ListOfUnboxedStructs(); - benchmark.StaticFunc(); - benchmark.Cleanup(); - } - - private static readonly Comparer _comparer = Comparer.Default; - private IEnumerable? _testObjects; - private IEnumerable>? _testListOfFunctions; - private IEnumerable>? _testListOfComparers; - private IEnumerable>? _testListOfDelegates; - private IEnumerable>? _testListOfLocalFunctions; - private IEnumerable? _testListOfClasses; - private IEnumerable>? _testListOfStructs; - private IEnumerable>? _testListOfBoxedStructs; - private IEnumerable TestListOfUnboxedStructs() where TComparer : IComparer, new() - { - foreach (var _ in _testObjects!) - { - yield return new TComparer(); - } - } - - private static IEnumerable> GetLocalFunctions(IEnumerable testObjects) - { - static int compareFunc(long x, long y) - { - return (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0 - }; - } - - foreach (var _ in testObjects) - { - yield return compareFunc; - } - } - - private void TestWithComparer(IComparer comparer) - { - var testData = _testObjects!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length - 1; itemIdx++) - { - _ = comparer.Compare(testData[itemIdx], testData[itemIdx + 1]); - } - } - - private void TestWithDelegate(Compare compareFunc) - { - var testData = _testObjects!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length - 1; itemIdx++) - { - _ = compareFunc(testData[itemIdx], testData[itemIdx + 1]); - } - } - - private void TestWithFunc(Func compareFunc) - { - var testData = _testObjects!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length - 1; itemIdx++) - { - _ = compareFunc(testData[itemIdx], testData[itemIdx + 1]); - } - } - - public void Comparer() - { - TestWithComparer(_comparer); - } - - public void Func() - { - TestWithFunc((x, y) => (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0 - }); - } - - public void StaticFunc() - { - TestWithFunc(static (x, y) => (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0 - }); - } - - public void Delegate() - { - TestWithDelegate((x, y) => (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0 - }); - } - - public void ListOfFuncs() - { - const long x = 2, y = 5; - var testData = _testListOfFunctions!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var compareFunc = testData[itemIdx]; - _ = compareFunc(x, y); - } - } - - public void ListOfLocalFuncs() - { - const long x = 2, y = 5; - var testData = _testListOfLocalFunctions!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var compareFunc = testData[itemIdx]; - _ = compareFunc(x, y); - } - } - - public void ListOfComparers() - { - const long x = 2, y = 5; - var testData = _testListOfComparers!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var comparer = testData[itemIdx]; - _ = comparer.Compare(x, y); - } - } - - public void ListOfClasses() - { - const long x = 2, y = 5; - var testData = _testListOfClasses!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var comparer = testData[itemIdx]; - _ = comparer.Compare(x, y); - } - } - - public void ListOfStructs() - { - const long x = 2, y = 5; - var testData = _testListOfStructs!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var comparer = testData[itemIdx]; - _ = comparer.Compare(x, y); - } - } - - public void ListOfBoxedStructs() - { - const long x = 2, y = 5; - var testData = _testListOfBoxedStructs!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var comparer = testData[itemIdx]; - _ = comparer.Compare(x, y); - } - } - - public void ListOfUnboxedStructs() - { - const long x = 2, y = 5; - var testData = TestListOfUnboxedStructs, long>().ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var comparer = testData[itemIdx]; - _ = comparer.Compare(x, y); - } - } - - public void ListOfUnboxedReadOnlyStructs() - { - const long x = 2, y = 5; - var testData = TestListOfUnboxedStructs, long>().ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var comparer = testData[itemIdx]; - _ = comparer.Compare(x, y); - } - } - - public void ListOfDelegates() - { - const long x = 2, y = 5; - var testData = _testListOfDelegates!.ToArray(); - for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) - { - var compareDelegate = testData[itemIdx]; - _ = compareDelegate(x, y); - } - } - - protected override Action? GetTestMethod(DelegateVsComparerPocBenchmarkType benchmarkType) => benchmarkType switch - { - DelegateVsComparerPocBenchmarkType.Comparer => Comparer, - DelegateVsComparerPocBenchmarkType.Delegate => Delegate, - DelegateVsComparerPocBenchmarkType.Func => Func, - DelegateVsComparerPocBenchmarkType.ListOfBoxedStructs => ListOfBoxedStructs, - DelegateVsComparerPocBenchmarkType.ListOfClasses => ListOfClasses, - DelegateVsComparerPocBenchmarkType.ListOfComparers => ListOfComparers, - DelegateVsComparerPocBenchmarkType.ListOfDelegates => ListOfDelegates, - DelegateVsComparerPocBenchmarkType.ListOfFuncs => ListOfFuncs, - DelegateVsComparerPocBenchmarkType.ListOfLocalFuncs => ListOfLocalFuncs, - DelegateVsComparerPocBenchmarkType.ListOfStructs => ListOfStructs, - DelegateVsComparerPocBenchmarkType.ListOfUnboxedReadOnlyStructs => ListOfUnboxedReadOnlyStructs, - DelegateVsComparerPocBenchmarkType.ListOfUnboxedStructs => ListOfUnboxedStructs, - DelegateVsComparerPocBenchmarkType.StaticFunc => StaticFunc, - _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), - }; - - public override void Setup() - { - Console.WriteLine("******* SETTING UP COMMON TEST DATA *******"); - _testObjects = Enumerable.Range(1, TestObjectCount).Select(x => (long)x); - base.Setup(); - } - - public override void Cleanup() - { - _testObjects = null; - base.Cleanup(); - } - - protected override void PrepareData(T benchmarkType) - { - switch (benchmarkType) - { - case DelegateVsComparerPocBenchmarkType.ListOfBoxedStructs: - _testListOfBoxedStructs = _testObjects!.Select(_ => (IComparer)new MyComparerStruct()); - break; - case DelegateVsComparerPocBenchmarkType.ListOfClasses: - _testListOfClasses = _testObjects!.Select(_ => new MyComparer()); - break; - case DelegateVsComparerPocBenchmarkType.ListOfComparers: - _testListOfComparers = _testObjects!.Select(_ => (IComparer)new MyComparer()); - break; - case DelegateVsComparerPocBenchmarkType.ListOfDelegates: - _testListOfDelegates = _testObjects!.Select(_ => new Compare((x, y) => new MyComparer().Compare(x, y))); - break; - case DelegateVsComparerPocBenchmarkType.ListOfFuncs: - _testListOfFunctions = _testObjects!.Select>(static _ => new MyComparer().Compare); - break; - case DelegateVsComparerPocBenchmarkType.ListOfLocalFuncs: - _testListOfLocalFunctions = GetLocalFunctions(_testObjects!); - break; - case DelegateVsComparerPocBenchmarkType.ListOfStructs: - _testListOfStructs = _testObjects!.Select(_ => new MyComparerStruct()); - break; - } - } - } -} +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public enum DelegateVsComparerPocBenchmarkType + { + Comparer, + Delegate, + Func, + ListOfBoxedStructs, + ListOfClasses, + ListOfComparers, + ListOfDelegates, + ListOfFuncs, + ListOfLocalFuncs, + ListOfStructs, + ListOfUnboxedReadOnlyStructs, + ListOfUnboxedStructs, + StaticFunc, + } + + [MemoryDiagnoser] + public class DelegateVsComparerPocBenchmarks : PocBenchmarkBase + { + [Params + ( + DelegateVsComparerPocBenchmarkType.Delegate, + DelegateVsComparerPocBenchmarkType.Func, + DelegateVsComparerPocBenchmarkType.ListOfBoxedStructs, + DelegateVsComparerPocBenchmarkType.ListOfClasses, + DelegateVsComparerPocBenchmarkType.ListOfComparers, + DelegateVsComparerPocBenchmarkType.ListOfDelegates, + DelegateVsComparerPocBenchmarkType.ListOfFuncs, + DelegateVsComparerPocBenchmarkType.ListOfLocalFuncs, + DelegateVsComparerPocBenchmarkType.ListOfStructs, + DelegateVsComparerPocBenchmarkType.ListOfUnboxedReadOnlyStructs, + DelegateVsComparerPocBenchmarkType.ListOfUnboxedStructs, + DelegateVsComparerPocBenchmarkType.StaticFunc + )] + public override DelegateVsComparerPocBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } + + [Params(DelegateVsComparerPocBenchmarkType.Comparer)] + public override DelegateVsComparerPocBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } + + #region Dummy classes + + private delegate T Compare(T x, T y); + + public readonly struct MyComparerReadOnlyStruct : IComparer + { + public int Compare(T? x, T? y) => Comparer.Default.Compare(x, y); + } + + private struct MyComparerStruct : IComparer + { + public readonly int Compare(T? x, T? y) => Comparer.Default.Compare(x, y); + } + + private class MyComparer : IComparer + { + public int Compare(long x, long y) => (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0, + }; + } + + #endregion + + public static void Run() + { + var benchmark = new DelegateVsComparerPocBenchmarks(); + benchmark.Setup(); + benchmark.Comparer(); + benchmark.Delegate(); + benchmark.Func(); + benchmark.ListOfBoxedStructs(); + benchmark.ListOfClasses(); + benchmark.ListOfComparers(); + benchmark.ListOfDelegates(); + benchmark.ListOfFuncs(); + benchmark.ListOfLocalFuncs(); + benchmark.ListOfStructs(); + benchmark.ListOfUnboxedReadOnlyStructs(); + benchmark.ListOfUnboxedStructs(); + benchmark.StaticFunc(); + benchmark.Cleanup(); + } + + private static readonly Comparer _comparer = Comparer.Default; + private IEnumerable? _testObjects; + private IEnumerable>? _testListOfFunctions; + private IEnumerable>? _testListOfComparers; + private IEnumerable>? _testListOfDelegates; + private IEnumerable>? _testListOfLocalFunctions; + private IEnumerable? _testListOfClasses; + private IEnumerable>? _testListOfStructs; + private IEnumerable>? _testListOfBoxedStructs; + private IEnumerable TestListOfUnboxedStructs() where TComparer : IComparer, new() + { + foreach (var _ in _testObjects!) + { + yield return new TComparer(); + } + } + + private static IEnumerable> GetLocalFunctions(IEnumerable testObjects) + { + static int compareFunc(long x, long y) + { + return (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0 + }; + } + + foreach (var _ in testObjects) + { + yield return compareFunc; + } + } + + private void TestWithComparer(IComparer comparer) + { + var testData = _testObjects!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length - 1; itemIdx++) + { + _ = comparer.Compare(testData[itemIdx], testData[itemIdx + 1]); + } + } + + private void TestWithDelegate(Compare compareFunc) + { + var testData = _testObjects!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length - 1; itemIdx++) + { + _ = compareFunc(testData[itemIdx], testData[itemIdx + 1]); + } + } + + private void TestWithFunc(Func compareFunc) + { + var testData = _testObjects!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length - 1; itemIdx++) + { + _ = compareFunc(testData[itemIdx], testData[itemIdx + 1]); + } + } + + public void Comparer() + { + TestWithComparer(_comparer); + } + + public void Func() + { + TestWithFunc((x, y) => (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0 + }); + } + + public void StaticFunc() + { + TestWithFunc(static (x, y) => (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0 + }); + } + + public void Delegate() + { + TestWithDelegate((x, y) => (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0 + }); + } + + public void ListOfFuncs() + { + const long x = 2, y = 5; + var testData = _testListOfFunctions!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var compareFunc = testData[itemIdx]; + _ = compareFunc(x, y); + } + } + + public void ListOfLocalFuncs() + { + const long x = 2, y = 5; + var testData = _testListOfLocalFunctions!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var compareFunc = testData[itemIdx]; + _ = compareFunc(x, y); + } + } + + public void ListOfComparers() + { + const long x = 2, y = 5; + var testData = _testListOfComparers!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var comparer = testData[itemIdx]; + _ = comparer.Compare(x, y); + } + } + + public void ListOfClasses() + { + const long x = 2, y = 5; + var testData = _testListOfClasses!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var comparer = testData[itemIdx]; + _ = comparer.Compare(x, y); + } + } + + public void ListOfStructs() + { + const long x = 2, y = 5; + var testData = _testListOfStructs!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var comparer = testData[itemIdx]; + _ = comparer.Compare(x, y); + } + } + + public void ListOfBoxedStructs() + { + const long x = 2, y = 5; + var testData = _testListOfBoxedStructs!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var comparer = testData[itemIdx]; + _ = comparer.Compare(x, y); + } + } + + public void ListOfUnboxedStructs() + { + const long x = 2, y = 5; + var testData = TestListOfUnboxedStructs, long>().ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var comparer = testData[itemIdx]; + _ = comparer.Compare(x, y); + } + } + + public void ListOfUnboxedReadOnlyStructs() + { + const long x = 2, y = 5; + var testData = TestListOfUnboxedStructs, long>().ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var comparer = testData[itemIdx]; + _ = comparer.Compare(x, y); + } + } + + public void ListOfDelegates() + { + const long x = 2, y = 5; + var testData = _testListOfDelegates!.ToArray(); + for (var itemIdx = 0; itemIdx < testData.Length; itemIdx++) + { + var compareDelegate = testData[itemIdx]; + _ = compareDelegate(x, y); + } + } + + protected override Action? GetTestMethod(DelegateVsComparerPocBenchmarkType benchmarkType) => benchmarkType switch + { + DelegateVsComparerPocBenchmarkType.Comparer => Comparer, + DelegateVsComparerPocBenchmarkType.Delegate => Delegate, + DelegateVsComparerPocBenchmarkType.Func => Func, + DelegateVsComparerPocBenchmarkType.ListOfBoxedStructs => ListOfBoxedStructs, + DelegateVsComparerPocBenchmarkType.ListOfClasses => ListOfClasses, + DelegateVsComparerPocBenchmarkType.ListOfComparers => ListOfComparers, + DelegateVsComparerPocBenchmarkType.ListOfDelegates => ListOfDelegates, + DelegateVsComparerPocBenchmarkType.ListOfFuncs => ListOfFuncs, + DelegateVsComparerPocBenchmarkType.ListOfLocalFuncs => ListOfLocalFuncs, + DelegateVsComparerPocBenchmarkType.ListOfStructs => ListOfStructs, + DelegateVsComparerPocBenchmarkType.ListOfUnboxedReadOnlyStructs => ListOfUnboxedReadOnlyStructs, + DelegateVsComparerPocBenchmarkType.ListOfUnboxedStructs => ListOfUnboxedStructs, + DelegateVsComparerPocBenchmarkType.StaticFunc => StaticFunc, + _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), + }; + + public override void Setup() + { + Console.WriteLine("******* SETTING UP COMMON TEST DATA *******"); + _testObjects = Enumerable.Range(1, TestObjectCount).Select(x => (long)x); + base.Setup(); + } + + public override void Cleanup() + { + _testObjects = null; + base.Cleanup(); + } + + protected override void PrepareData(T benchmarkType) + { + switch (benchmarkType) + { + case DelegateVsComparerPocBenchmarkType.ListOfBoxedStructs: + _testListOfBoxedStructs = _testObjects!.Select(_ => (IComparer)new MyComparerStruct()); + break; + case DelegateVsComparerPocBenchmarkType.ListOfClasses: + _testListOfClasses = _testObjects!.Select(_ => new MyComparer()); + break; + case DelegateVsComparerPocBenchmarkType.ListOfComparers: + _testListOfComparers = _testObjects!.Select(_ => (IComparer)new MyComparer()); + break; + case DelegateVsComparerPocBenchmarkType.ListOfDelegates: + _testListOfDelegates = _testObjects!.Select(_ => new Compare((x, y) => new MyComparer().Compare(x, y))); + break; + case DelegateVsComparerPocBenchmarkType.ListOfFuncs: + _testListOfFunctions = _testObjects!.Select>(static _ => new MyComparer().Compare); + break; + case DelegateVsComparerPocBenchmarkType.ListOfLocalFuncs: + _testListOfLocalFunctions = GetLocalFunctions(_testObjects!); + break; + case DelegateVsComparerPocBenchmarkType.ListOfStructs: + _testListOfStructs = _testObjects!.Select(_ => new MyComparerStruct()); + break; + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs b/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs index b1c2a55..96b2fcd 100644 --- a/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs @@ -1,40 +1,40 @@ -using BenchmarkDotNet.Attributes; -using FluentAssertions; -using Recyclable.CollectionsTests; - -namespace Recyclable.Collections.Benchmarks.POC -{ - - public class EqualVsContainsInConsecutiveOrderBenchmarks : IDisposable - { - private const int TestItemsCount = 10000; - - private readonly IEnumerable _list1 = RecyclableLongListTestData.CreateTestData(TestItemsCount).ToRecyclableList(); - private readonly IEnumerable _list2 = RecyclableLongListTestData.CreateTestData(TestItemsCount).ToArray(); - - [Benchmark(Baseline = true)] - public void Equal() - { - _ = _list1.Should().Equal(_list2); - } - - [Benchmark] - public void ContainsInConsecutiveOrder() - { - _ = _list1.Should().ContainInConsecutiveOrder(_list2); - } - - public void Dispose() - { - if (_list1 is IDisposable disposable1) - { - disposable1.Dispose(); - } - - if (_list2 is IDisposable disposable2) - { - disposable2.Dispose(); - } - } - } -} +using BenchmarkDotNet.Attributes; +using FluentAssertions; +using Recyclable.CollectionsTests; + +namespace Recyclable.Collections.Benchmarks.POC +{ + + public class EqualVsContainsInConsecutiveOrderBenchmarks : IDisposable + { + private const int TestItemsCount = 10000; + + private readonly IEnumerable _list1 = RecyclableLongListTestData.CreateTestData(TestItemsCount).ToRecyclableList(); + private readonly IEnumerable _list2 = RecyclableLongListTestData.CreateTestData(TestItemsCount).ToArray(); + + [Benchmark(Baseline = true)] + public void Equal() + { + _ = _list1.Should().Equal(_list2); + } + + [Benchmark] + public void ContainsInConsecutiveOrder() + { + _ = _list1.Should().ContainInConsecutiveOrder(_list2); + } + + public void Dispose() + { + if (_list1 is IDisposable disposable1) + { + disposable1.Dispose(); + } + + if (_list2 is IDisposable disposable2) + { + disposable2.Dispose(); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/GreaterOperatorvsDoesntEqualOperator.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/GreaterOperatorvsDoesntEqualOperator.Benchmarks.cs index fbaac50..7432e85 100644 --- a/Recyclable.Collections.Benchmarks/POC/GreaterOperatorvsDoesntEqualOperator.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/GreaterOperatorvsDoesntEqualOperator.Benchmarks.cs @@ -1,57 +1,57 @@ -using BenchmarkDotNet.Attributes; -using System.Runtime.CompilerServices; - -#pragma warning disable CA1822 - -namespace Recyclable.Collections.Benchmarks.POC -{ - public class GreaterOperatorVsDoesntEqualOperatorBenchmarks - { - private static readonly long num = RecyclableDefaults.MinItemsCountForParallelization; - - public void Setup() - { - Console.WriteLine($"*** We're comparing if {num} is < 0 ***"); - } - - public void Cleanup() { } - -#pragma warning disable RCS1163, IDE0060 - [MethodImpl(MethodImplOptions.NoInlining)] - private static void DoNothing(T item) - { - } - -#pragma warning restore RCS1163 - - [Benchmark(Baseline = true)] - public void CompareWithGreater() - { - DoNothing(num > 0 ? 1 : 0); - } - - [Benchmark] - public void CompareWithGreaterEqual() - { - DoNothing(num >= 0 ? 1 : 0); - } - - [Benchmark] - public void CompareWithDoesntEqual() - { - DoNothing(num != 0 ? 1 : 0); - } - - [Benchmark] - public void CompareWithLess() - { - DoNothing(num < 0 ? 1 : 0); - } - - [Benchmark] - public void CompareWithEqual() - { - DoNothing(num == 0 ? 0 : 1); - } - } -} +using BenchmarkDotNet.Attributes; +using System.Runtime.CompilerServices; + +#pragma warning disable CA1822 + +namespace Recyclable.Collections.Benchmarks.POC +{ + public class GreaterOperatorVsDoesntEqualOperatorBenchmarks + { + private static readonly long num = RecyclableDefaults.MinItemsCountForParallelization; + + public void Setup() + { + Console.WriteLine($"*** We're comparing if {num} is < 0 ***"); + } + + public void Cleanup() { } + +#pragma warning disable RCS1163, IDE0060 + [MethodImpl(MethodImplOptions.NoInlining)] + private static void DoNothing(T item) + { + } + +#pragma warning restore RCS1163 + + [Benchmark(Baseline = true)] + public void CompareWithGreater() + { + DoNothing(num > 0 ? 1 : 0); + } + + [Benchmark] + public void CompareWithGreaterEqual() + { + DoNothing(num >= 0 ? 1 : 0); + } + + [Benchmark] + public void CompareWithDoesntEqual() + { + DoNothing(num != 0 ? 1 : 0); + } + + [Benchmark] + public void CompareWithLess() + { + DoNothing(num < 0 ? 1 : 0); + } + + [Benchmark] + public void CompareWithEqual() + { + DoNothing(num == 0 ? 0 : 1); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/LessOperatorvsAndOperatorBenchmarks.cs b/Recyclable.Collections.Benchmarks/POC/LessOperatorvsAndOperatorBenchmarks.cs index 6781143..bdca391 100644 --- a/Recyclable.Collections.Benchmarks/POC/LessOperatorvsAndOperatorBenchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/LessOperatorvsAndOperatorBenchmarks.cs @@ -1,54 +1,54 @@ -using BenchmarkDotNet.Attributes; -using System.Runtime.CompilerServices; - -#pragma warning disable CA1822 - -namespace Recyclable.Collections.Benchmarks.POC -{ - public class LessOperatorVsAndOperatorBenchmarks - { - private const int bitShift = 1 << 31; - private static readonly Random _rnd = new(1); - private static int num = -Math.Abs(_rnd.Next()); - - public void Setup() - { - num = -1; - Console.WriteLine($"*** We're comparing if {num} is < 0 ***"); - } - - public void Cleanup() { } - -#pragma warning disable RCS1163, IDE0060 - [MethodImpl(MethodImplOptions.NoInlining)] - private static void DoNothing(T item) - { - } - -#pragma warning restore RCS1163 - - [Benchmark(Baseline = true)] - public void CompareWithLess() - { - DoNothing(num < 0); - } - - [Benchmark] - public void CompareWithAnd() - { - DoNothing((num & bitShift) != 0); - } - - [Benchmark] - public void CompareWithEqual() - { - DoNothing(num == -1); - } - - [Benchmark] - public void CompareToZero() - { - DoNothing(num == 0); - } - } -} +using BenchmarkDotNet.Attributes; +using System.Runtime.CompilerServices; + +#pragma warning disable CA1822 + +namespace Recyclable.Collections.Benchmarks.POC +{ + public class LessOperatorVsAndOperatorBenchmarks + { + private const int bitShift = 1 << 31; + private static readonly Random _rnd = new(1); + private static int num = -Math.Abs(_rnd.Next()); + + public void Setup() + { + num = -1; + Console.WriteLine($"*** We're comparing if {num} is < 0 ***"); + } + + public void Cleanup() { } + +#pragma warning disable RCS1163, IDE0060 + [MethodImpl(MethodImplOptions.NoInlining)] + private static void DoNothing(T item) + { + } + +#pragma warning restore RCS1163 + + [Benchmark(Baseline = true)] + public void CompareWithLess() + { + DoNothing(num < 0); + } + + [Benchmark] + public void CompareWithAnd() + { + DoNothing((num & bitShift) != 0); + } + + [Benchmark] + public void CompareWithEqual() + { + DoNothing(num == -1); + } + + [Benchmark] + public void CompareToZero() + { + DoNothing(num == 0); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/ModuloPoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/ModuloPoc.Benchmarks.cs index 7416e5d..6a59ef4 100644 --- a/Recyclable.Collections.Benchmarks/POC/ModuloPoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/ModuloPoc.Benchmarks.cs @@ -1,376 +1,376 @@ -using BenchmarkDotNet.Attributes; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -#pragma warning disable xUnit1026, RCS1163, IDE0060 - -namespace Recyclable.Collections.Benchmarks.POC -{ - [MemoryDiagnoser] - public class ModuloPocBenchmarks - { - public static void Run() - { - var benchmark = new ModuloPocBenchmarks(); - benchmark.Setup(); - benchmark.AddWithFor(); - benchmark.AddWithForOptimized(); - benchmark.DividerAndModulusWithOperator(); - benchmark.MathDivRem(); - benchmark.MixedApproachWithForLoopOptimized(); - benchmark.MixedApproachWithSubtractWithStackalloc(); - benchmark.MixedApproachWithSubtractWithWhile(); - benchmark.MixedApproachWithSubtractWithWhileAsVector(); - benchmark.MixedApproachWithSubtractWithWhileWithSse2(); - benchmark.SubtractWithWhile(); - benchmark.SubtractWithWhileWithSse2(); - benchmark.XDivYMulX(); - benchmark.XDivYMulXWithLocalVar(); - } - - private long _cutoff; - private Vector128 _increment; - private long _lastCaseIndex; - - [GlobalSetup] - public void Setup() - { - _cutoff = checked((long)BlockSize << 4); - _increment = Vector128.Create(-BlockSize, 1L); - _lastCaseIndex = 0; - } - - private static void DoNothing(T result, T remainder, [CallerMemberName] string? callerName = null) - { - //Console.WriteLine($"{callerName}: result = {result}, remainder = {remainder}"); - } - - //[Params(123, 10, 2, int.MaxValue, int.MaxValue / 2, int.MaxValue / 3, int.MaxValue / 4, int.MaxValue / 6, int.MaxValue / 10, int.MaxValue / 15, int.MaxValue / 20)] - [Params(int.MaxValue, int.MaxValue / 2, int.MaxValue / 3, int.MaxValue / 4, int.MaxValue / 6, int.MaxValue / 8, int.MaxValue / 10, int.MaxValue / 100)] - //[Params(int.MaxValue / 10, int.MaxValue / 20, int.MaxValue / 100)] - public int BlockSize { get; set; } = int.MaxValue; - - [Params(int.MaxValue, int.MaxValue / 1000, int.MaxValue / 10000)] - //[Params(int.MaxValue)] - //[Params(int.MaxValue * 100L)] - public long TestNumber { get; set; } = int.MaxValue; - - private void CalculateDividerAndModulusWithOperator(long i) - { - DoNothing(i / BlockSize, i % BlockSize); - } - - private void CalculateWithMathDivRem(long i) - { - DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); - } - - private void CalculateWithAddWithFor(long i) - { - int result = 0; - int remainder = 0; - int blockSize = BlockSize; - for (long iteration = 0; iteration < i; iteration++) - { - if (remainder > blockSize - 1) - { - remainder = 0; - result++; - } - - remainder++; - } - - DoNothing(result, remainder); - } - - private void CalculateWithAddWithForOptimized(long i) - { - long total = 0; - int result = 0; - int blockSize = BlockSize; - while (total + blockSize <= i) - { - total += blockSize; - result++; - } - - DoNothing(result, i - total); - } - - private void CalculateWithXDivYMulX(long i) - { - DoNothing(i / BlockSize, i - (i / BlockSize * BlockSize)); - } - - private void CalculateWithXDivYMulXWithLocalVar(long i) - { - int blockSize = BlockSize; - int result = (int)(i / blockSize); - DoNothing(result, i - (result * blockSize)); - } - - private void CalculateWithSubtractWithWhile(long i) - { - int result = 0; - long remainder = i; - int blockSize = BlockSize; - while (remainder >= blockSize) - { - remainder -= blockSize; - result++; - } - - DoNothing(result, remainder); - } - - private void CalculateWithSubtractWithWhileWithSse2(long i) - { - var state = Vector128.Create(i, 0); - int blockSize = BlockSize; - var inc = _increment; - while (state.GetElement(0) >= blockSize) - { - state = Sse2.Add(state, inc); - } - - DoNothing(state.GetElement(1), state.GetElement(0)); - } - - private void CalculateWithMixedApproachWithSubtractWithWhile(long i) - { - long remainder; - if (i >= _cutoff) - { - DoNothing(Math.DivRem(i, BlockSize, out remainder), remainder); - } - else - { - int result = 0; - int blockSize = BlockSize; - remainder = i; - while (remainder >= blockSize) - { - remainder -= blockSize; - result++; - } - - DoNothing(result, remainder); - } - } - - private void CalculateWithMixedApproachWithSubtractWithWhileAsVector(long i) - { - if (i >= _cutoff) - { - DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); - } - else - { - var state = new Vector(new[] { 0L, i, 0, 0 }); - var increment = new Vector(new[] { 1L, -BlockSize, 0, 0 }); - int blockSize = BlockSize; - while (state[1] >= blockSize) - { - state += increment; - } - - DoNothing(state[0], state[1]); - } - } - - private void CalculateWithMixedApproachWithSubtractWithWhileWithSse2(long i) - { - if (i >= _cutoff) - { - DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); - } - else - { - var increment = _increment; - var state = Vector128.Create(i, 0); - int blockSize = BlockSize; - while (state.GetElement(0) >= blockSize) - { - state = Sse2.Add(state, increment); - } - - DoNothing(state.GetElement(1), state.GetElement(0)); - } - } - - private void CalculateWithMixedApproachWithSubtractWithStackalloc(long i) - { - if (i >= _cutoff) - { - DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); - } - else - { - Span state = stackalloc long[2] { i, 0 };// Vector128.Create(BlockSize, 0); - int blockSize = BlockSize; - while (state[0] >= blockSize) - { - state[0] -= blockSize; - state[1]++; - } - - DoNothing(state[1], state[0]); - } - } - - private void CalculateWithMixedApproachWithForLoopOptimized(long i) - { - long total; - if (i >= _cutoff) - { - DoNothing(Math.DivRem(i, BlockSize, out total), total); - } - else - { - total = 0; - int result = 0; - int blockSize = BlockSize; - while (total + blockSize <= i) - { - total += blockSize; - result++; - } - - DoNothing(result, i - total); - } - } - - [Benchmark(Baseline = true)] - public void DividerAndModulusWithOperator() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateDividerAndModulusWithOperator(i); - } - } - - [Benchmark] - public void MathDivRem() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithMathDivRem(i); - } - } - - [Benchmark] - public void AddWithFor() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithAddWithFor(i); - } - } - - [Benchmark(Baseline = true)] - public void AddWithForOptimized() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithAddWithForOptimized(i); - } - } - - [Benchmark] - public void XDivYMulX() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithXDivYMulX(i); - } - } - - [Benchmark] - public void XDivYMulXWithLocalVar() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithXDivYMulXWithLocalVar(i); - } - } - - [Benchmark] - public void SubtractWithWhile() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithSubtractWithWhile(i); - } - } - - [Benchmark] - public void SubtractWithWhileWithSse2() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithSubtractWithWhileWithSse2(i); - } - } - - [Benchmark(Baseline = false)] - public void MixedApproachWithSubtractWithWhile() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithMixedApproachWithSubtractWithWhile(i); - } - } - - [Benchmark(Baseline = false)] - public void MixedApproachWithSubtractWithWhileAsVector() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithMixedApproachWithSubtractWithWhileAsVector(i); - } - } - - [Benchmark(Baseline = false)] - public void MixedApproachWithSubtractWithWhileWithSse2() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithMixedApproachWithSubtractWithWhileWithSse2(i); - } - } - - [Benchmark(Baseline = false)] - public void MixedApproachWithSubtractWithStackalloc() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithMixedApproachWithSubtractWithStackalloc(i); - } - } - - [Benchmark(Baseline = false)] - public void MixedApproachWithForLoopOptimized() - { - long testNumber = TestNumber; - for (long i = testNumber; i >= _lastCaseIndex; i--) - { - CalculateWithMixedApproachWithForLoopOptimized(i); - } - } - } +using BenchmarkDotNet.Attributes; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.X86; + +#pragma warning disable xUnit1026, RCS1163, IDE0060 + +namespace Recyclable.Collections.Benchmarks.POC +{ + [MemoryDiagnoser] + public class ModuloPocBenchmarks + { + public static void Run() + { + var benchmark = new ModuloPocBenchmarks(); + benchmark.Setup(); + benchmark.AddWithFor(); + benchmark.AddWithForOptimized(); + benchmark.DividerAndModulusWithOperator(); + benchmark.MathDivRem(); + benchmark.MixedApproachWithForLoopOptimized(); + benchmark.MixedApproachWithSubtractWithStackalloc(); + benchmark.MixedApproachWithSubtractWithWhile(); + benchmark.MixedApproachWithSubtractWithWhileAsVector(); + benchmark.MixedApproachWithSubtractWithWhileWithSse2(); + benchmark.SubtractWithWhile(); + benchmark.SubtractWithWhileWithSse2(); + benchmark.XDivYMulX(); + benchmark.XDivYMulXWithLocalVar(); + } + + private long _cutoff; + private Vector128 _increment; + private long _lastCaseIndex; + + [GlobalSetup] + public void Setup() + { + _cutoff = checked((long)BlockSize << 4); + _increment = Vector128.Create(-BlockSize, 1L); + _lastCaseIndex = 0; + } + + private static void DoNothing(T result, T remainder, [CallerMemberName] string? callerName = null) + { + //Console.WriteLine($"{callerName}: result = {result}, remainder = {remainder}"); + } + + //[Params(123, 10, 2, int.MaxValue, int.MaxValue / 2, int.MaxValue / 3, int.MaxValue / 4, int.MaxValue / 6, int.MaxValue / 10, int.MaxValue / 15, int.MaxValue / 20)] + [Params(int.MaxValue, int.MaxValue / 2, int.MaxValue / 3, int.MaxValue / 4, int.MaxValue / 6, int.MaxValue / 8, int.MaxValue / 10, int.MaxValue / 100)] + //[Params(int.MaxValue / 10, int.MaxValue / 20, int.MaxValue / 100)] + public int BlockSize { get; set; } = int.MaxValue; + + [Params(int.MaxValue, int.MaxValue / 1000, int.MaxValue / 10000)] + //[Params(int.MaxValue)] + //[Params(int.MaxValue * 100L)] + public long TestNumber { get; set; } = int.MaxValue; + + private void CalculateDividerAndModulusWithOperator(long i) + { + DoNothing(i / BlockSize, i % BlockSize); + } + + private void CalculateWithMathDivRem(long i) + { + DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); + } + + private void CalculateWithAddWithFor(long i) + { + int result = 0; + int remainder = 0; + int blockSize = BlockSize; + for (long iteration = 0; iteration < i; iteration++) + { + if (remainder > blockSize - 1) + { + remainder = 0; + result++; + } + + remainder++; + } + + DoNothing(result, remainder); + } + + private void CalculateWithAddWithForOptimized(long i) + { + long total = 0; + int result = 0; + int blockSize = BlockSize; + while (total + blockSize <= i) + { + total += blockSize; + result++; + } + + DoNothing(result, i - total); + } + + private void CalculateWithXDivYMulX(long i) + { + DoNothing(i / BlockSize, i - (i / BlockSize * BlockSize)); + } + + private void CalculateWithXDivYMulXWithLocalVar(long i) + { + int blockSize = BlockSize; + int result = (int)(i / blockSize); + DoNothing(result, i - (result * blockSize)); + } + + private void CalculateWithSubtractWithWhile(long i) + { + int result = 0; + long remainder = i; + int blockSize = BlockSize; + while (remainder >= blockSize) + { + remainder -= blockSize; + result++; + } + + DoNothing(result, remainder); + } + + private void CalculateWithSubtractWithWhileWithSse2(long i) + { + var state = Vector128.Create(i, 0); + int blockSize = BlockSize; + var inc = _increment; + while (state.GetElement(0) >= blockSize) + { + state = Sse2.Add(state, inc); + } + + DoNothing(state.GetElement(1), state.GetElement(0)); + } + + private void CalculateWithMixedApproachWithSubtractWithWhile(long i) + { + long remainder; + if (i >= _cutoff) + { + DoNothing(Math.DivRem(i, BlockSize, out remainder), remainder); + } + else + { + int result = 0; + int blockSize = BlockSize; + remainder = i; + while (remainder >= blockSize) + { + remainder -= blockSize; + result++; + } + + DoNothing(result, remainder); + } + } + + private void CalculateWithMixedApproachWithSubtractWithWhileAsVector(long i) + { + if (i >= _cutoff) + { + DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); + } + else + { + var state = new Vector(new[] { 0L, i, 0, 0 }); + var increment = new Vector(new[] { 1L, -BlockSize, 0, 0 }); + int blockSize = BlockSize; + while (state[1] >= blockSize) + { + state += increment; + } + + DoNothing(state[0], state[1]); + } + } + + private void CalculateWithMixedApproachWithSubtractWithWhileWithSse2(long i) + { + if (i >= _cutoff) + { + DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); + } + else + { + var increment = _increment; + var state = Vector128.Create(i, 0); + int blockSize = BlockSize; + while (state.GetElement(0) >= blockSize) + { + state = Sse2.Add(state, increment); + } + + DoNothing(state.GetElement(1), state.GetElement(0)); + } + } + + private void CalculateWithMixedApproachWithSubtractWithStackalloc(long i) + { + if (i >= _cutoff) + { + DoNothing(Math.DivRem(i, BlockSize, out long remainder), remainder); + } + else + { + Span state = stackalloc long[2] { i, 0 };// Vector128.Create(BlockSize, 0); + int blockSize = BlockSize; + while (state[0] >= blockSize) + { + state[0] -= blockSize; + state[1]++; + } + + DoNothing(state[1], state[0]); + } + } + + private void CalculateWithMixedApproachWithForLoopOptimized(long i) + { + long total; + if (i >= _cutoff) + { + DoNothing(Math.DivRem(i, BlockSize, out total), total); + } + else + { + total = 0; + int result = 0; + int blockSize = BlockSize; + while (total + blockSize <= i) + { + total += blockSize; + result++; + } + + DoNothing(result, i - total); + } + } + + [Benchmark(Baseline = true)] + public void DividerAndModulusWithOperator() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateDividerAndModulusWithOperator(i); + } + } + + [Benchmark] + public void MathDivRem() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithMathDivRem(i); + } + } + + [Benchmark] + public void AddWithFor() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithAddWithFor(i); + } + } + + [Benchmark(Baseline = true)] + public void AddWithForOptimized() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithAddWithForOptimized(i); + } + } + + [Benchmark] + public void XDivYMulX() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithXDivYMulX(i); + } + } + + [Benchmark] + public void XDivYMulXWithLocalVar() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithXDivYMulXWithLocalVar(i); + } + } + + [Benchmark] + public void SubtractWithWhile() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithSubtractWithWhile(i); + } + } + + [Benchmark] + public void SubtractWithWhileWithSse2() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithSubtractWithWhileWithSse2(i); + } + } + + [Benchmark(Baseline = false)] + public void MixedApproachWithSubtractWithWhile() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithMixedApproachWithSubtractWithWhile(i); + } + } + + [Benchmark(Baseline = false)] + public void MixedApproachWithSubtractWithWhileAsVector() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithMixedApproachWithSubtractWithWhileAsVector(i); + } + } + + [Benchmark(Baseline = false)] + public void MixedApproachWithSubtractWithWhileWithSse2() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithMixedApproachWithSubtractWithWhileWithSse2(i); + } + } + + [Benchmark(Baseline = false)] + public void MixedApproachWithSubtractWithStackalloc() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithMixedApproachWithSubtractWithStackalloc(i); + } + } + + [Benchmark(Baseline = false)] + public void MixedApproachWithForLoopOptimized() + { + long testNumber = TestNumber; + for (long i = testNumber; i >= _lastCaseIndex; i--) + { + CalculateWithMixedApproachWithForLoopOptimized(i); + } + } + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs index 368112a..93f97c6 100644 --- a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs +++ b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs @@ -1,142 +1,142 @@ -using BenchmarkDotNet.Attributes; -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public abstract class PocBenchmarkBase - { - public virtual TBenchmarkType? DataType { get; set; } - public virtual TBenchmarkType? BaseDataType { get; set; } - - private Action? _testMethod; - protected Action TestMethod - { - get => _testMethod ?? throw new OperationCanceledException("Skip - No actual defined"); - set => _testMethod = value; - } - - private Action? _baselineMethod; - protected Action BaselineMethod - { - get => _baselineMethod ?? throw new OperationCanceledException("Skip - No baseline defined"); - set => _baselineMethod = value; - } - - [Benchmark(Baseline = true)] - public void Baseline() => BaselineMethod.Invoke(); - - [Benchmark] - public void Actual() => TestMethod.Invoke(); - - // 0 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524_288 - // 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 - // 1073741824 2147483648 - - // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 1_000_000)] - // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 1_000_000)] - // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 100_000_000)] - // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 850_000 - 1, 1_000_000, RecyclableDefaults.MaxPooledBlockSize)] - // [Params(1_000_000, 10_000_000, 100_000_000, 1_000_000_000)] - // [Params(1, 10, 64, 128, 192, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144)] - // [Params(524_288, 786_432, 1_048_576)] - // [Params(262_144, 393_216, 524_288)] - // [Params(850_000_000)] - // [Params(100_000_000)] - // [Params(RecyclableDefaults.MinItemsCountForParallelization)] - // [Params(127)] - // [Params(16)] - // [Params(10, 15, 128)] - // [Params(1)] - // [Params(RecyclableDefaults.MaxPooledBlockSize)] - // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 10_000_000, 33_554_432, 50_000_000, 100_000_000)] - // *** [Params(RecyclableDefaults.MinPooledArrayLength - 3, RecyclableDefaults.MinPooledArrayLength - 2, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinPooledArrayLength + 1, RecyclableDefaults.MinPooledArrayLength + 2, RecyclableDefaults.MinPooledArrayLength + 3)] - [Params(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 70, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)] - // *** [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 70, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)] - // [Params(256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)] - // [Params(RecyclableDefaults.MinItemsCountForParallelization, 1_048_576, 2_097_152, 4_194_304, 8_388_608, 16_777_216, 33_554_432, RecyclableDefaults.MaxPooledBlockSize)] - // *** [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 64, 70, 80, 90, 100, 127, 128)] - // [Params(1, 10, 1024, 10240, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinItemsCountForParallelization)] - // [Params(RecyclableDefaults.MinItemsCountForParallelization * 3)] - // [Params(1_048_576)] - public virtual int TestObjectCount { get; set; } = 0; //8_192;//131_072; //1; //33_554_432; //524_288; //131_072; - public virtual int TestObjectCountForSlowMethods { get; private set; } - - // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200)] - // [Params(10, 20, 50, 100)] - // [Params(1, 10)] - public int Divider = 10; - //public int BlockSize = 1_048_576;//int.MaxValue - 1; - public int BlockSize { get; private set; } - - public byte BlockSizePow2BitShift => checked((byte)(31 - BitOperations.LeadingZeroCount((uint)BlockSize))); - - [MethodImpl(MethodImplOptions.NoInlining)] - protected static void DoNothing(in T item) - { - _ = item; - } - - protected static Exception CreateUnknownBenchmarkTypeException(T benchmarkType) - { - return new InvalidOperationException($"******* UNKNOWN BENCHMARK TYPE {{{benchmarkType}}} *******"); - } - - protected static Exception CreateMethodNotFoundException(in string methodName, in string? className) - { - return new MethodAccessException($"******* METHOD {{{methodName}}} NOT FOUND IN CLASS {{{className}}} *******"); - } - - protected virtual void PrepareData(T benchmarkType) { } - protected virtual Action? GetTestMethod(TBenchmarkType? benchmarkType) => null; - - [GlobalCleanup] - public virtual void Cleanup() - { - _baselineMethod = null; - _testMethod = null; - GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); - } - - [GlobalSetup] - public virtual void Setup() - { - Console.WriteLine($"******* SETTING UP TEST CASE FOR BENCHMARK {{{DataType}}} *******"); - - TestObjectCountForSlowMethods = (TestObjectCount / 2) + 1; - - BlockSize = TestObjectCount switch - { - 0 => 1, - > 0 and <= 10_240 => TestObjectCount, - _ => TestObjectCount / Divider > 0 ? TestObjectCount / Divider : TestObjectCount - }; - - if (BlockSize > 0) - { - BlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)BlockSize)); - } - - Console.WriteLine($"******* BaseDataType = {BaseDataType}; default = {default(TBenchmarkType)} *******"); - - if (!EqualityComparer.Default.Equals(BaseDataType, default)) - { - Console.WriteLine("******* SETTING UP BASELINE DATA *******"); - PrepareData(BaseDataType); - _baselineMethod = GetTestMethod(BaseDataType); - } - - //~ We don't want to prepare data if baseline data is the same is benchmark data. - //~ One would override another - waste of time & resources. - if (!EqualityComparer.Default.Equals(BaseDataType, DataType)) - { - Console.WriteLine("******* SETTING UP TEST CASE DATA *******"); - //~ If BaseDataType == null, then we'll come here only if DataType != null. - PrepareData(DataType!); - _testMethod = GetTestMethod(DataType); - } - - Console.WriteLine("******* DATA PREPARED *******"); - } - } -} +using BenchmarkDotNet.Attributes; +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public abstract class PocBenchmarkBase + { + public virtual TBenchmarkType? DataType { get; set; } + public virtual TBenchmarkType? BaseDataType { get; set; } + + private Action? _testMethod; + protected Action TestMethod + { + get => _testMethod ?? throw new OperationCanceledException("Skip - No actual defined"); + set => _testMethod = value; + } + + private Action? _baselineMethod; + protected Action BaselineMethod + { + get => _baselineMethod ?? throw new OperationCanceledException("Skip - No baseline defined"); + set => _baselineMethod = value; + } + + [Benchmark(Baseline = true)] + public void Baseline() => BaselineMethod.Invoke(); + + [Benchmark] + public void Actual() => TestMethod.Invoke(); + + // 0 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524_288 + // 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 + // 1073741824 2147483648 + + // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 1_000_000)] + // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 1_000_000)] + // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 100_000_000)] + // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 850_000 - 1, 1_000_000, RecyclableDefaults.MaxPooledBlockSize)] + // [Params(1_000_000, 10_000_000, 100_000_000, 1_000_000_000)] + // [Params(1, 10, 64, 128, 192, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144)] + // [Params(524_288, 786_432, 1_048_576)] + // [Params(262_144, 393_216, 524_288)] + // [Params(850_000_000)] + // [Params(100_000_000)] + // [Params(RecyclableDefaults.MinItemsCountForParallelization)] + // [Params(127)] + // [Params(16)] + // [Params(10, 15, 128)] + // [Params(1)] + // [Params(RecyclableDefaults.MaxPooledBlockSize)] + // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 10_000_000, 33_554_432, 50_000_000, 100_000_000)] + // *** [Params(RecyclableDefaults.MinPooledArrayLength - 3, RecyclableDefaults.MinPooledArrayLength - 2, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinPooledArrayLength + 1, RecyclableDefaults.MinPooledArrayLength + 2, RecyclableDefaults.MinPooledArrayLength + 3)] + [Params(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 70, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)] + // *** [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 70, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)] + // [Params(256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)] + // [Params(RecyclableDefaults.MinItemsCountForParallelization, 1_048_576, 2_097_152, 4_194_304, 8_388_608, 16_777_216, 33_554_432, RecyclableDefaults.MaxPooledBlockSize)] + // *** [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 64, 70, 80, 90, 100, 127, 128)] + // [Params(1, 10, 1024, 10240, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinItemsCountForParallelization)] + // [Params(RecyclableDefaults.MinItemsCountForParallelization * 3)] + // [Params(1_048_576)] + public virtual int TestObjectCount { get; set; } = 0; //8_192;//131_072; //1; //33_554_432; //524_288; //131_072; + public virtual int TestObjectCountForSlowMethods { get; private set; } + + // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200)] + // [Params(10, 20, 50, 100)] + // [Params(1, 10)] + public int Divider = 10; + //public int BlockSize = 1_048_576;//int.MaxValue - 1; + public int BlockSize { get; private set; } + + public byte BlockSizePow2BitShift => checked((byte)(31 - BitOperations.LeadingZeroCount((uint)BlockSize))); + + [MethodImpl(MethodImplOptions.NoInlining)] + protected static void DoNothing(in T item) + { + _ = item; + } + + protected static Exception CreateUnknownBenchmarkTypeException(T benchmarkType) + { + return new InvalidOperationException($"******* UNKNOWN BENCHMARK TYPE {{{benchmarkType}}} *******"); + } + + protected static Exception CreateMethodNotFoundException(in string methodName, in string? className) + { + return new MethodAccessException($"******* METHOD {{{methodName}}} NOT FOUND IN CLASS {{{className}}} *******"); + } + + protected virtual void PrepareData(T benchmarkType) { } + protected virtual Action? GetTestMethod(TBenchmarkType? benchmarkType) => null; + + [GlobalCleanup] + public virtual void Cleanup() + { + _baselineMethod = null; + _testMethod = null; + GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); + } + + [GlobalSetup] + public virtual void Setup() + { + Console.WriteLine($"******* SETTING UP TEST CASE FOR BENCHMARK {{{DataType}}} *******"); + + TestObjectCountForSlowMethods = (TestObjectCount / 2) + 1; + + BlockSize = TestObjectCount switch + { + 0 => 1, + > 0 and <= 10_240 => TestObjectCount, + _ => TestObjectCount / Divider > 0 ? TestObjectCount / Divider : TestObjectCount + }; + + if (BlockSize > 0) + { + BlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)BlockSize)); + } + + Console.WriteLine($"******* BaseDataType = {BaseDataType}; default = {default(TBenchmarkType)} *******"); + + if (!EqualityComparer.Default.Equals(BaseDataType, default)) + { + Console.WriteLine("******* SETTING UP BASELINE DATA *******"); + PrepareData(BaseDataType); + _baselineMethod = GetTestMethod(BaseDataType); + } + + //~ We don't want to prepare data if baseline data is the same is benchmark data. + //~ One would override another - waste of time & resources. + if (!EqualityComparer.Default.Equals(BaseDataType, DataType)) + { + Console.WriteLine("******* SETTING UP TEST CASE DATA *******"); + //~ If BaseDataType == null, then we'll come here only if DataType != null. + PrepareData(DataType!); + _testMethod = GetTestMethod(DataType); + } + + Console.WriteLine("******* DATA PREPARED *******"); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPoc.Benchmarks.cs index b9dfec1..5e59760 100644 --- a/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPoc.Benchmarks.cs @@ -1,47 +1,47 @@ -using System.Reflection; -using BenchmarkDotNet.Attributes; -using Collections.Pooled; -using Recyclable.Collections.Benchmarks.Core; - -namespace Recyclable.Collections.Benchmarks.POC -{ - [MemoryDiagnoser] - public partial class RecyclableLongListPocBenchmarks : PocBenchmarkBase - { - private long[]? _testArray; - public long[] TestObjects => _testArray ?? throw new NullReferenceException("Something is wrong and test objects are null"); - - public RecyclableLongList TestObjectsAsRecyclableLongList => _testRecyclableLongList ?? throw new NullReferenceException($"Something is wrong and {nameof(RecyclableLongList)} is null"); - private RecyclableLongList? _testRecyclableLongList; - private PooledList? _testPooledList; - internal PooledList TestPooledList => _testPooledList ?? throw new NullReferenceException($"Something is wrong and {nameof(PooledList)} is null"); - - private static readonly MethodInfo _ensureCapacityNewFunc; - - static RecyclableLongListPocBenchmarks() - { - _ensureCapacityNewFunc = typeof(RecyclableLongList).GetMethod("EnsureCapacity", BindingFlags.Static | BindingFlags.NonPublic) - ?? throw new NullReferenceException($"Method EnsureCapacity not found in class {nameof(RecyclableLongList)}"); - - } - - public override void Setup() - { - Console.WriteLine("******* SETTING UP EXPECTED RESULTS DATA *******"); - _testArray = DataGenerator.EnumerateTestObjects(TestObjectCount); - - base.Setup(); - } - - public override void Cleanup() - { - _testArray = null; - _testRecyclableLongList?.Dispose(); - _testRecyclableLongList = null; - _testPooledList?.Dispose(); - _testPooledList = null; - - base.Cleanup(); - } - } -} +using System.Reflection; +using BenchmarkDotNet.Attributes; +using Collections.Pooled; +using Recyclable.Collections.Benchmarks.Core; + +namespace Recyclable.Collections.Benchmarks.POC +{ + [MemoryDiagnoser] + public partial class RecyclableLongListPocBenchmarks : PocBenchmarkBase + { + private long[]? _testArray; + public long[] TestObjects => _testArray ?? throw new NullReferenceException("Something is wrong and test objects are null"); + + public RecyclableLongList TestObjectsAsRecyclableLongList => _testRecyclableLongList ?? throw new NullReferenceException($"Something is wrong and {nameof(RecyclableLongList)} is null"); + private RecyclableLongList? _testRecyclableLongList; + private PooledList? _testPooledList; + internal PooledList TestPooledList => _testPooledList ?? throw new NullReferenceException($"Something is wrong and {nameof(PooledList)} is null"); + + private static readonly MethodInfo _ensureCapacityNewFunc; + + static RecyclableLongListPocBenchmarks() + { + _ensureCapacityNewFunc = typeof(RecyclableLongList).GetMethod("EnsureCapacity", BindingFlags.Static | BindingFlags.NonPublic) + ?? throw new NullReferenceException($"Method EnsureCapacity not found in class {nameof(RecyclableLongList)}"); + + } + + public override void Setup() + { + Console.WriteLine("******* SETTING UP EXPECTED RESULTS DATA *******"); + _testArray = DataGenerator.EnumerateTestObjects(TestObjectCount); + + base.Setup(); + } + + public override void Cleanup() + { + _testArray = null; + _testRecyclableLongList?.Dispose(); + _testRecyclableLongList = null; + _testPooledList?.Dispose(); + _testPooledList = null; + + base.Cleanup(); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPos.Benchmarks.IndexOf.txt b/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPos.Benchmarks.IndexOf.txt index d4413b6..6821f75 100644 --- a/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPos.Benchmarks.IndexOf.txt +++ b/Recyclable.Collections.Benchmarks/POC/RecyclableLongListPos.Benchmarks.IndexOf.txt @@ -1,26 +1,26 @@ -BenchmarkDotNet=v0.13.3, OS=ubuntu 20.04 -Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 4 logical and 2 physical cores -.NET SDK=7.0.203 - [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - - -| Method | Mean | Error | StdDev | Ratio | RatioSD | -|------------------------- |--------:|---------:|---------:|------:|--------:| -| RecyclableLongList_IndexOfV1 | 2.274 s | 0.0447 s | 0.0894 s | 1.00 | 0.04 | -| RecyclableLongList_IndexOfV2 | 2.302 s | 0.0456 s | 0.0750 s | 1.00 | 0.00 | -| RecyclableLongList_IndexOf | 2.234 s | 0.0446 s | 0.0681 s | 0.97 | 0.05 | - -// * Hints * -Outliers - RecyclableLongListPocBenchmarks.RecyclableLongList_IndexOfV2: Default -> 2 outliers were removed (2.54 s, 2.56 s) - RecyclableLongListPocBenchmarks.RecyclableLongList_IndexOf: Default -> 1 outlier was detected (2.06 s) - -// * Legends * - Mean : Arithmetic mean of all measurements - Error : Half of 99.9% confidence interval - StdDev : Standard deviation of all measurements - Ratio : Mean of the ratio distribution ([Current]/[Baseline]) - RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) - 1 s : 1 Second (1 sec) - +BenchmarkDotNet=v0.13.3, OS=ubuntu 20.04 +Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 4 logical and 2 physical cores +.NET SDK=7.0.203 + [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + + +| Method | Mean | Error | StdDev | Ratio | RatioSD | +|------------------------- |--------:|---------:|---------:|------:|--------:| +| RecyclableLongList_IndexOfV1 | 2.274 s | 0.0447 s | 0.0894 s | 1.00 | 0.04 | +| RecyclableLongList_IndexOfV2 | 2.302 s | 0.0456 s | 0.0750 s | 1.00 | 0.00 | +| RecyclableLongList_IndexOf | 2.234 s | 0.0446 s | 0.0681 s | 0.97 | 0.05 | + +// * Hints * +Outliers + RecyclableLongListPocBenchmarks.RecyclableLongList_IndexOfV2: Default -> 2 outliers were removed (2.54 s, 2.56 s) + RecyclableLongListPocBenchmarks.RecyclableLongList_IndexOf: Default -> 1 outlier was detected (2.06 s) + +// * Legends * + Mean : Arithmetic mean of all measurements + Error : Half of 99.9% confidence interval + StdDev : Standard deviation of all measurements + Ratio : Mean of the ratio distribution ([Current]/[Baseline]) + RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) + 1 s : 1 Second (1 sec) + diff --git a/Recyclable.Collections.Benchmarks/POC/RefVsInstanceMemberPoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/RefVsInstanceMemberPoc.Benchmarks.cs index 4219f49..2ec0d43 100644 --- a/Recyclable.Collections.Benchmarks/POC/RefVsInstanceMemberPoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/RefVsInstanceMemberPoc.Benchmarks.cs @@ -1,364 +1,364 @@ -using BenchmarkDotNet.Attributes; - -#pragma warning disable RCS1085 - -namespace Recyclable.Collections.Benchmarks.POC -{ - public class RefVsInstanceMemberPocBenchmarks - { - public static void Run() - { - var benchmark = new RefVsInstanceMemberPocBenchmarks(); - benchmark.ArrayInstanceMember2(); - benchmark.ArrayInstanceMember3(); - benchmark.ArrayInstanceMember4(); - benchmark.ArrayInstanceMember5(); - benchmark.ArrayInstanceMember6(); - benchmark.ArrayInstanceMemberLocalVar5(); - benchmark.ArrayInstanceMemberLocalVar6(); - benchmark.IntInstanceMember2(); - benchmark.IntInstanceMember3(); - benchmark.IntInstanceMember4(); - benchmark.IntInstanceMember5(); - benchmark.RefToArray2(); - benchmark.RefToArray3(); - benchmark.RefToArray4(); - benchmark.RefToArray5(); - benchmark.RefToArray6(); - benchmark.RefToInt2(); - benchmark.RefToInt3(); - } - - private readonly TestCase _testCase = new(); - private static void DoNothing(int count) - { - _ = count; - } - - private class TestCase - { - private int[] _items = new int[123]; - private int _count = 123; - private static int Add(int count) - { - return count; - } - - public int Count - { - get => _count; - set => _count = value; - } - - public ref int GetCountAsRefCount2() - { - ref int count = ref _count; - count = 234; - return ref count; - } - - public ref int GetCountAsRefCount3() - { - ref int count = ref _count; - count = 234; - _ = TestCase.Add(count); - return ref count; - } - - public ref int GetCountAsRefCount4() - { - ref int count = ref _count; - count = 234; - _ = TestCase.Add(count); - _ = TestCase.Add(count); - return ref count; - } - - public ref int GetCountAsRefCount5() - { - ref int count = ref _count; - count = 234; - _ = TestCase.Add(count); - _ = TestCase.Add(count); - _ = TestCase.Add(count); - return ref count; - } - - public int GetCountAsInstanceMember2() - { - _count = 234; - return _count; - } - - public int GetCountAsInstanceMember3() - { - _count = 234; - _ = TestCase.Add(_count); - return _count; - } - - public int GetCountAsInstanceMember4() - { - _count = 234; - _ = TestCase.Add(_count); - _ = TestCase.Add(_count); - return _count; - } - - public int GetCountAsInstanceMember5() - { - _count = 234; - _ = TestCase.Add(_count); - _ = TestCase.Add(_count); - _ = TestCase.Add(_count); - return _count; - } - - public int GetLengthAsArray2() - { - _ = TestCase.Add(_items.Length); - return _items.Length; - } - - public int GetLengthAsArray3() - { - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - return _items.Length; - } - - public int GetLengthAsArray4() - { - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - return _items.Length; - } - - public int GetLengthAsArray5() - { - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - return _items.Length; - } - - public int GetLengthAsArray6() - { - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - _ = TestCase.Add(_items.Length); - return _items.Length; - } - - public int GetLengthAsArrayLocalVar5() - { - var items = _items; - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - return items.Length; - } - - public int GetLengthAsArrayLocalVar6() - { - var items = _items; - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - return items.Length; - } - - public int GetLengthAsRefArray2() - { - ref int[] items = ref _items; - _ = TestCase.Add(items.Length); - return items.Length; - } - - public int GetLengthAsRefArray3() - { - ref int[] items = ref _items; - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - return items.Length; - } - - public int GetLengthAsRefArray4() - { - ref int[] items = ref _items; - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - return items.Length; - } - - public int GetLengthAsRefArray5() - { - ref int[] items = ref _items; - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - return items.Length; - } - - public int GetLengthAsRefArray6() - { - ref int[] items = ref _items; - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - _ = TestCase.Add(items.Length); - return items.Length; - } - } - - [Benchmark] - public void RefToInt2() - { - var count = _testCase.GetCountAsRefCount2(); - DoNothing(count); - } - - [Benchmark] - public void RefToInt3() - { - var count = _testCase.GetCountAsRefCount3(); - DoNothing(count); - } - - [Benchmark] - public void RefToInt4() - { - var count = _testCase.GetCountAsRefCount4(); - DoNothing(count); - } - - [Benchmark] - public void RefToInt5() - { - var count = _testCase.GetCountAsRefCount5(); - DoNothing(count); - } - - [Benchmark(Baseline = true)] - public void IntInstanceMember2() - { - var count = _testCase.GetCountAsInstanceMember2(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void IntInstanceMember3() - { - var count = _testCase.GetCountAsInstanceMember3(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void IntInstanceMember4() - { - var count = _testCase.GetCountAsInstanceMember4(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void IntInstanceMember5() - { - var count = _testCase.GetCountAsInstanceMember5(); - DoNothing(count); - } - - [Benchmark] - public void RefToArray2() - { - var count = _testCase.GetLengthAsRefArray2(); - DoNothing(count); - } - - [Benchmark] - public void RefToArray3() - { - var count = _testCase.GetLengthAsRefArray3(); - DoNothing(count); - } - - [Benchmark] - public void RefToArray4() - { - var count = _testCase.GetLengthAsRefArray4(); - DoNothing(count); - } - - [Benchmark] - public void RefToArray5() - { - var count = _testCase.GetLengthAsRefArray5(); - DoNothing(count); - } - - [Benchmark] - public void RefToArray6() - { - var count = _testCase.GetLengthAsRefArray6(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMember2() - { - var count = _testCase.GetLengthAsArray2(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMember3() - { - var count = _testCase.GetLengthAsArray3(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMember4() - { - var count = _testCase.GetLengthAsArray4(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMember5() - { - var count = _testCase.GetLengthAsArray5(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMember6() - { - var count = _testCase.GetLengthAsArray6(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMemberLocalVar5() - { - var count = _testCase.GetLengthAsArrayLocalVar5(); - DoNothing(count); - } - - [Benchmark(Baseline = false)] - public void ArrayInstanceMemberLocalVar6() - { - var count = _testCase.GetLengthAsArrayLocalVar6(); - DoNothing(count); - } - } -} +using BenchmarkDotNet.Attributes; + +#pragma warning disable RCS1085 + +namespace Recyclable.Collections.Benchmarks.POC +{ + public class RefVsInstanceMemberPocBenchmarks + { + public static void Run() + { + var benchmark = new RefVsInstanceMemberPocBenchmarks(); + benchmark.ArrayInstanceMember2(); + benchmark.ArrayInstanceMember3(); + benchmark.ArrayInstanceMember4(); + benchmark.ArrayInstanceMember5(); + benchmark.ArrayInstanceMember6(); + benchmark.ArrayInstanceMemberLocalVar5(); + benchmark.ArrayInstanceMemberLocalVar6(); + benchmark.IntInstanceMember2(); + benchmark.IntInstanceMember3(); + benchmark.IntInstanceMember4(); + benchmark.IntInstanceMember5(); + benchmark.RefToArray2(); + benchmark.RefToArray3(); + benchmark.RefToArray4(); + benchmark.RefToArray5(); + benchmark.RefToArray6(); + benchmark.RefToInt2(); + benchmark.RefToInt3(); + } + + private readonly TestCase _testCase = new(); + private static void DoNothing(int count) + { + _ = count; + } + + private class TestCase + { + private int[] _items = new int[123]; + private int _count = 123; + private static int Add(int count) + { + return count; + } + + public int Count + { + get => _count; + set => _count = value; + } + + public ref int GetCountAsRefCount2() + { + ref int count = ref _count; + count = 234; + return ref count; + } + + public ref int GetCountAsRefCount3() + { + ref int count = ref _count; + count = 234; + _ = TestCase.Add(count); + return ref count; + } + + public ref int GetCountAsRefCount4() + { + ref int count = ref _count; + count = 234; + _ = TestCase.Add(count); + _ = TestCase.Add(count); + return ref count; + } + + public ref int GetCountAsRefCount5() + { + ref int count = ref _count; + count = 234; + _ = TestCase.Add(count); + _ = TestCase.Add(count); + _ = TestCase.Add(count); + return ref count; + } + + public int GetCountAsInstanceMember2() + { + _count = 234; + return _count; + } + + public int GetCountAsInstanceMember3() + { + _count = 234; + _ = TestCase.Add(_count); + return _count; + } + + public int GetCountAsInstanceMember4() + { + _count = 234; + _ = TestCase.Add(_count); + _ = TestCase.Add(_count); + return _count; + } + + public int GetCountAsInstanceMember5() + { + _count = 234; + _ = TestCase.Add(_count); + _ = TestCase.Add(_count); + _ = TestCase.Add(_count); + return _count; + } + + public int GetLengthAsArray2() + { + _ = TestCase.Add(_items.Length); + return _items.Length; + } + + public int GetLengthAsArray3() + { + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + return _items.Length; + } + + public int GetLengthAsArray4() + { + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + return _items.Length; + } + + public int GetLengthAsArray5() + { + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + return _items.Length; + } + + public int GetLengthAsArray6() + { + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + _ = TestCase.Add(_items.Length); + return _items.Length; + } + + public int GetLengthAsArrayLocalVar5() + { + var items = _items; + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + return items.Length; + } + + public int GetLengthAsArrayLocalVar6() + { + var items = _items; + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + return items.Length; + } + + public int GetLengthAsRefArray2() + { + ref int[] items = ref _items; + _ = TestCase.Add(items.Length); + return items.Length; + } + + public int GetLengthAsRefArray3() + { + ref int[] items = ref _items; + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + return items.Length; + } + + public int GetLengthAsRefArray4() + { + ref int[] items = ref _items; + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + return items.Length; + } + + public int GetLengthAsRefArray5() + { + ref int[] items = ref _items; + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + return items.Length; + } + + public int GetLengthAsRefArray6() + { + ref int[] items = ref _items; + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + _ = TestCase.Add(items.Length); + return items.Length; + } + } + + [Benchmark] + public void RefToInt2() + { + var count = _testCase.GetCountAsRefCount2(); + DoNothing(count); + } + + [Benchmark] + public void RefToInt3() + { + var count = _testCase.GetCountAsRefCount3(); + DoNothing(count); + } + + [Benchmark] + public void RefToInt4() + { + var count = _testCase.GetCountAsRefCount4(); + DoNothing(count); + } + + [Benchmark] + public void RefToInt5() + { + var count = _testCase.GetCountAsRefCount5(); + DoNothing(count); + } + + [Benchmark(Baseline = true)] + public void IntInstanceMember2() + { + var count = _testCase.GetCountAsInstanceMember2(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void IntInstanceMember3() + { + var count = _testCase.GetCountAsInstanceMember3(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void IntInstanceMember4() + { + var count = _testCase.GetCountAsInstanceMember4(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void IntInstanceMember5() + { + var count = _testCase.GetCountAsInstanceMember5(); + DoNothing(count); + } + + [Benchmark] + public void RefToArray2() + { + var count = _testCase.GetLengthAsRefArray2(); + DoNothing(count); + } + + [Benchmark] + public void RefToArray3() + { + var count = _testCase.GetLengthAsRefArray3(); + DoNothing(count); + } + + [Benchmark] + public void RefToArray4() + { + var count = _testCase.GetLengthAsRefArray4(); + DoNothing(count); + } + + [Benchmark] + public void RefToArray5() + { + var count = _testCase.GetLengthAsRefArray5(); + DoNothing(count); + } + + [Benchmark] + public void RefToArray6() + { + var count = _testCase.GetLengthAsRefArray6(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMember2() + { + var count = _testCase.GetLengthAsArray2(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMember3() + { + var count = _testCase.GetLengthAsArray3(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMember4() + { + var count = _testCase.GetLengthAsArray4(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMember5() + { + var count = _testCase.GetLengthAsArray5(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMember6() + { + var count = _testCase.GetLengthAsArray6(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMemberLocalVar5() + { + var count = _testCase.GetLengthAsArrayLocalVar5(); + DoNothing(count); + } + + [Benchmark(Baseline = false)] + public void ArrayInstanceMemberLocalVar6() + { + var count = _testCase.GetLengthAsArrayLocalVar6(); + DoNothing(count); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/RoundBenchmarks.cs b/Recyclable.Collections.Benchmarks/POC/RoundBenchmarks.cs index 1aa35b4..5ee502a 100644 --- a/Recyclable.Collections.Benchmarks/POC/RoundBenchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/RoundBenchmarks.cs @@ -1,45 +1,45 @@ -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public enum RoundBenchmarkType - { - MathFloor, - MathRound, - WithTypecasting, - } - - public class RoundBenchmarks : PocBenchmarkBase - { - [Params(RoundBenchmarkType.MathFloor)] - public override RoundBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } - - [Params(RoundBenchmarkType.MathRound, RoundBenchmarkType.WithTypecasting)] - public override RoundBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } - - private const double OptimalParallelSearchStep = 0.329; - - public void RoundWithMathFloor() - { - DoNothing((long)Math.Floor(TestObjectCount * OptimalParallelSearchStep)); - } - - public void RoundWithMathRound() - { - DoNothing((long)Math.Round(TestObjectCount * OptimalParallelSearchStep, 0)); - } - - public void RoundWithTypeCasting() - { - DoNothing((long)(TestObjectCount * OptimalParallelSearchStep)); - } - - protected override Action GetTestMethod(RoundBenchmarkType benchmarkType) => benchmarkType switch - { - RoundBenchmarkType.MathFloor => RoundWithMathFloor, - RoundBenchmarkType.MathRound => RoundWithMathRound, - RoundBenchmarkType.WithTypecasting => RoundWithTypeCasting, - _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), - }; - } -} +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public enum RoundBenchmarkType + { + MathFloor, + MathRound, + WithTypecasting, + } + + public class RoundBenchmarks : PocBenchmarkBase + { + [Params(RoundBenchmarkType.MathFloor)] + public override RoundBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } + + [Params(RoundBenchmarkType.MathRound, RoundBenchmarkType.WithTypecasting)] + public override RoundBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } + + private const double OptimalParallelSearchStep = 0.329; + + public void RoundWithMathFloor() + { + DoNothing((long)Math.Floor(TestObjectCount * OptimalParallelSearchStep)); + } + + public void RoundWithMathRound() + { + DoNothing((long)Math.Round(TestObjectCount * OptimalParallelSearchStep, 0)); + } + + public void RoundWithTypeCasting() + { + DoNothing((long)(TestObjectCount * OptimalParallelSearchStep)); + } + + protected override Action GetTestMethod(RoundBenchmarkType benchmarkType) => benchmarkType switch + { + RoundBenchmarkType.MathFloor => RoundWithMathFloor, + RoundBenchmarkType.MathRound => RoundWithMathRound, + RoundBenchmarkType.WithTypecasting => RoundWithTypeCasting, + _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), + }; + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/RoundUpToPowerOf2vsOthers.cs b/Recyclable.Collections.Benchmarks/POC/RoundUpToPowerOf2vsOthers.cs index 96906d9..979d584 100644 --- a/Recyclable.Collections.Benchmarks/POC/RoundUpToPowerOf2vsOthers.cs +++ b/Recyclable.Collections.Benchmarks/POC/RoundUpToPowerOf2vsOthers.cs @@ -1,147 +1,147 @@ -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks.POC -{ - static class RoundUpToPowerOf2Alternatives - { - private static readonly int[] PowersOfTwo = - { - 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, - 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, - 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824 - }; - - public static int BinarySearch(int value) - { - if (value <= 0) - { - throw new ArgumentException("Input must be a positive integer."); - } - - // Find the smallest power of 2 greater than or equal to value using a lookup table - int index = Array.BinarySearch(PowersOfTwo, value); - if (index < 0) - { - // If value is not a power of 2, use the next power of 2 from the table - index = ~index; - } - - return PowersOfTwo[index]; - } - - public static int RightBitShifting(int value) - { - // Decrease value by 1 to handle the case where the input is already a power of 2 - value--; - - value |= value >> 1; - value |= value >> 2; - value |= value >> 4; - value |= value >> 8; - value |= value >> 16; - - return value + 1; - } - - public static int LeftBitShifting(int value) - { - if (value == 0) - { - return 1; - } - - // Ensure value is a power of 2 or the next power of 2 - int result = 1; - while (result < value) - { - result = checked(result << 1); - } - - return result; - } - } - - public enum RoundUpToPowerOf2BenchmarkType - { - Undefined, - BitOperations, - RightBitShifting, - LeftBitShifting, - BinarySearch, - IsPowOf2, - IsPowOf2_GreaterThanFirst, - IsPowOf2_WithIf, - IsPowOf2_GreaterEqual, - } - - public class RoundUpToPowerOf2vsOtherBenchmarks : PocBenchmarkBase - { - // [Params(-850_000, 850_000)] - [Params(-int.MaxValue, int.MaxValue)] - public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } - - [Params(RoundUpToPowerOf2BenchmarkType.IsPowOf2)] - public override RoundUpToPowerOf2BenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } - - [Params(RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterThanFirst, RoundUpToPowerOf2BenchmarkType.IsPowOf2_WithIf, RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterEqual)] - // [Params(RoundUpToPowerOf2BenchmarkType.RightBitShifting, RoundUpToPowerOf2BenchmarkType.LeftBitShifting, RoundUpToPowerOf2BenchmarkType.BinarySearch)] - public override RoundUpToPowerOf2BenchmarkType DataType { get => base.DataType; set => base.DataType = value; } - - private void BitOperations() - { - DoNothing(System.Numerics.BitOperations.RoundUpToPowerOf2((uint)base.TestObjectCount)); - } - - private void RightBitShifting() - { - DoNothing(RoundUpToPowerOf2Alternatives.RightBitShifting(TestObjectCount)); - } - - private void LeftBitShifting() - { - DoNothing(RoundUpToPowerOf2Alternatives.LeftBitShifting(TestObjectCount)); - } - - private void BinarySearch() - { - DoNothing(RoundUpToPowerOf2Alternatives.BinarySearch(TestObjectCount)); - } - - private void IsPowOf2() - { - DoNothing((TestObjectCount & (TestObjectCount - 1)) == 0 && TestObjectCount > 0); - } - - private void IsPowOf2_GreaterThanFirst() - { - DoNothing(TestObjectCount > 0 && (TestObjectCount & (TestObjectCount - 1)) == 0); - } - - private void IsPowOf2_WithIf() - { - DoNothing(TestObjectCount > 0 ? (TestObjectCount & (TestObjectCount - 1)) == 0 : false); - } - - private void IsPowOf2_GreaterEqual() - { - DoNothing(TestObjectCount >= 0 && TestObjectCount != 0 && (TestObjectCount & (TestObjectCount - 1)) == 0); - } - - protected override Action? GetTestMethod(RoundUpToPowerOf2BenchmarkType benchmarkType) => benchmarkType switch - { - RoundUpToPowerOf2BenchmarkType.BitOperations => BitOperations, - RoundUpToPowerOf2BenchmarkType.RightBitShifting => RightBitShifting, - RoundUpToPowerOf2BenchmarkType.LeftBitShifting => LeftBitShifting, - RoundUpToPowerOf2BenchmarkType.BinarySearch => BinarySearch, - RoundUpToPowerOf2BenchmarkType.IsPowOf2 => IsPowOf2, - RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterThanFirst => IsPowOf2_GreaterThanFirst, - RoundUpToPowerOf2BenchmarkType.IsPowOf2_WithIf => IsPowOf2_WithIf, - RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterEqual => IsPowOf2_GreaterEqual, - _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), - }; - - protected override void PrepareData(T benchmarkType) - { - } - } +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks.POC +{ + static class RoundUpToPowerOf2Alternatives + { + private static readonly int[] PowersOfTwo = + { + 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, + 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, + 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824 + }; + + public static int BinarySearch(int value) + { + if (value <= 0) + { + throw new ArgumentException("Input must be a positive integer."); + } + + // Find the smallest power of 2 greater than or equal to value using a lookup table + int index = Array.BinarySearch(PowersOfTwo, value); + if (index < 0) + { + // If value is not a power of 2, use the next power of 2 from the table + index = ~index; + } + + return PowersOfTwo[index]; + } + + public static int RightBitShifting(int value) + { + // Decrease value by 1 to handle the case where the input is already a power of 2 + value--; + + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + + return value + 1; + } + + public static int LeftBitShifting(int value) + { + if (value == 0) + { + return 1; + } + + // Ensure value is a power of 2 or the next power of 2 + int result = 1; + while (result < value) + { + result = checked(result << 1); + } + + return result; + } + } + + public enum RoundUpToPowerOf2BenchmarkType + { + Undefined, + BitOperations, + RightBitShifting, + LeftBitShifting, + BinarySearch, + IsPowOf2, + IsPowOf2_GreaterThanFirst, + IsPowOf2_WithIf, + IsPowOf2_GreaterEqual, + } + + public class RoundUpToPowerOf2vsOtherBenchmarks : PocBenchmarkBase + { + // [Params(-850_000, 850_000)] + [Params(-int.MaxValue, int.MaxValue)] + public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } + + [Params(RoundUpToPowerOf2BenchmarkType.IsPowOf2)] + public override RoundUpToPowerOf2BenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } + + [Params(RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterThanFirst, RoundUpToPowerOf2BenchmarkType.IsPowOf2_WithIf, RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterEqual)] + // [Params(RoundUpToPowerOf2BenchmarkType.RightBitShifting, RoundUpToPowerOf2BenchmarkType.LeftBitShifting, RoundUpToPowerOf2BenchmarkType.BinarySearch)] + public override RoundUpToPowerOf2BenchmarkType DataType { get => base.DataType; set => base.DataType = value; } + + private void BitOperations() + { + DoNothing(System.Numerics.BitOperations.RoundUpToPowerOf2((uint)base.TestObjectCount)); + } + + private void RightBitShifting() + { + DoNothing(RoundUpToPowerOf2Alternatives.RightBitShifting(TestObjectCount)); + } + + private void LeftBitShifting() + { + DoNothing(RoundUpToPowerOf2Alternatives.LeftBitShifting(TestObjectCount)); + } + + private void BinarySearch() + { + DoNothing(RoundUpToPowerOf2Alternatives.BinarySearch(TestObjectCount)); + } + + private void IsPowOf2() + { + DoNothing((TestObjectCount & (TestObjectCount - 1)) == 0 && TestObjectCount > 0); + } + + private void IsPowOf2_GreaterThanFirst() + { + DoNothing(TestObjectCount > 0 && (TestObjectCount & (TestObjectCount - 1)) == 0); + } + + private void IsPowOf2_WithIf() + { + DoNothing(TestObjectCount > 0 ? (TestObjectCount & (TestObjectCount - 1)) == 0 : false); + } + + private void IsPowOf2_GreaterEqual() + { + DoNothing(TestObjectCount >= 0 && TestObjectCount != 0 && (TestObjectCount & (TestObjectCount - 1)) == 0); + } + + protected override Action? GetTestMethod(RoundUpToPowerOf2BenchmarkType benchmarkType) => benchmarkType switch + { + RoundUpToPowerOf2BenchmarkType.BitOperations => BitOperations, + RoundUpToPowerOf2BenchmarkType.RightBitShifting => RightBitShifting, + RoundUpToPowerOf2BenchmarkType.LeftBitShifting => LeftBitShifting, + RoundUpToPowerOf2BenchmarkType.BinarySearch => BinarySearch, + RoundUpToPowerOf2BenchmarkType.IsPowOf2 => IsPowOf2, + RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterThanFirst => IsPowOf2_GreaterThanFirst, + RoundUpToPowerOf2BenchmarkType.IsPowOf2_WithIf => IsPowOf2_WithIf, + RoundUpToPowerOf2BenchmarkType.IsPowOf2_GreaterEqual => IsPowOf2_GreaterEqual, + _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), + }; + + protected override void PrepareData(T benchmarkType) + { + } + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/POC/SpanConstructorVsTypecasting.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/SpanConstructorVsTypecasting.Benchmarks.cs index bee88e7..c06915a 100644 --- a/Recyclable.Collections.Benchmarks/POC/SpanConstructorVsTypecasting.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/SpanConstructorVsTypecasting.Benchmarks.cs @@ -1,64 +1,64 @@ -using System.Runtime.CompilerServices; -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public enum SpanConstructorVsTypecastingPocBenchmarkType - { - Unknown, - Constructor, - TypeCasting, - } - - [MemoryDiagnoser] - public class SpanConstructorVsTypecastingPocBenchmarks : PocBenchmarkBase - { - private int[]? TestData { get; set; } - - [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)] - private void DoNothing(ReadOnlySpan span) { } - - [Params(SpanConstructorVsTypecastingPocBenchmarkType.TypeCasting)] - public override SpanConstructorVsTypecastingPocBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } - - [Params(SpanConstructorVsTypecastingPocBenchmarkType.Constructor)] - public override SpanConstructorVsTypecastingPocBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } - - [Params(8)] - public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } - - public static void Run() - { - var benchmark = new SpanConstructorVsTypecastingPocBenchmarks(); - benchmark.Setup(); - benchmark.Constructor(); - benchmark.TypeCasting(); - benchmark.Cleanup(); - } - - public void Constructor() - { - ReadOnlySpan span = new(TestData); - DoNothing(span); - } - - public void TypeCasting() - { - ReadOnlySpan span = TestData; - DoNothing(span); - } - - public override void Setup() - { - TestData = new int[TestObjectCount]; - base.Setup(); - } - - protected override Action? GetTestMethod(SpanConstructorVsTypecastingPocBenchmarkType benchmarkType) => benchmarkType switch - { - SpanConstructorVsTypecastingPocBenchmarkType.Constructor => Constructor, - SpanConstructorVsTypecastingPocBenchmarkType.TypeCasting => TypeCasting, - _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), - }; - } +using System.Runtime.CompilerServices; +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public enum SpanConstructorVsTypecastingPocBenchmarkType + { + Unknown, + Constructor, + TypeCasting, + } + + [MemoryDiagnoser] + public class SpanConstructorVsTypecastingPocBenchmarks : PocBenchmarkBase + { + private int[]? TestData { get; set; } + + [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)] + private void DoNothing(ReadOnlySpan span) { } + + [Params(SpanConstructorVsTypecastingPocBenchmarkType.TypeCasting)] + public override SpanConstructorVsTypecastingPocBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } + + [Params(SpanConstructorVsTypecastingPocBenchmarkType.Constructor)] + public override SpanConstructorVsTypecastingPocBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } + + [Params(8)] + public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; } + + public static void Run() + { + var benchmark = new SpanConstructorVsTypecastingPocBenchmarks(); + benchmark.Setup(); + benchmark.Constructor(); + benchmark.TypeCasting(); + benchmark.Cleanup(); + } + + public void Constructor() + { + ReadOnlySpan span = new(TestData); + DoNothing(span); + } + + public void TypeCasting() + { + ReadOnlySpan span = TestData; + DoNothing(span); + } + + public override void Setup() + { + TestData = new int[TestObjectCount]; + base.Setup(); + } + + protected override Action? GetTestMethod(SpanConstructorVsTypecastingPocBenchmarkType benchmarkType) => benchmarkType switch + { + SpanConstructorVsTypecastingPocBenchmarkType.Constructor => Constructor, + SpanConstructorVsTypecastingPocBenchmarkType.TypeCasting => TypeCasting, + _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), + }; + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.cs b/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.cs index 3a45b2c..939d4d4 100644 --- a/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.cs @@ -1,99 +1,99 @@ -using BenchmarkDotNet.Attributes; - -namespace Recyclable.Collections.Benchmarks.POC -{ - public enum SpanVsArrayBenchmarkType - { - ArrayGetWithVar, - ArrayGetWithField, - SpanGet, - ArraySetWithVar, - ArraySetWithField, - SpanSet - } - - public class SpanVsArrayBenchmarks : RecyclableBenchmarkBase - { - // [Params(SpanVsArrayBenchmarkType.ArrayGetWithVar, SpanVsArrayBenchmarkType.SpanGet)] - // [Params(SpanVsArrayBenchmarkType.ArraySetWithVar, SpanVsArrayBenchmarkType.SpanSet)] - [Params - ( - SpanVsArrayBenchmarkType.ArrayGetWithVar, SpanVsArrayBenchmarkType.SpanGet, - SpanVsArrayBenchmarkType.ArraySetWithField, SpanVsArrayBenchmarkType.ArraySetWithVar, SpanVsArrayBenchmarkType.SpanSet - )] - public override SpanVsArrayBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } - - [Params(SpanVsArrayBenchmarkType.ArrayGetWithField)] - // [Params(SpanVsArrayBenchmarkType.ArraySetWithField)] - public override SpanVsArrayBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } - - protected override Action GetTestMethod(SpanVsArrayBenchmarkType benchmarkType) => benchmarkType switch - { - SpanVsArrayBenchmarkType.ArrayGetWithVar => ArrayGetWithVar, - SpanVsArrayBenchmarkType.ArrayGetWithField => ArrayGetWithField, - SpanVsArrayBenchmarkType.SpanGet => SpanGet, - SpanVsArrayBenchmarkType.ArraySetWithVar => ArraySetWithVar, - SpanVsArrayBenchmarkType.ArraySetWithField => ArraySetWithField, - SpanVsArrayBenchmarkType.SpanSet => SpanSet, - _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), - }; - - public void ArrayGetWithVar() - { - var data = TestObjects; - var dataCount = TestObjectCount; - for (long i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void ArrayGetWithField() - { - var dataCount = TestObjectCount; - for (long i = 0; i < dataCount; i++) - { - DoNothing(_testObjects![i]); - } - } - - public void SpanGet() - { - var dataCount = TestObjectCount; - Span data = new(_testObjects, 0, dataCount); - for (int i = 0; i < dataCount; i++) - { - DoNothing(data[i]); - } - } - - public void ArraySetWithVar() - { - var data = TestObjects; - var dataCount = TestObjectCount; - for (long i = 0; i < dataCount; i++) - { - data[i] = i; - } - } - - public void ArraySetWithField() - { - var dataCount = TestObjectCount; - for (long i = 0; i < dataCount; i++) - { - _testObjects![i] = i; - } - } - - public void SpanSet() - { - var dataCount = TestObjectCount; - Span data = new(_testObjects, 0, dataCount); - for (int i = 0; i < dataCount; i++) - { - data[i] = i; - } - } - } -} +using BenchmarkDotNet.Attributes; + +namespace Recyclable.Collections.Benchmarks.POC +{ + public enum SpanVsArrayBenchmarkType + { + ArrayGetWithVar, + ArrayGetWithField, + SpanGet, + ArraySetWithVar, + ArraySetWithField, + SpanSet + } + + public class SpanVsArrayBenchmarks : RecyclableBenchmarkBase + { + // [Params(SpanVsArrayBenchmarkType.ArrayGetWithVar, SpanVsArrayBenchmarkType.SpanGet)] + // [Params(SpanVsArrayBenchmarkType.ArraySetWithVar, SpanVsArrayBenchmarkType.SpanSet)] + [Params + ( + SpanVsArrayBenchmarkType.ArrayGetWithVar, SpanVsArrayBenchmarkType.SpanGet, + SpanVsArrayBenchmarkType.ArraySetWithField, SpanVsArrayBenchmarkType.ArraySetWithVar, SpanVsArrayBenchmarkType.SpanSet + )] + public override SpanVsArrayBenchmarkType DataType { get => base.DataType; set => base.DataType = value; } + + [Params(SpanVsArrayBenchmarkType.ArrayGetWithField)] + // [Params(SpanVsArrayBenchmarkType.ArraySetWithField)] + public override SpanVsArrayBenchmarkType BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; } + + protected override Action GetTestMethod(SpanVsArrayBenchmarkType benchmarkType) => benchmarkType switch + { + SpanVsArrayBenchmarkType.ArrayGetWithVar => ArrayGetWithVar, + SpanVsArrayBenchmarkType.ArrayGetWithField => ArrayGetWithField, + SpanVsArrayBenchmarkType.SpanGet => SpanGet, + SpanVsArrayBenchmarkType.ArraySetWithVar => ArraySetWithVar, + SpanVsArrayBenchmarkType.ArraySetWithField => ArraySetWithField, + SpanVsArrayBenchmarkType.SpanSet => SpanSet, + _ => throw CreateUnknownBenchmarkTypeException(benchmarkType), + }; + + public void ArrayGetWithVar() + { + var data = TestObjects; + var dataCount = TestObjectCount; + for (long i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void ArrayGetWithField() + { + var dataCount = TestObjectCount; + for (long i = 0; i < dataCount; i++) + { + DoNothing(_testObjects![i]); + } + } + + public void SpanGet() + { + var dataCount = TestObjectCount; + Span data = new(_testObjects, 0, dataCount); + for (int i = 0; i < dataCount; i++) + { + DoNothing(data[i]); + } + } + + public void ArraySetWithVar() + { + var data = TestObjects; + var dataCount = TestObjectCount; + for (long i = 0; i < dataCount; i++) + { + data[i] = i; + } + } + + public void ArraySetWithField() + { + var dataCount = TestObjectCount; + for (long i = 0; i < dataCount; i++) + { + _testObjects![i] = i; + } + } + + public void SpanSet() + { + var dataCount = TestObjectCount; + Span data = new(_testObjects, 0, dataCount); + for (int i = 0; i < dataCount; i++) + { + data[i] = i; + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.txt b/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.txt index 09b9d3d..d81462f 100644 --- a/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.txt +++ b/Recyclable.Collections.Benchmarks/POC/SpanVsArrayBenchmarks.txt @@ -1,1224 +1,1224 @@ -Docker Desktop - Windows Host - -| Method | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | -|------------------ |---------------- |--------------------:|------------------:|------------------:|------:|--------:| -| ArrayGetWithVar | 1 | 1.5515 ns | 0.0611 ns | 0.0542 ns | 5.78 | 0.63 | -| ArrayGetWithField | 1 | 0.2697 ns | 0.0287 ns | 0.0268 ns | 1.00 | 0.00 | -| SpanGet | 1 | 0.5019 ns | 0.0117 ns | 0.0098 ns | 1.88 | 0.20 | -| | | | | | | | -| ArrayGetWithVar | 2 | 1.7411 ns | 0.0135 ns | 0.0113 ns | 2.78 | 0.09 | -| ArrayGetWithField | 2 | 0.6258 ns | 0.0215 ns | 0.0191 ns | 1.00 | 0.00 | -| SpanGet | 2 | 0.7584 ns | 0.0172 ns | 0.0161 ns | 1.21 | 0.04 | -| | | | | | | | -| ArrayGetWithVar | 3 | 2.0160 ns | 0.0264 ns | 0.0247 ns | 2.19 | 0.07 | -| ArrayGetWithField | 3 | 0.9226 ns | 0.0309 ns | 0.0258 ns | 1.00 | 0.00 | -| SpanGet | 3 | 1.0568 ns | 0.0240 ns | 0.0213 ns | 1.15 | 0.04 | -| | | | | | | | -| ArrayGetWithVar | 4 | 2.2360 ns | 0.0200 ns | 0.0167 ns | 1.89 | 0.07 | -| ArrayGetWithField | 4 | 1.1815 ns | 0.0457 ns | 0.0427 ns | 1.00 | 0.00 | -| SpanGet | 4 | 1.2586 ns | 0.0343 ns | 0.0321 ns | 1.07 | 0.05 | -| | | | | | | | -| ArrayGetWithVar | 5 | 2.5662 ns | 0.0591 ns | 0.0523 ns | 1.45 | 0.06 | -| ArrayGetWithField | 5 | 1.7752 ns | 0.0663 ns | 0.0554 ns | 1.00 | 0.00 | -| SpanGet | 5 | 2.3339 ns | 0.0548 ns | 0.0512 ns | 1.31 | 0.04 | -| | | | | | | | -| ArrayGetWithVar | 6 | 2.9409 ns | 0.0605 ns | 0.0566 ns | 1.46 | 0.03 | -| ArrayGetWithField | 6 | 2.0072 ns | 0.0225 ns | 0.0188 ns | 1.00 | 0.00 | -| SpanGet | 6 | 2.5796 ns | 0.0595 ns | 0.0557 ns | 1.28 | 0.03 | -| | | | | | | | -| ArrayGetWithVar | 7 | 3.2910 ns | 0.0638 ns | 0.0596 ns | 1.27 | 0.05 | -| ArrayGetWithField | 7 | 2.6211 ns | 0.0830 ns | 0.0923 ns | 1.00 | 0.00 | -| SpanGet | 7 | 3.0480 ns | 0.0499 ns | 0.0416 ns | 1.18 | 0.05 | -| | | | | | | | -| ArrayGetWithVar | 8 | 3.6615 ns | 0.1036 ns | 0.1348 ns | 1.34 | 0.05 | -| ArrayGetWithField | 8 | 2.7175 ns | 0.0753 ns | 0.0668 ns | 1.00 | 0.00 | -| SpanGet | 8 | 3.2317 ns | 0.0873 ns | 0.0681 ns | 1.19 | 0.03 | -| | | | | | | | -| ArrayGetWithVar | 9 | 4.1159 ns | 0.1028 ns | 0.0912 ns | 1.39 | 0.06 | -| ArrayGetWithField | 9 | 2.9648 ns | 0.0797 ns | 0.0707 ns | 1.00 | 0.00 | -| SpanGet | 9 | 3.4643 ns | 0.0946 ns | 0.0838 ns | 1.17 | 0.04 | -| | | | | | | | -| ArrayGetWithVar | 10 | 4.5874 ns | 0.1178 ns | 0.1210 ns | 1.38 | 0.06 | -| ArrayGetWithField | 10 | 3.3250 ns | 0.0664 ns | 0.0588 ns | 1.00 | 0.00 | -| SpanGet | 10 | 3.6339 ns | 0.0678 ns | 0.0601 ns | 1.09 | 0.02 | -| | | | | | | | -| ArrayGetWithVar | 11 | 5.0294 ns | 0.0905 ns | 0.0803 ns | 1.41 | 0.04 | -| ArrayGetWithField | 11 | 3.5648 ns | 0.0933 ns | 0.0872 ns | 1.00 | 0.00 | -| SpanGet | 11 | 4.0259 ns | 0.1108 ns | 0.1319 ns | 1.13 | 0.05 | -| | | | | | | | -| ArrayGetWithVar | 12 | 5.2701 ns | 0.1157 ns | 0.1025 ns | 1.42 | 0.04 | -| ArrayGetWithField | 12 | 3.7002 ns | 0.0957 ns | 0.0848 ns | 1.00 | 0.00 | -| SpanGet | 12 | 4.3132 ns | 0.1102 ns | 0.0977 ns | 1.17 | 0.04 | -| | | | | | | | -| ArrayGetWithVar | 13 | 5.7393 ns | 0.1438 ns | 0.1345 ns | 1.41 | 0.03 | -| ArrayGetWithField | 13 | 4.0569 ns | 0.1034 ns | 0.0863 ns | 1.00 | 0.00 | -| SpanGet | 13 | 4.4506 ns | 0.0812 ns | 0.0720 ns | 1.10 | 0.03 | -| | | | | | | | -| ArrayGetWithVar | 14 | 6.0965 ns | 0.1023 ns | 0.0854 ns | 1.40 | 0.03 | -| ArrayGetWithField | 14 | 4.3728 ns | 0.0803 ns | 0.0751 ns | 1.00 | 0.00 | -| SpanGet | 14 | 4.6293 ns | 0.1178 ns | 0.2124 ns | 1.09 | 0.06 | -| | | | | | | | -| ArrayGetWithVar | 15 | 7.0026 ns | 0.1261 ns | 0.1053 ns | 1.42 | 0.02 | -| ArrayGetWithField | 15 | 4.9188 ns | 0.0506 ns | 0.0422 ns | 1.00 | 0.00 | -| SpanGet | 15 | 5.1823 ns | 0.1318 ns | 0.1233 ns | 1.05 | 0.03 | -| | | | | | | | -| ArrayGetWithVar | 16 | 8.3418 ns | 0.1920 ns | 0.1702 ns | 1.51 | 0.04 | -| ArrayGetWithField | 16 | 5.5086 ns | 0.1068 ns | 0.0947 ns | 1.00 | 0.00 | -| SpanGet | 16 | 5.4778 ns | 0.1416 ns | 0.2246 ns | 1.02 | 0.03 | -| | | | | | | | -| ArrayGetWithVar | 17 | 8.1520 ns | 0.0699 ns | 0.0620 ns | 1.69 | 0.01 | -| ArrayGetWithField | 17 | 4.8123 ns | 0.0442 ns | 0.0369 ns | 1.00 | 0.00 | -| SpanGet | 17 | 5.5824 ns | 0.0741 ns | 0.0693 ns | 1.16 | 0.02 | -| | | | | | | | -| ArrayGetWithVar | 18 | 7.4813 ns | 0.0414 ns | 0.0367 ns | 1.42 | 0.01 | -| ArrayGetWithField | 18 | 5.2566 ns | 0.0312 ns | 0.0260 ns | 1.00 | 0.00 | -| SpanGet | 18 | 5.9601 ns | 0.0816 ns | 0.0763 ns | 1.13 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 19 | 7.7273 ns | 0.0835 ns | 0.0781 ns | 1.49 | 0.02 | -| ArrayGetWithField | 19 | 5.2033 ns | 0.0313 ns | 0.0261 ns | 1.00 | 0.00 | -| SpanGet | 19 | 6.3312 ns | 0.1551 ns | 0.1593 ns | 1.22 | 0.03 | -| | | | | | | | -| ArrayGetWithVar | 20 | 7.9391 ns | 0.0515 ns | 0.0457 ns | 1.37 | 0.03 | -| ArrayGetWithField | 20 | 5.8071 ns | 0.1415 ns | 0.1390 ns | 1.00 | 0.00 | -| SpanGet | 20 | 5.9330 ns | 0.0500 ns | 0.0443 ns | 1.02 | 0.02 | -| | | | | | | | -| ArrayGetWithVar | 30 | 10.6019 ns | 0.1303 ns | 0.1219 ns | 1.29 | 0.02 | -| ArrayGetWithField | 30 | 8.2413 ns | 0.1019 ns | 0.0851 ns | 1.00 | 0.00 | -| SpanGet | 30 | 8.4137 ns | 0.1042 ns | 0.0924 ns | 1.02 | 0.02 | -| | | | | | | | -| ArrayGetWithVar | 32 | 11.0617 ns | 0.1536 ns | 0.1362 ns | 1.27 | 0.02 | -| ArrayGetWithField | 32 | 8.6916 ns | 0.1022 ns | 0.0906 ns | 1.00 | 0.00 | -| SpanGet | 32 | 8.8803 ns | 0.0642 ns | 0.0536 ns | 1.02 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 40 | 12.8859 ns | 0.0889 ns | 0.0742 ns | 1.21 | 0.01 | -| ArrayGetWithField | 40 | 10.6318 ns | 0.0740 ns | 0.0618 ns | 1.00 | 0.00 | -| SpanGet | 40 | 10.8128 ns | 0.0622 ns | 0.0519 ns | 1.02 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 50 | 15.2773 ns | 0.1358 ns | 0.1204 ns | 1.17 | 0.01 | -| ArrayGetWithField | 50 | 13.0385 ns | 0.0772 ns | 0.0603 ns | 1.00 | 0.00 | -| SpanGet | 50 | 13.2485 ns | 0.0861 ns | 0.0719 ns | 1.02 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 60 | 19.4536 ns | 0.3026 ns | 0.2682 ns | 1.25 | 0.02 | -| ArrayGetWithField | 60 | 15.5407 ns | 0.1195 ns | 0.0998 ns | 1.00 | 0.00 | -| SpanGet | 60 | 15.7285 ns | 0.0886 ns | 0.0740 ns | 1.01 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 80 | 23.6613 ns | 0.3427 ns | 0.3206 ns | 0.95 | 0.01 | -| ArrayGetWithField | 80 | 24.9804 ns | 0.1885 ns | 0.1671 ns | 1.00 | 0.00 | -| SpanGet | 80 | 20.7933 ns | 0.2044 ns | 0.1912 ns | 0.83 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 90 | 25.2124 ns | 0.2229 ns | 0.1976 ns | 1.09 | 0.01 | -| ArrayGetWithField | 90 | 23.0452 ns | 0.1873 ns | 0.1660 ns | 1.00 | 0.00 | -| SpanGet | 90 | 23.1852 ns | 0.1221 ns | 0.1142 ns | 1.01 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 100 | 38.4832 ns | 0.3491 ns | 0.3094 ns | 1.23 | 0.02 | -| ArrayGetWithField | 100 | 31.3061 ns | 0.2504 ns | 0.2220 ns | 1.00 | 0.00 | -| SpanGet | 100 | 31.1156 ns | 0.3401 ns | 0.3015 ns | 0.99 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 128 | 45.1141 ns | 0.2042 ns | 0.1594 ns | 1.18 | 0.01 | -| ArrayGetWithField | 128 | 38.3883 ns | 0.3717 ns | 0.3477 ns | 1.00 | 0.00 | -| SpanGet | 128 | 37.9068 ns | 0.2695 ns | 0.2250 ns | 0.99 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 256 | 77.4174 ns | 0.6796 ns | 0.6024 ns | 1.12 | 0.01 | -| ArrayGetWithField | 256 | 68.8870 ns | 0.4120 ns | 0.3441 ns | 1.00 | 0.00 | -| SpanGet | 256 | 68.4291 ns | 0.4472 ns | 0.4183 ns | 0.99 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 512 | 139.0822 ns | 1.1336 ns | 1.0049 ns | 1.06 | 0.01 | -| ArrayGetWithField | 512 | 131.7129 ns | 0.8504 ns | 0.7101 ns | 1.00 | 0.00 | -| SpanGet | 512 | 131.8641 ns | 0.9284 ns | 0.8684 ns | 1.00 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 1024 | 266.5707 ns | 4.5696 ns | 5.4397 ns | 1.04 | 0.02 | -| ArrayGetWithField | 1024 | 257.5734 ns | 1.2839 ns | 1.1382 ns | 1.00 | 0.00 | -| SpanGet | 1024 | 256.7122 ns | 1.0711 ns | 0.9495 ns | 1.00 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 2048 | 511.6425 ns | 1.5722 ns | 1.3129 ns | 1.00 | 0.01 | -| ArrayGetWithField | 2048 | 509.8994 ns | 2.5392 ns | 2.2509 ns | 1.00 | 0.00 | -| SpanGet | 2048 | 507.5335 ns | 4.0426 ns | 3.3758 ns | 1.00 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 4096 | 1,019.1013 ns | 10.1205 ns | 9.4668 ns | 1.00 | 0.01 | -| ArrayGetWithField | 4096 | 1,018.5594 ns | 4.6897 ns | 4.1573 ns | 1.00 | 0.00 | -| SpanGet | 4096 | 1,012.1960 ns | 7.4658 ns | 6.6183 ns | 0.99 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 8192 | 2,017.1872 ns | 14.3314 ns | 12.7044 ns | 1.00 | 0.01 | -| ArrayGetWithField | 8192 | 2,023.1594 ns | 12.9330 ns | 11.4648 ns | 1.00 | 0.00 | -| SpanGet | 8192 | 2,014.0275 ns | 14.3402 ns | 12.7123 ns | 1.00 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 1000000 | 245,965.8295 ns | 1,733.9504 ns | 1,447.9271 ns | 1.00 | 0.01 | -| ArrayGetWithField | 1000000 | 245,337.9044 ns | 1,055.8869 ns | 881.7134 ns | 1.00 | 0.00 | -| SpanGet | 1000000 | 245,687.0731 ns | 1,561.6594 ns | 1,219.2409 ns | 1.00 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 2147483591 | 525,684,023.0769 ns | 3,207,250.2244 ns | 2,678,199.1945 ns | 0.99 | 0.01 | -| ArrayGetWithField | 2147483591 | 529,688,963.4615 ns | 3,381,258.2043 ns | 2,823,503.7386 ns | 1.00 | 0.00 | -| SpanGet | 2147483591 | 529,698,631.2857 ns | 4,050,107.8977 ns | 3,590,315.1583 ns | 1.00 | 0.01 | - -// * Warnings * -MultimodalDistribution - SpanVsArrayBenchmarks.SpanGet: Default -> It seems that the distribution is bimodal (mValue = 3.54) - -// * Hints * -Outliers - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (3.23 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was detected (1.78 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (2.12 ns, 2.14 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (3.33 ns, 3.35 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.26 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (2.59 ns, 2.62 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 2 outliers were detected (2.57 ns, 2.65 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (3.86 ns, 3.91 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (4.31 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (3.58 ns..4.00 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (3.71 ns, 3.73 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (4.94 ns, 4.98 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (5.00 ns, 5.79 ns, 5.85 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.62 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (5.22 ns..5.28 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (6.25 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.91 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (5.41 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (6.96 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (5.20 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (5.55 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (7.00 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.16 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (7.55 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (5.25 ns, 5.66 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.38 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 4 outliers were removed (6.16 ns..6.78 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.37 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (8.13 ns, 8.29 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 6 outliers were removed (7.09 ns..7.33 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (8.48 ns, 9.28 ns, 9.33 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.81 ns, 6.84 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (10.70 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (7.53 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (8.13 ns..8.25 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (10.23 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.56 ns, 6.56 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.33 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.89 ns, 7.03 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.89 ns, 7.00 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.66 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (8.03 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (10.35 ns, 10.41 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (10.22 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (12.95 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (10.60 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (10.67 ns, 10.75 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (14.69 ns, 14.85 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (12.44 ns, 12.66 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (12.61 ns, 12.77 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (17.56 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (14.97 ns..14.98 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (15.18 ns, 15.61 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (22.40 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (17.54 ns, 18.13 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (17.74 ns, 17.99 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (26.15 ns, 27.17 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (27.26 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (25.32 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (41.56 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (33.96 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (33.76 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (47.36 ns..47.54 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (40.60 ns, 40.85 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (81.64 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (72.86 ns, 73.52 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (139.97 ns, 145.75 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (137.07 ns, 138.83 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (286.19 ns, 314.20 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (267.48 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (265.60 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (522.93 ns, 540.60 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (508.42 ns, 525.02 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (525.76 ns, 527.95 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 3 outliers were detected (1.01 us, 1.01 us, 1.07 us) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (1.07 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (2.08 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.10 us) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (2.12 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (256.02 us, 256.31 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (250.53 us, 250.70 us) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (252.66 us..282.22 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 4 outliers were detected (519.00 ms, 522.14 ms, 531.86 ms, 536.31 ms) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (544.93 ms, 551.49 ms) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (557.67 ms) - -// * Legends * - TestObjectCount : Value of the 'TestObjectCount' parameter - Mean : Arithmetic mean of all measurements - Error : Half of 99.9% confidence interval - StdDev : Standard deviation of all measurements - Ratio : Mean of the ratio distribution ([Current]/[Baseline]) - RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) - 1 ns : 1 Nanosecond (0.000000001 sec) - -************************************************************************************************************************************************* -************************************************************************************************************************************************* -************************************************************************************************************************************************* - -BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.1555) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.203 - [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - - -| Method | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | -|------------------ |---------------- |--------------------:|----------------:|----------------:|--------------------:|------:|--------:| -| ArrayGetWithVar | 1 | 1.4115 ns | 0.0127 ns | 0.0119 ns | 1.4133 ns | 6.74 | 0.18 | -| ArrayGetWithField | 1 | 0.2095 ns | 0.0051 ns | 0.0045 ns | 0.2107 ns | 1.00 | 0.00 | -| SpanGet | 1 | 0.2636 ns | 0.0024 ns | 0.0021 ns | 0.2632 ns | 1.26 | 0.03 | -| | | | | | | | | -| ArrayGetWithVar | 2 | 1.7398 ns | 0.0122 ns | 0.0114 ns | 1.7406 ns | 2.84 | 0.14 | -| ArrayGetWithField | 2 | 0.6150 ns | 0.0407 ns | 0.0318 ns | 0.6095 ns | 1.00 | 0.00 | -| SpanGet | 2 | 0.4950 ns | 0.0079 ns | 0.0066 ns | 0.4981 ns | 0.81 | 0.05 | -| | | | | | | | | -| ArrayGetWithVar | 3 | 2.2776 ns | 0.0778 ns | 0.2294 ns | 2.4503 ns | 2.21 | 0.25 | -| ArrayGetWithField | 3 | 1.0145 ns | 0.0439 ns | 0.0410 ns | 1.0062 ns | 1.00 | 0.00 | -| SpanGet | 3 | 0.7529 ns | 0.0250 ns | 0.0234 ns | 0.7476 ns | 0.74 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 4 | 2.2875 ns | 0.0630 ns | 0.0559 ns | 2.2669 ns | 2.27 | 0.06 | -| ArrayGetWithField | 4 | 1.0066 ns | 0.0164 ns | 0.0153 ns | 1.0050 ns | 1.00 | 0.00 | -| SpanGet | 4 | 0.9895 ns | 0.0123 ns | 0.0115 ns | 0.9922 ns | 0.98 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 5 | 2.6949 ns | 0.0633 ns | 0.0592 ns | 2.6701 ns | 1.42 | 0.16 | -| ArrayGetWithField | 5 | 1.9059 ns | 0.0682 ns | 0.1868 ns | 1.8684 ns | 1.00 | 0.00 | -| SpanGet | 5 | 1.5092 ns | 0.0392 ns | 0.0348 ns | 1.5102 ns | 0.79 | 0.09 | -| | | | | | | | | -| ArrayGetWithVar | 6 | 3.1465 ns | 0.0931 ns | 0.1143 ns | 3.0808 ns | 1.69 | 0.06 | -| ArrayGetWithField | 6 | 1.8594 ns | 0.0124 ns | 0.0116 ns | 1.8588 ns | 1.00 | 0.00 | -| SpanGet | 6 | 2.0726 ns | 0.0716 ns | 0.0879 ns | 2.0578 ns | 1.11 | 0.05 | -| | | | | | | | | -| ArrayGetWithVar | 7 | 3.2474 ns | 0.0525 ns | 0.0410 ns | 3.2404 ns | 1.51 | 0.02 | -| ArrayGetWithField | 7 | 2.1444 ns | 0.0223 ns | 0.0198 ns | 2.1434 ns | 1.00 | 0.00 | -| SpanGet | 7 | 2.3791 ns | 0.0572 ns | 0.0535 ns | 2.3924 ns | 1.11 | 0.03 | -| | | | | | | | | -| ArrayGetWithVar | 8 | 3.6571 ns | 0.1017 ns | 0.2055 ns | 3.5399 ns | 1.51 | 0.07 | -| ArrayGetWithField | 8 | 2.3724 ns | 0.0196 ns | 0.0174 ns | 2.3738 ns | 1.00 | 0.00 | -| SpanGet | 8 | 2.6088 ns | 0.0644 ns | 0.0602 ns | 2.6322 ns | 1.10 | 0.03 | -| | | | | | | | | -| ArrayGetWithVar | 9 | 3.8172 ns | 0.0061 ns | 0.0057 ns | 3.8155 ns | 1.46 | 0.02 | -| ArrayGetWithField | 9 | 2.6231 ns | 0.0313 ns | 0.0293 ns | 2.6143 ns | 1.00 | 0.00 | -| SpanGet | 9 | 2.9815 ns | 0.0446 ns | 0.0372 ns | 2.9849 ns | 1.14 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 10 | 4.3250 ns | 0.1161 ns | 0.2237 ns | 4.1797 ns | 1.36 | 0.07 | -| ArrayGetWithField | 10 | 3.1594 ns | 0.0278 ns | 0.0246 ns | 3.1674 ns | 1.00 | 0.00 | -| SpanGet | 10 | 2.9200 ns | 0.0834 ns | 0.0780 ns | 2.9040 ns | 0.92 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 11 | 4.8931 ns | 0.1262 ns | 0.2308 ns | 4.9847 ns | 1.44 | 0.09 | -| ArrayGetWithField | 11 | 3.3435 ns | 0.0487 ns | 0.0432 ns | 3.3299 ns | 1.00 | 0.00 | -| SpanGet | 11 | 3.3408 ns | 0.0429 ns | 0.0380 ns | 3.3398 ns | 1.00 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 12 | 5.2640 ns | 0.1334 ns | 0.2077 ns | 5.3314 ns | 1.59 | 0.06 | -| ArrayGetWithField | 12 | 3.2920 ns | 0.0112 ns | 0.0093 ns | 3.2942 ns | 1.00 | 0.00 | -| SpanGet | 12 | 3.5210 ns | 0.0979 ns | 0.0916 ns | 3.4896 ns | 1.07 | 0.03 | -| | | | | | | | | -| ArrayGetWithVar | 13 | 5.3287 ns | 0.0715 ns | 0.0669 ns | 5.3427 ns | 1.34 | 0.02 | -| ArrayGetWithField | 13 | 3.9872 ns | 0.0499 ns | 0.0467 ns | 3.9771 ns | 1.00 | 0.00 | -| SpanGet | 13 | 4.0250 ns | 0.0803 ns | 0.0751 ns | 4.0180 ns | 1.01 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 14 | 5.5447 ns | 0.1082 ns | 0.0845 ns | 5.5129 ns | 1.35 | 0.03 | -| ArrayGetWithField | 14 | 4.1072 ns | 0.0352 ns | 0.0329 ns | 4.1011 ns | 1.00 | 0.00 | -| SpanGet | 14 | 4.3101 ns | 0.1149 ns | 0.2042 ns | 4.4471 ns | 1.05 | 0.06 | -| | | | | | | | | -| ArrayGetWithVar | 15 | 5.9592 ns | 0.1007 ns | 0.0942 ns | 5.9521 ns | 1.38 | 0.02 | -| ArrayGetWithField | 15 | 4.3303 ns | 0.0146 ns | 0.0137 ns | 4.3332 ns | 1.00 | 0.00 | -| SpanGet | 15 | 4.5349 ns | 0.0952 ns | 0.0795 ns | 4.5473 ns | 1.05 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 16 | 6.2242 ns | 0.1520 ns | 0.2081 ns | 6.1473 ns | 1.30 | 0.05 | -| ArrayGetWithField | 16 | 4.8017 ns | 0.0312 ns | 0.0292 ns | 4.8077 ns | 1.00 | 0.00 | -| SpanGet | 16 | 4.6087 ns | 0.1206 ns | 0.1128 ns | 4.5630 ns | 0.96 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 17 | 6.5752 ns | 0.1582 ns | 0.2057 ns | 6.5724 ns | 1.44 | 0.05 | -| ArrayGetWithField | 17 | 4.5792 ns | 0.0274 ns | 0.0243 ns | 4.5754 ns | 1.00 | 0.00 | -| SpanGet | 17 | 5.1442 ns | 0.0570 ns | 0.0533 ns | 5.1497 ns | 1.12 | 0.01 | -| | | | | | | | | -| ArrayGetWithVar | 18 | 6.6317 ns | 0.1327 ns | 0.1108 ns | 6.5870 ns | 1.17 | 0.02 | -| ArrayGetWithField | 18 | 5.6728 ns | 0.0296 ns | 0.0277 ns | 5.6707 ns | 1.00 | 0.00 | -| SpanGet | 18 | 4.9786 ns | 0.0787 ns | 0.0736 ns | 4.9597 ns | 0.88 | 0.02 | -| | | | | | | | | -| ArrayGetWithVar | 19 | 6.9428 ns | 0.0477 ns | 0.0398 ns | 6.9283 ns | 1.33 | 0.01 | -| ArrayGetWithField | 19 | 5.2353 ns | 0.0249 ns | 0.0221 ns | 5.2269 ns | 1.00 | 0.00 | -| SpanGet | 19 | 5.2300 ns | 0.0300 ns | 0.0266 ns | 5.2179 ns | 1.00 | 0.01 | -| | | | | | | | | -| ArrayGetWithVar | 20 | 7.4626 ns | 0.0782 ns | 0.0653 ns | 7.4410 ns | 1.28 | 0.04 | -| ArrayGetWithField | 20 | 5.7347 ns | 0.1435 ns | 0.1815 ns | 5.6633 ns | 1.00 | 0.00 | -| SpanGet | 20 | 5.4807 ns | 0.0085 ns | 0.0075 ns | 5.4807 ns | 0.94 | 0.03 | -| | | | | | | | | -| ArrayGetWithVar | 30 | 10.4216 ns | 0.2361 ns | 0.2986 ns | 10.4605 ns | 1.31 | 0.04 | -| ArrayGetWithField | 30 | 7.9253 ns | 0.0101 ns | 0.0089 ns | 7.9231 ns | 1.00 | 0.00 | -| SpanGet | 30 | 7.8815 ns | 0.0056 ns | 0.0046 ns | 7.8799 ns | 0.99 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 32 | 10.9016 ns | 0.2460 ns | 0.2928 ns | 10.9234 ns | 1.20 | 0.04 | -| ArrayGetWithField | 32 | 9.0887 ns | 0.1490 ns | 0.1393 ns | 9.0872 ns | 1.00 | 0.00 | -| SpanGet | 32 | 8.3599 ns | 0.0023 ns | 0.0018 ns | 8.3594 ns | 0.92 | 0.01 | -| | | | | | | | | -| ArrayGetWithVar | 40 | 12.1384 ns | 0.0332 ns | 0.0259 ns | 12.1259 ns | 1.18 | 0.00 | -| ArrayGetWithField | 40 | 10.2890 ns | 0.0161 ns | 0.0142 ns | 10.2858 ns | 1.00 | 0.00 | -| SpanGet | 40 | 10.2771 ns | 0.0087 ns | 0.0082 ns | 10.2725 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 50 | 14.5209 ns | 0.0094 ns | 0.0074 ns | 14.5204 ns | 1.14 | 0.00 | -| ArrayGetWithField | 50 | 12.7090 ns | 0.0251 ns | 0.0235 ns | 12.7142 ns | 1.00 | 0.00 | -| SpanGet | 50 | 12.6737 ns | 0.0104 ns | 0.0082 ns | 12.6719 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 60 | 16.9274 ns | 0.0157 ns | 0.0131 ns | 16.9289 ns | 1.12 | 0.00 | -| ArrayGetWithField | 60 | 15.0932 ns | 0.0385 ns | 0.0341 ns | 15.0869 ns | 1.00 | 0.00 | -| SpanGet | 60 | 15.0897 ns | 0.0438 ns | 0.0409 ns | 15.0743 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 80 | 22.2228 ns | 0.1792 ns | 0.1676 ns | 22.1639 ns | 1.07 | 0.01 | -| ArrayGetWithField | 80 | 20.8031 ns | 0.1991 ns | 0.1863 ns | 20.8343 ns | 1.00 | 0.00 | -| SpanGet | 80 | 20.2242 ns | 0.1555 ns | 0.1378 ns | 20.2300 ns | 0.97 | 0.01 | -| | | | | | | | | -| ArrayGetWithVar | 90 | 24.1033 ns | 0.0211 ns | 0.0176 ns | 24.0949 ns | 1.08 | 0.00 | -| ArrayGetWithField | 90 | 22.2535 ns | 0.0180 ns | 0.0160 ns | 22.2475 ns | 1.00 | 0.00 | -| SpanGet | 90 | 22.2278 ns | 0.0063 ns | 0.0052 ns | 22.2260 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 100 | 35.7519 ns | 0.1380 ns | 0.1291 ns | 35.7208 ns | 1.18 | 0.00 | -| ArrayGetWithField | 100 | 30.3591 ns | 0.0262 ns | 0.0219 ns | 30.3633 ns | 1.00 | 0.00 | -| SpanGet | 100 | 30.1375 ns | 0.0272 ns | 0.0241 ns | 30.1293 ns | 0.99 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 128 | 42.4070 ns | 0.0753 ns | 0.0668 ns | 42.3966 ns | 1.15 | 0.00 | -| ArrayGetWithField | 128 | 37.0188 ns | 0.0491 ns | 0.0436 ns | 37.0096 ns | 1.00 | 0.00 | -| SpanGet | 128 | 36.9420 ns | 0.1566 ns | 0.1465 ns | 36.8590 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 256 | 72.3880 ns | 0.5299 ns | 0.4957 ns | 72.2868 ns | 1.08 | 0.01 | -| ArrayGetWithField | 256 | 67.2595 ns | 0.1700 ns | 0.1590 ns | 67.1937 ns | 1.00 | 0.00 | -| SpanGet | 256 | 66.5708 ns | 0.1292 ns | 0.1145 ns | 66.5350 ns | 0.99 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 512 | 133.9119 ns | 0.3940 ns | 0.3290 ns | 133.9845 ns | 1.05 | 0.00 | -| ArrayGetWithField | 512 | 127.9565 ns | 0.1367 ns | 0.1141 ns | 127.9270 ns | 1.00 | 0.00 | -| SpanGet | 512 | 127.7372 ns | 0.1064 ns | 0.0943 ns | 127.7265 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 1024 | 255.4683 ns | 0.7553 ns | 0.6695 ns | 255.1568 ns | 1.02 | 0.00 | -| ArrayGetWithField | 1024 | 250.5938 ns | 0.2526 ns | 0.2239 ns | 250.5821 ns | 1.00 | 0.00 | -| SpanGet | 1024 | 250.7683 ns | 0.6080 ns | 0.5687 ns | 250.6417 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 2048 | 500.8917 ns | 1.0776 ns | 1.0080 ns | 500.4943 ns | 1.01 | 0.00 | -| ArrayGetWithField | 2048 | 495.4565 ns | 0.3916 ns | 0.3270 ns | 495.4714 ns | 1.00 | 0.00 | -| SpanGet | 2048 | 495.2572 ns | 0.4029 ns | 0.3364 ns | 495.2063 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 4096 | 992.1368 ns | 2.8754 ns | 2.6897 ns | 990.8590 ns | 1.01 | 0.00 | -| ArrayGetWithField | 4096 | 986.0712 ns | 0.8923 ns | 0.7910 ns | 985.8429 ns | 1.00 | 0.00 | -| SpanGet | 4096 | 984.9568 ns | 0.4072 ns | 0.3610 ns | 985.0019 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 8192 | 1,968.7538 ns | 0.2638 ns | 0.2060 ns | 1,968.7178 ns | 1.00 | 0.00 | -| ArrayGetWithField | 8192 | 1,966.1739 ns | 2.8904 ns | 2.5623 ns | 1,964.7451 ns | 1.00 | 0.00 | -| SpanGet | 8192 | 1,967.1070 ns | 5.1706 ns | 4.8366 ns | 1,964.2349 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 1000000 | 239,186.3037 ns | 31.2120 ns | 26.0634 ns | 239,181.6895 ns | 1.00 | 0.00 | -| ArrayGetWithField | 1000000 | 239,251.0824 ns | 190.1186 ns | 177.8370 ns | 239,231.1279 ns | 1.00 | 0.00 | -| SpanGet | 1000000 | 239,076.0725 ns | 42.7034 ns | 37.8555 ns | 239,069.7632 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArrayGetWithVar | 2147483591 | 513,362,891.6667 ns | 51,845.5735 ns | 40,477.6135 ns | 513,367,700.0000 ns | 1.00 | 0.00 | -| ArrayGetWithField | 2147483591 | 513,708,415.3846 ns | 214,407.5874 ns | 179,040.0460 ns | 513,678,800.0000 ns | 1.00 | 0.00 | -| SpanGet | 2147483591 | 513,460,507.1429 ns | 68,937.1375 ns | 61,110.9768 ns | 513,482,050.0000 ns | 1.00 | 0.00 | - -// * Warnings * -MultimodalDistribution - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> It seems that the distribution is bimodal (mValue = 3.76) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> It seems that the distribution can have several modes (mValue = 3.11) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> It seems that the distribution can have several modes (mValue = 3) - SpanVsArrayBenchmarks.SpanGet: Default -> It seems that the distribution is bimodal (mValue = 3.7) - -// * Hints * -Outliers - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were detected (2.89 ns, 2.89 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (1.70 ns, 1.72 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (1.78 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was detected (3.22 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (2.30 ns..2.31 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (1.99 ns, 2.03 ns, 2.03 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (4.22 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were detected (2.49 ns, 2.49 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (3.18 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (5.32 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (5.54 ns..5.70 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (3.71 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was detected (3.69 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (3.84 ns, 3.94 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was detected (3.93 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (4.61 ns, 4.66 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.74 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (5.13 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (4.99 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed, 3 outliers were detected (4.78 ns, 4.82 ns, 4.83 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was detected (6.67 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (7.60 ns..7.80 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (5.80 ns, 6.25 ns, 6.30 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.06 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (6.20 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (8.53 ns, 8.53 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (8.60 ns, 8.88 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (6.83 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.86 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (9.40 ns, 9.72 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (7.04 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 4 outliers were detected (11.40 ns..11.44 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (9.46 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (9.41 ns, 9.45 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were detected (11.72 ns, 11.76 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was detected (10.28 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (9.87 ns..9.93 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (16.07 ns..16.45 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (11.86 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (16.06 ns..16.08 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (14.23 ns..14.41 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (18.48 ns, 18.50 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (16.73 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (22.24 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (25.69 ns, 25.74 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (23.83 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (23.77 ns, 23.80 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (31.96 ns, 32.11 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (31.75 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (44.17 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (39.06 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (69.39 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 4 outliers were detected (135.67 ns, 135.69 ns, 137.00 ns, 137.67 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (132.07 ns, 132.46 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (130.78 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (259.74 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 3 outliers were detected (252.78 ns, 252.79 ns, 253.80 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (500.68 ns, 502.22 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (500.38 ns, 500.51 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (991.97 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 3 outliers were detected (986.70 ns, 986.75 ns, 991.81 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (1.97 us..1.98 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (1.98 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (239.28 us, 239.68 us) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (240.97 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (513.53 ms..514.07 ms) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (515.12 ms, 515.88 ms) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 2 outliers were detected (513.32 ms, 513.60 ms) - -// * Legends * - TestObjectCount : Value of the 'TestObjectCount' parameter - Mean : Arithmetic mean of all measurements - Error : Half of 99.9% confidence interval - StdDev : Standard deviation of all measurements - Median : Value separating the higher half of all measurements (50th percentile) - Ratio : Mean of the ratio distribution ([Current]/[Baseline]) - RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) - 1 ns : 1 Nanosecond (0.000000001 sec)BenchmarkDotNet=v0.13.3, OS=ubuntu 20.04 - -************************************************************************************************************************************************* -************************************************************************************************************************************************* -************************************************************************************************************************************************* - -Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 4 l -ogical and 2 physical cores -.NET SDK=7.0.203 - [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - - -| Method | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | -|------------------ |---------------- |--------------------:|------------------:|------------------:|------:|--------:| -| ArrayGetWithVar | 1 | 1.7144 ns | 0.0035 ns | 0.0033 ns | 4.97 | 0.01 | -| ArrayGetWithField | 1 | 0.3450 ns | 0.0009 ns | 0.0008 ns | 1.00 | 0.00 | -| SpanGet | 1 | 0.3670 ns | 0.0007 ns | 0.0007 ns | 1.06 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 2 | 1.7904 ns | 0.0007 ns | 0.0006 ns | 4.58 | 0.01 | -| ArrayGetWithField | 2 | 0.3912 ns | 0.0010 ns | 0.0009 ns | 1.00 | 0.00 | -| SpanGet | 2 | 0.6750 ns | 0.0021 ns | 0.0018 ns | 1.73 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 3 | 2.4049 ns | 0.0006 ns | 0.0005 ns | 2.50 | 0.00 | -| ArrayGetWithField | 3 | 0.9626 ns | 0.0018 ns | 0.0015 ns | 1.00 | 0.00 | -| SpanGet | 3 | 1.5743 ns | 0.0010 ns | 0.0008 ns | 1.64 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 4 | 2.9208 ns | 0.0017 ns | 0.0013 ns | 1.94 | 0.00 | -| ArrayGetWithField | 4 | 1.5076 ns | 0.0024 ns | 0.0021 ns | 1.00 | 0.00 | -| SpanGet | 4 | 1.9629 ns | 0.0027 ns | 0.0024 ns | 1.30 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 5 | 3.9197 ns | 0.0028 ns | 0.0025 ns | 1.57 | 0.00 | -| ArrayGetWithField | 5 | 2.4945 ns | 0.0048 ns | 0.0042 ns | 1.00 | 0.00 | -| SpanGet | 5 | 2.7509 ns | 0.0344 ns | 0.0322 ns | 1.10 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 6 | 3.5986 ns | 0.0261 ns | 0.0232 ns | 1.72 | 0.02 | -| ArrayGetWithField | 6 | 2.0963 ns | 0.0163 ns | 0.0152 ns | 1.00 | 0.00 | -| SpanGet | 6 | 3.0419 ns | 0.0818 ns | 0.0765 ns | 1.45 | 0.04 | -| | | | | | | | -| ArrayGetWithVar | 7 | 3.9044 ns | 0.0373 ns | 0.0349 ns | 1.64 | 0.02 | -| ArrayGetWithField | 7 | 2.3830 ns | 0.0172 ns | 0.0161 ns | 1.00 | 0.00 | -| SpanGet | 7 | 3.7281 ns | 0.0007 ns | 0.0006 ns | 1.57 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 8 | 4.1182 ns | 0.0017 ns | 0.0015 ns | 1.50 | 0.00 | -| ArrayGetWithField | 8 | 2.7423 ns | 0.0008 ns | 0.0007 ns | 1.00 | 0.00 | -| SpanGet | 8 | 3.9225 ns | 0.0006 ns | 0.0005 ns | 1.43 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 9 | 4.3981 ns | 0.0023 ns | 0.0018 ns | 1.53 | 0.00 | -| ArrayGetWithField | 9 | 2.8798 ns | 0.0008 ns | 0.0007 ns | 1.00 | 0.00 | -| SpanGet | 9 | 4.2915 ns | 0.0005 ns | 0.0005 ns | 1.49 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 10 | 4.6168 ns | 0.0045 ns | 0.0042 ns | 1.40 | 0.00 | -| ArrayGetWithField | 10 | 3.3040 ns | 0.0007 ns | 0.0006 ns | 1.00 | 0.00 | -| SpanGet | 10 | 4.3824 ns | 0.0087 ns | 0.0082 ns | 1.33 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 11 | 5.0594 ns | 0.0063 ns | 0.0049 ns | 1.35 | 0.00 | -| ArrayGetWithField | 11 | 3.7469 ns | 0.0008 ns | 0.0006 ns | 1.00 | 0.00 | -| SpanGet | 11 | 4.7152 ns | 0.0148 ns | 0.0138 ns | 1.26 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 12 | 5.1340 ns | 0.0012 ns | 0.0010 ns | 1.26 | 0.00 | -| ArrayGetWithField | 12 | 4.0666 ns | 0.0080 ns | 0.0071 ns | 1.00 | 0.00 | -| SpanGet | 12 | 5.0472 ns | 0.0073 ns | 0.0069 ns | 1.24 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 13 | 5.6316 ns | 0.0015 ns | 0.0012 ns | 1.28 | 0.01 | -| ArrayGetWithField | 13 | 4.3903 ns | 0.0249 ns | 0.0221 ns | 1.00 | 0.00 | -| SpanGet | 13 | 5.3302 ns | 0.0088 ns | 0.0078 ns | 1.21 | 0.01 | -| | | | | | | | -| ArrayGetWithVar | 14 | 5.8691 ns | 0.0060 ns | 0.0056 ns | 1.22 | 0.00 | -| ArrayGetWithField | 14 | 4.7932 ns | 0.0059 ns | 0.0056 ns | 1.00 | 0.00 | -| SpanGet | 14 | 5.6502 ns | 0.0179 ns | 0.0158 ns | 1.18 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 15 | 6.6377 ns | 0.0028 ns | 0.0022 ns | 1.27 | 0.00 | -| ArrayGetWithField | 15 | 5.2252 ns | 0.0014 ns | 0.0013 ns | 1.00 | 0.00 | -| SpanGet | 15 | 5.9511 ns | 0.0158 ns | 0.0148 ns | 1.14 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 16 | 6.8981 ns | 0.0119 ns | 0.0112 ns | 1.24 | 0.00 | -| ArrayGetWithField | 16 | 5.5505 ns | 0.0114 ns | 0.0106 ns | 1.00 | 0.00 | -| SpanGet | 16 | 6.2346 ns | 0.0200 ns | 0.0177 ns | 1.12 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 17 | 7.7612 ns | 0.0088 ns | 0.0078 ns | 1.33 | 0.00 | -| ArrayGetWithField | 17 | 5.8474 ns | 0.0084 ns | 0.0078 ns | 1.00 | 0.00 | -| SpanGet | 17 | 6.5241 ns | 0.0204 ns | 0.0191 ns | 1.12 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 18 | 8.0601 ns | 0.0168 ns | 0.0149 ns | 1.24 | 0.02 | -| ArrayGetWithField | 18 | 6.4858 ns | 0.1023 ns | 0.0957 ns | 1.00 | 0.00 | -| SpanGet | 18 | 6.8394 ns | 0.0342 ns | 0.0320 ns | 1.05 | 0.02 | -| | | | | | | | -| ArrayGetWithVar | 19 | 8.5406 ns | 0.0016 ns | 0.0013 ns | 1.27 | 0.00 | -| ArrayGetWithField | 19 | 6.7132 ns | 0.0154 ns | 0.0128 ns | 1.00 | 0.00 | -| SpanGet | 19 | 7.1487 ns | 0.0293 ns | 0.0274 ns | 1.06 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 20 | 8.8478 ns | 0.0129 ns | 0.0121 ns | 1.26 | 0.00 | -| ArrayGetWithField | 20 | 7.0262 ns | 0.0066 ns | 0.0058 ns | 1.00 | 0.00 | -| SpanGet | 20 | 7.4524 ns | 0.0215 ns | 0.0190 ns | 1.06 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 30 | 12.6107 ns | 0.0573 ns | 0.0536 ns | 1.18 | 0.01 | -| ArrayGetWithField | 30 | 10.7281 ns | 0.0160 ns | 0.0150 ns | 1.00 | 0.00 | -| SpanGet | 30 | 10.5565 ns | 0.0429 ns | 0.0380 ns | 0.98 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 32 | 13.2197 ns | 0.0958 ns | 0.0896 ns | 1.15 | 0.01 | -| ArrayGetWithField | 32 | 11.5303 ns | 0.0275 ns | 0.0244 ns | 1.00 | 0.00 | -| SpanGet | 32 | 11.7189 ns | 0.0331 ns | 0.0309 ns | 1.02 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 40 | 17.1164 ns | 0.0674 ns | 0.0598 ns | 1.04 | 0.00 | -| ArrayGetWithField | 40 | 16.4160 ns | 0.0464 ns | 0.0434 ns | 1.00 | 0.00 | -| SpanGet | 40 | 14.8238 ns | 0.0468 ns | 0.0438 ns | 0.90 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 50 | 18.5728 ns | 0.0593 ns | 0.0554 ns | 1.02 | 0.00 | -| ArrayGetWithField | 50 | 18.1323 ns | 0.0233 ns | 0.0218 ns | 1.00 | 0.00 | -| SpanGet | 50 | 18.3620 ns | 0.0352 ns | 0.0312 ns | 1.01 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 60 | 27.7889 ns | 0.0589 ns | 0.0551 ns | 1.08 | 0.00 | -| ArrayGetWithField | 60 | 25.7314 ns | 0.0342 ns | 0.0320 ns | 1.00 | 0.00 | -| SpanGet | 60 | 19.3356 ns | 0.0274 ns | 0.0243 ns | 0.75 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 80 | 50.0414 ns | 0.3840 ns | 0.3592 ns | 1.16 | 0.01 | -| ArrayGetWithField | 80 | 43.3203 ns | 0.0732 ns | 0.0685 ns | 1.00 | 0.00 | -| SpanGet | 80 | 46.2991 ns | 0.1615 ns | 0.1348 ns | 1.07 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 90 | 30.3271 ns | 0.0299 ns | 0.0250 ns | 0.92 | 0.00 | -| ArrayGetWithField | 90 | 32.9228 ns | 0.0448 ns | 0.0397 ns | 1.00 | 0.00 | -| SpanGet | 90 | 30.1212 ns | 0.0279 ns | 0.0247 ns | 0.91 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 100 | 50.9207 ns | 0.0524 ns | 0.0438 ns | 1.15 | 0.00 | -| ArrayGetWithField | 100 | 44.3034 ns | 0.0203 ns | 0.0169 ns | 1.00 | 0.00 | -| SpanGet | 100 | 48.1193 ns | 0.0569 ns | 0.0533 ns | 1.09 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 128 | 63.5936 ns | 0.0735 ns | 0.0687 ns | 1.17 | 0.00 | -| ArrayGetWithField | 128 | 54.3614 ns | 0.0326 ns | 0.0305 ns | 1.00 | 0.00 | -| SpanGet | 128 | 59.9921 ns | 0.0440 ns | 0.0390 ns | 1.10 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 256 | 101.1193 ns | 0.0666 ns | 0.0556 ns | 1.00 | 0.00 | -| ArrayGetWithField | 256 | 101.0048 ns | 0.0942 ns | 0.0835 ns | 1.00 | 0.00 | -| SpanGet | 256 | 97.7434 ns | 0.0330 ns | 0.0257 ns | 0.97 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 512 | 176.4697 ns | 0.0506 ns | 0.0473 ns | 0.90 | 0.00 | -| ArrayGetWithField | 512 | 195.4723 ns | 0.0439 ns | 0.0389 ns | 1.00 | 0.00 | -| SpanGet | 512 | 173.3604 ns | 0.0621 ns | 0.0551 ns | 0.89 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 1024 | 327.4840 ns | 0.0646 ns | 0.0540 ns | 0.85 | 0.00 | -| ArrayGetWithField | 1024 | 385.4179 ns | 0.4587 ns | 0.4066 ns | 1.00 | 0.00 | -| SpanGet | 1024 | 324.5606 ns | 0.4749 ns | 0.4210 ns | 0.84 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 2048 | 630.3876 ns | 0.4305 ns | 0.4027 ns | 0.82 | 0.00 | -| ArrayGetWithField | 2048 | 764.5638 ns | 1.1467 ns | 1.0726 ns | 1.00 | 0.00 | -| SpanGet | 2048 | 627.6572 ns | 0.7236 ns | 0.6768 ns | 0.82 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 4096 | 1,234.8919 ns | 0.1193 ns | 0.0996 ns | 0.81 | 0.00 | -| ArrayGetWithField | 4096 | 1,520.9689 ns | 0.7341 ns | 0.6508 ns | 1.00 | 0.00 | -| SpanGet | 4096 | 1,232.3784 ns | 0.6339 ns | 0.5293 ns | 0.81 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 8192 | 2,444.7565 ns | 0.4708 ns | 0.3931 ns | 0.81 | 0.00 | -| ArrayGetWithField | 8192 | 3,032.8116 ns | 0.4344 ns | 0.3391 ns | 1.00 | 0.00 | -| SpanGet | 8192 | 2,442.6178 ns | 0.5773 ns | 0.4821 ns | 0.81 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 1000000 | 295,415.8654 ns | 48.2387 ns | 42.7623 ns | 0.80 | 0.00 | -| ArrayGetWithField | 1000000 | 369,338.8544 ns | 163.6322 ns | 136.6403 ns | 1.00 | 0.00 | -| SpanGet | 1000000 | 295,432.4293 ns | 186.8233 ns | 145.8593 ns | 0.80 | 0.00 | -| | | | | | | | -| ArrayGetWithVar | 2147483591 | 635,510,534.2000 ns | 1,123,953.3384 ns | 1,051,346.6501 ns | 0.80 | 0.00 | -| ArrayGetWithField | 2147483591 | 792,820,286.0714 ns | 158,248.9330 ns | 140,283.5572 ns | 1.00 | 0.00 | -| SpanGet | 2147483591 | 634,263,796.3077 ns | 73,366.8521 ns | 61,264.6443 ns | 0.80 | 0.00 | - -// * Hints * -Outliers - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.25 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (3.68 ns, 3.69 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.26 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (2.55 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (4.29 ns, 4.29 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed, 3 outliers were detected (2.82 ns, 2.83 ns, 2.83 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (3.44 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (4.82 ns..4.83 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (3.38 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (3.84 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (5.80 ns, 5.91 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.38 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (5.54 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (5.61 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (6.02 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.61 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (5.79 ns, 5.79 ns, 5.79 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (6.29 ns..6.29 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (4.75 ns, 4.77 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (6.16 ns, 6.17 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (5.18 ns, 5.18 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (6.99 ns..8.17 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (5.62 ns, 5.62 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (7.02 ns, 7.02 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (5.96 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (7.75 ns..7.99 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (6.43 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (7.22 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (7.56 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (8.53 ns..8.54 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (8.17 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.68 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.99 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (10.44 ns..10.44 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (8.62 ns, 8.93 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (8.93 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (9.38 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 2 outliers were detected (12.35 ns, 12.51 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (13.46 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (19.70 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 4 outliers were detected (20.15 ns..20.19 ns, 20.29 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (21.29 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was detected (44.96 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (47.84 ns, 48.47 ns, 48.59 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (32.39 ns, 32.48 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (34.93 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (32.13 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (52.69 ns, 52.92 ns, 52.93 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (46.28 ns, 46.29 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (63.12 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (103.46 ns, 103.46 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (103.80 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (100.34 ns..100.90 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (202.86 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (176.24 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (330.17 ns, 330.82 ns) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (394.09 ns) - SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (328.45 ns) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (1.24 us, 1.24 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (1.52 us, 1.53 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (2.45 us, 2.45 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (3.04 us..3.04 us) - SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (295.35 us, 295.66 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (369.92 us, 370.16 us) - SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (296.57 us..306.32 us) - SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (793.21 ms) - SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (634.57 ms, 634.59 ms) - -// * Legends * - TestObjectCount : Value of the 'TestObjectCount' parameter - Mean : Arithmetic mean of all measurements - Error : Half of 99.9% confidence interval - StdDev : Standard deviation of all measurements - Ratio : Mean of the ratio distribution ([Current]/[Baseline]) - RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) - 1 ns : 1 Nanosecond (0.000000001 sec) - -************************************************************************************************************************************************* -************************************************************************************************************************************************* -************************************************************************************************************************************************* - - BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.1555) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.203 - [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - - -| Method | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | -|------------------ |---------------- |----------------------:|-------------------:|-------------------:|----------------------:|------:|--------:| -| ArraySetWithVar | 1 | 1.4697 ns | 0.0243 ns | 0.0227 ns | 1.4777 ns | 4.29 | 0.29 | -| ArraySetWithField | 1 | 0.3436 ns | 0.0225 ns | 0.0210 ns | 0.3492 ns | 1.00 | 0.00 | -| SpanSet | 1 | 0.5153 ns | 0.0077 ns | 0.0069 ns | 0.5159 ns | 1.50 | 0.09 | -| | | | | | | | | -| ArraySetWithVar | 2 | 1.7058 ns | 0.0124 ns | 0.0116 ns | 1.7081 ns | 2.44 | 0.02 | -| ArraySetWithField | 2 | 0.7001 ns | 0.0017 ns | 0.0013 ns | 0.7000 ns | 1.00 | 0.00 | -| SpanSet | 2 | 1.1681 ns | 0.0445 ns | 0.0417 ns | 1.1618 ns | 1.68 | 0.07 | -| | | | | | | | | -| ArraySetWithVar | 3 | 2.1158 ns | 0.0724 ns | 0.1589 ns | 2.1493 ns | 2.18 | 0.16 | -| ArraySetWithField | 3 | 0.9698 ns | 0.0024 ns | 0.0020 ns | 0.9697 ns | 1.00 | 0.00 | -| SpanSet | 3 | 1.5822 ns | 0.0164 ns | 0.0153 ns | 1.5835 ns | 1.63 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 4 | 2.2945 ns | 0.0055 ns | 0.0049 ns | 2.2936 ns | 1.80 | 0.00 | -| ArraySetWithField | 4 | 1.2779 ns | 0.0038 ns | 0.0029 ns | 1.2779 ns | 1.00 | 0.00 | -| SpanSet | 4 | 2.0907 ns | 0.0125 ns | 0.0111 ns | 2.0963 ns | 1.64 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 5 | 2.7734 ns | 0.0494 ns | 0.0507 ns | 2.7562 ns | 1.60 | 0.03 | -| ArraySetWithField | 5 | 1.7355 ns | 0.0096 ns | 0.0080 ns | 1.7390 ns | 1.00 | 0.00 | -| SpanSet | 5 | 2.8583 ns | 0.0867 ns | 0.1586 ns | 2.7817 ns | 1.65 | 0.10 | -| | | | | | | | | -| ArraySetWithVar | 6 | 3.8121 ns | 0.0173 ns | 0.0154 ns | 3.8119 ns | 1.82 | 0.02 | -| ArraySetWithField | 6 | 2.0951 ns | 0.0165 ns | 0.0146 ns | 2.0946 ns | 1.00 | 0.00 | -| SpanSet | 6 | 3.3108 ns | 0.0354 ns | 0.0331 ns | 3.3259 ns | 1.58 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 7 | 3.4567 ns | 0.0165 ns | 0.0129 ns | 3.4596 ns | 1.41 | 0.01 | -| ArraySetWithField | 7 | 2.4506 ns | 0.0052 ns | 0.0046 ns | 2.4511 ns | 1.00 | 0.00 | -| SpanSet | 7 | 3.6886 ns | 0.0219 ns | 0.0183 ns | 3.6959 ns | 1.51 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 8 | 3.8263 ns | 0.0097 ns | 0.0086 ns | 3.8244 ns | 1.40 | 0.01 | -| ArraySetWithField | 8 | 2.7420 ns | 0.0113 ns | 0.0106 ns | 2.7401 ns | 1.00 | 0.00 | -| SpanSet | 8 | 4.3303 ns | 0.0419 ns | 0.0392 ns | 4.3372 ns | 1.58 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 9 | 4.0671 ns | 0.0144 ns | 0.0120 ns | 4.0669 ns | 1.32 | 0.00 | -| ArraySetWithField | 9 | 3.0772 ns | 0.0066 ns | 0.0055 ns | 3.0759 ns | 1.00 | 0.00 | -| SpanSet | 9 | 4.7950 ns | 0.0458 ns | 0.0429 ns | 4.7805 ns | 1.56 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 10 | 5.0931 ns | 0.0349 ns | 0.0326 ns | 5.1000 ns | 1.41 | 0.02 | -| ArraySetWithField | 10 | 3.6005 ns | 0.0558 ns | 0.0522 ns | 3.6177 ns | 1.00 | 0.00 | -| SpanSet | 10 | 5.3014 ns | 0.1238 ns | 0.1158 ns | 5.2656 ns | 1.47 | 0.04 | -| | | | | | | | | -| ArraySetWithVar | 11 | 4.6538 ns | 0.1019 ns | 0.0953 ns | 4.6584 ns | 1.27 | 0.03 | -| ArraySetWithField | 11 | 3.6546 ns | 0.0123 ns | 0.0115 ns | 3.6556 ns | 1.00 | 0.00 | -| SpanSet | 11 | 5.6726 ns | 0.0291 ns | 0.0272 ns | 5.6684 ns | 1.55 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 12 | 5.0027 ns | 0.0697 ns | 0.0652 ns | 4.9778 ns | 1.25 | 0.02 | -| ArraySetWithField | 12 | 4.0128 ns | 0.0249 ns | 0.0233 ns | 4.0165 ns | 1.00 | 0.00 | -| SpanSet | 12 | 6.0483 ns | 0.0539 ns | 0.0421 ns | 6.0564 ns | 1.51 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 13 | 5.1638 ns | 0.0386 ns | 0.0342 ns | 5.1679 ns | 1.23 | 0.01 | -| ArraySetWithField | 13 | 4.1868 ns | 0.0080 ns | 0.0071 ns | 4.1877 ns | 1.00 | 0.00 | -| SpanSet | 13 | 6.8180 ns | 0.1338 ns | 0.1252 ns | 6.8105 ns | 1.63 | 0.03 | -| | | | | | | | | -| ArraySetWithVar | 14 | 5.3945 ns | 0.0084 ns | 0.0065 ns | 5.3939 ns | 1.17 | 0.00 | -| ArraySetWithField | 14 | 4.6050 ns | 0.0163 ns | 0.0136 ns | 4.6079 ns | 1.00 | 0.00 | -| SpanSet | 14 | 7.4360 ns | 0.0431 ns | 0.0360 ns | 7.4488 ns | 1.61 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 15 | 6.0572 ns | 0.1460 ns | 0.2046 ns | 6.0832 ns | 1.25 | 0.04 | -| ArraySetWithField | 15 | 4.8496 ns | 0.0054 ns | 0.0042 ns | 4.8491 ns | 1.00 | 0.00 | -| SpanSet | 15 | 7.9418 ns | 0.0164 ns | 0.0137 ns | 7.9376 ns | 1.64 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 16 | 6.4385 ns | 0.1580 ns | 0.2412 ns | 6.3191 ns | 1.26 | 0.05 | -| ArraySetWithField | 16 | 5.1288 ns | 0.0365 ns | 0.0324 ns | 5.1361 ns | 1.00 | 0.00 | -| SpanSet | 16 | 8.8905 ns | 0.0499 ns | 0.0466 ns | 8.8896 ns | 1.73 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 17 | 6.6477 ns | 0.1621 ns | 0.1665 ns | 6.6454 ns | 1.23 | 0.04 | -| ArraySetWithField | 17 | 5.3947 ns | 0.1035 ns | 0.0864 ns | 5.3538 ns | 1.00 | 0.00 | -| SpanSet | 17 | 8.5048 ns | 0.0249 ns | 0.0221 ns | 8.5075 ns | 1.58 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 18 | 6.6377 ns | 0.1267 ns | 0.1244 ns | 6.5944 ns | 1.18 | 0.02 | -| ArraySetWithField | 18 | 5.6304 ns | 0.0105 ns | 0.0093 ns | 5.6274 ns | 1.00 | 0.00 | -| SpanSet | 18 | 8.9234 ns | 0.0360 ns | 0.0319 ns | 8.9253 ns | 1.58 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 19 | 7.0242 ns | 0.0154 ns | 0.0120 ns | 7.0265 ns | 1.16 | 0.00 | -| ArraySetWithField | 19 | 6.0558 ns | 0.0153 ns | 0.0136 ns | 6.0505 ns | 1.00 | 0.00 | -| SpanSet | 19 | 9.6918 ns | 0.0267 ns | 0.0249 ns | 9.6928 ns | 1.60 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 20 | 7.3951 ns | 0.1098 ns | 0.1027 ns | 7.3463 ns | 1.17 | 0.01 | -| ArraySetWithField | 20 | 6.3081 ns | 0.0147 ns | 0.0123 ns | 6.3062 ns | 1.00 | 0.00 | -| SpanSet | 20 | 10.3341 ns | 0.0067 ns | 0.0056 ns | 10.3315 ns | 1.64 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 30 | 9.7678 ns | 0.0492 ns | 0.0460 ns | 9.7524 ns | 1.06 | 0.01 | -| ArraySetWithField | 30 | 9.2401 ns | 0.0386 ns | 0.0342 ns | 9.2511 ns | 1.00 | 0.00 | -| SpanSet | 30 | 15.2144 ns | 0.0390 ns | 0.0345 ns | 15.2198 ns | 1.65 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 32 | 11.5139 ns | 0.2307 ns | 0.2158 ns | 11.3850 ns | 1.19 | 0.02 | -| ArraySetWithField | 32 | 9.7155 ns | 0.0127 ns | 0.0112 ns | 9.7123 ns | 1.00 | 0.00 | -| SpanSet | 32 | 16.0872 ns | 0.0204 ns | 0.0170 ns | 16.0871 ns | 1.66 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 40 | 12.2375 ns | 0.0264 ns | 0.0247 ns | 12.2253 ns | 1.01 | 0.00 | -| ArraySetWithField | 40 | 12.1236 ns | 0.0144 ns | 0.0134 ns | 12.1221 ns | 1.00 | 0.00 | -| SpanSet | 40 | 19.9416 ns | 0.0273 ns | 0.0255 ns | 19.9322 ns | 1.64 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 50 | 14.6316 ns | 0.0303 ns | 0.0268 ns | 14.6241 ns | 0.94 | 0.00 | -| ArraySetWithField | 50 | 15.5678 ns | 0.0862 ns | 0.0764 ns | 15.5547 ns | 1.00 | 0.00 | -| SpanSet | 50 | 24.7167 ns | 0.0153 ns | 0.0119 ns | 24.7160 ns | 1.59 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 60 | 17.0088 ns | 0.0186 ns | 0.0165 ns | 17.0064 ns | 0.92 | 0.01 | -| ArraySetWithField | 60 | 18.5370 ns | 0.1463 ns | 0.1368 ns | 18.5426 ns | 1.00 | 0.00 | -| SpanSet | 60 | 29.5779 ns | 0.1183 ns | 0.1107 ns | 29.6144 ns | 1.60 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 80 | 24.1961 ns | 0.1555 ns | 0.1455 ns | 24.1733 ns | 0.91 | 0.01 | -| ArraySetWithField | 80 | 26.4982 ns | 0.1534 ns | 0.1435 ns | 26.4651 ns | 1.00 | 0.00 | -| SpanSet | 80 | 40.4041 ns | 0.4015 ns | 0.3755 ns | 40.3401 ns | 1.52 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 90 | 24.2325 ns | 0.0650 ns | 0.0577 ns | 24.2251 ns | 0.72 | 0.01 | -| ArraySetWithField | 90 | 33.6785 ns | 0.2283 ns | 0.2136 ns | 33.7178 ns | 1.00 | 0.00 | -| SpanSet | 90 | 43.9471 ns | 0.1354 ns | 0.1057 ns | 43.9477 ns | 1.30 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 100 | 34.6069 ns | 0.3842 ns | 0.3593 ns | 34.7487 ns | 0.97 | 0.01 | -| ArraySetWithField | 100 | 35.5776 ns | 0.1210 ns | 0.1131 ns | 35.5837 ns | 1.00 | 0.00 | -| SpanSet | 100 | 53.7344 ns | 0.1538 ns | 0.1439 ns | 53.7185 ns | 1.51 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 128 | 41.4045 ns | 0.4361 ns | 0.4079 ns | 41.5116 ns | 0.95 | 0.01 | -| ArraySetWithField | 128 | 43.6934 ns | 0.1310 ns | 0.1162 ns | 43.6749 ns | 1.00 | 0.00 | -| SpanSet | 128 | 66.5672 ns | 0.1397 ns | 0.1238 ns | 66.5548 ns | 1.52 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 256 | 70.9427 ns | 0.4782 ns | 0.4473 ns | 71.0490 ns | 0.89 | 0.01 | -| ArraySetWithField | 256 | 80.0742 ns | 0.2967 ns | 0.2631 ns | 80.0270 ns | 1.00 | 0.00 | -| SpanSet | 256 | 127.5915 ns | 0.4899 ns | 0.4343 ns | 127.3657 ns | 1.59 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 512 | 132.1828 ns | 0.3919 ns | 0.3474 ns | 132.2670 ns | 0.86 | 0.00 | -| ArraySetWithField | 512 | 154.2140 ns | 0.3738 ns | 0.3497 ns | 154.2198 ns | 1.00 | 0.00 | -| SpanSet | 512 | 250.3647 ns | 0.5664 ns | 0.5021 ns | 250.0886 ns | 1.62 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 1024 | 256.1749 ns | 1.2610 ns | 1.1179 ns | 255.8400 ns | 0.84 | 0.00 | -| ArraySetWithField | 1024 | 303.9608 ns | 0.7641 ns | 0.7148 ns | 303.6921 ns | 1.00 | 0.00 | -| SpanSet | 1024 | 471.4042 ns | 0.9878 ns | 0.9240 ns | 471.5121 ns | 1.55 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 2048 | 501.2071 ns | 1.4541 ns | 1.2890 ns | 500.8381 ns | 0.83 | 0.00 | -| ArraySetWithField | 2048 | 600.8989 ns | 2.7570 ns | 2.4440 ns | 600.8161 ns | 1.00 | 0.00 | -| SpanSet | 2048 | 935.1442 ns | 1.5942 ns | 1.4912 ns | 934.6576 ns | 1.56 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 4096 | 996.5799 ns | 0.9021 ns | 0.7997 ns | 996.5021 ns | 0.83 | 0.00 | -| ArraySetWithField | 4096 | 1,201.1907 ns | 4.7698 ns | 4.4616 ns | 1,202.4870 ns | 1.00 | 0.00 | -| SpanSet | 4096 | 1,890.3773 ns | 6.1361 ns | 5.7397 ns | 1,890.7349 ns | 1.57 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 8192 | 1,987.9107 ns | 8.2600 ns | 6.8975 ns | 1,986.8454 ns | 0.83 | 0.00 | -| ArraySetWithField | 8192 | 2,399.1963 ns | 3.6931 ns | 2.8833 ns | 2,398.9801 ns | 1.00 | 0.00 | -| SpanSet | 8192 | 3,785.9897 ns | 21.6577 ns | 18.0852 ns | 3,782.0320 ns | 1.58 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 1000000 | 1,095,660.7117 ns | 21,714.0404 ns | 33,806.1449 ns | 1,083,141.5039 ns | 0.98 | 0.03 | -| ArraySetWithField | 1000000 | 1,111,976.3359 ns | 20,906.9048 ns | 27,910.1174 ns | 1,101,771.0938 ns | 1.00 | 0.00 | -| SpanSet | 1000000 | 1,114,171.4583 ns | 16,801.4894 ns | 15,716.1236 ns | 1,117,650.9766 ns | 1.00 | 0.04 | -| | | | | | | | | -| ArraySetWithVar | 2147483591 | 2,211,687,771.4286 ns | 16,208,703.4177 ns | 14,368,593.3923 ns | 2,215,022,850.0000 ns | 0.99 | 0.01 | -| ArraySetWithField | 2147483591 | 2,234,781,915.3846 ns | 14,747,844.4235 ns | 12,315,118.0269 ns | 2,232,597,000.0000 ns | 1.00 | 0.00 | -| SpanSet | 2147483591 | 2,256,799,913.3333 ns | 29,236,562.1000 ns | 27,347,898.3280 ns | 2,241,684,800.0000 ns | 1.01 | 0.02 | - -// * Warnings * -MultimodalDistribution - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> It seems that the distribution is bimodal (mValue = 3.78) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> It seems that the distribution is bimodal (mValue = 3.5) - -// * Hints * -Outliers - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were detected (2.93 ns, 2.96 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (1.81 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (2.01 ns, 2.05 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was detected (3.19 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (2.22 ns..2.28 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (2.49 ns, 2.49 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (3.06 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (3.82 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed, 4 outliers were detected (2.77 ns, 2.79 ns..2.82 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 3 outliers were detected (3.57 ns, 3.57 ns, 3.62 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 4 outliers were removed (4.57 ns..4.77 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed, 5 outliers were detected (3.23 ns..3.23 ns, 3.26 ns, 3.27 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (4.84 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.37 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (3.72 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed, 4 outliers were detected (4.92 ns, 4.99 ns..5.39 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (3.98 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed, 4 outliers were detected (5.15 ns, 5.17 ns, 5.24 ns, 5.25 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.47 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (5.63 ns, 5.69 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (4.62 ns, 4.67 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (7.12 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (5.46 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 3 outliers were removed, 5 outliers were detected (7.48 ns, 7.48 ns, 7.69 ns..8.06 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (6.94 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (5.71 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed (6.93 ns..7.40 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed, 3 outliers were detected (6.07 ns, 6.14 ns, 6.14 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed, 5 outliers were detected (8.86 ns..8.92 ns, 8.99 ns, 9.00 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (6.37 ns..6.42 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (9.52 ns, 9.60 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (6.92 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (7.52 ns, 7.56 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (9.95 ns, 10.07 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed (8.68 ns..8.91 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (7.16 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (10.35 ns, 10.52 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed (8.69 ns..8.92 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (7.64 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (11.12 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (7.96 ns, 7.97 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (11.87 ns, 11.88 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 3 outliers were detected (10.65 ns, 10.72 ns, 10.81 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (16.84 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (11.28 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed, 3 outliers were detected (17.55 ns, 17.65 ns, 17.65 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (16.20 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (18.37 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 3 outliers were removed (26.29 ns..26.37 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (18.58 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (27.68 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (26.02 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 3 outliers were removed (45.90 ns..45.93 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was detected (35.18 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (36.80 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was detected (41.98 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 2 outliers were detected (44.93 ns, 45.65 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (69.12 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (82.86 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (131.98 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (133.69 ns, 136.28 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (257.71 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (262.80 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (507.27 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 2 outliers were detected (598.19 ns, 612.01 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (1.00 us) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (1.19 us) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (2.04 us, 2.08 us) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (2.42 us..2.44 us) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (3.85 us, 3.94 us) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 4 outliers were removed (1.22 ms..1.35 ms) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were detected (1.08 ms, 1.08 ms) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (2.18 s, 2.26 s) SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (2.28 s, 2.28 s) - -// * Legends * - TestObjectCount : Value of the 'TestObjectCount' parameter - Mean : Arithmetic mean of all measurements - Error : Half of 99.9% confidence interval - StdDev : Standard deviation of all measurements - Median : Value separating the higher half of all measurements (50th percentile) - Ratio : Mean of the ratio distribution ([Current]/[Baseline]) - RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) - 1 ns : 1 Nanosecond (0.000000001 sec) - -************************************************************************************************************************************************* -************************************************************************************************************************************************* -************************************************************************************************************************************************* - -BenchmarkDotNet=v0.13.3, OS=ubuntu 20.04 -Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 4 logical and 2 physical cores -.NET SDK=7.0.203 - [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - - -| Method | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | -|------------------ |---------------- |------------------------:|----------------------:|----------------------:|------------------------:|------:|--------:| -| ArraySetWithVar | 1 | 1.6005 ns | 0.0025 ns | 0.0022 ns | 1.6007 ns | 4.61 | 0.03 | -| ArraySetWithField | 1 | 0.3466 ns | 0.0027 ns | 0.0025 ns | 0.3478 ns | 1.00 | 0.00 | -| SpanSet | 1 | 0.7008 ns | 0.0007 ns | 0.0006 ns | 0.7008 ns | 2.02 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 2 | 1.9617 ns | 0.0028 ns | 0.0026 ns | 1.9621 ns | 2.97 | 0.01 | -| ArraySetWithField | 2 | 0.6612 ns | 0.0016 ns | 0.0013 ns | 0.6610 ns | 1.00 | 0.00 | -| SpanSet | 2 | 0.9224 ns | 0.0009 ns | 0.0009 ns | 0.9223 ns | 1.40 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 3 | 3.9180 ns | 0.0178 ns | 0.0166 ns | 3.9195 ns | 3.07 | 0.02 | -| ArraySetWithField | 3 | 1.2773 ns | 0.0067 ns | 0.0056 ns | 1.2749 ns | 1.00 | 0.00 | -| SpanSet | 3 | 1.6728 ns | 0.0065 ns | 0.0060 ns | 1.6733 ns | 1.31 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 4 | 3.0629 ns | 0.0035 ns | 0.0032 ns | 3.0636 ns | 1.66 | 0.00 | -| ArraySetWithField | 4 | 1.8461 ns | 0.0032 ns | 0.0030 ns | 1.8457 ns | 1.00 | 0.00 | -| SpanSet | 4 | 2.2457 ns | 0.0045 ns | 0.0039 ns | 2.2458 ns | 1.22 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 5 | 3.9794 ns | 0.0025 ns | 0.0022 ns | 3.9800 ns | 1.32 | 0.05 | -| ArraySetWithField | 5 | 3.0059 ns | 0.0939 ns | 0.1153 ns | 3.0882 ns | 1.00 | 0.00 | -| SpanSet | 5 | 3.1000 ns | 0.0028 ns | 0.0023 ns | 3.0997 ns | 1.03 | 0.04 | -| | | | | | | | | -| ArraySetWithVar | 6 | 3.5894 ns | 0.0089 ns | 0.0079 ns | 3.5899 ns | 1.49 | 0.02 | -| ArraySetWithField | 6 | 2.4166 ns | 0.0354 ns | 0.0331 ns | 2.4147 ns | 1.00 | 0.00 | -| SpanSet | 6 | 2.7727 ns | 0.0181 ns | 0.0161 ns | 2.7759 ns | 1.15 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 7 | 3.8705 ns | 0.0090 ns | 0.0084 ns | 3.8673 ns | 1.16 | 0.00 | -| ArraySetWithField | 7 | 3.3283 ns | 0.0074 ns | 0.0069 ns | 3.3268 ns | 1.00 | 0.00 | -| SpanSet | 7 | 3.1766 ns | 0.0102 ns | 0.0085 ns | 3.1786 ns | 0.95 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 8 | 4.1455 ns | 0.0030 ns | 0.0028 ns | 4.1448 ns | 1.30 | 0.00 | -| ArraySetWithField | 8 | 3.1821 ns | 0.0027 ns | 0.0024 ns | 3.1821 ns | 1.00 | 0.00 | -| SpanSet | 8 | 3.6841 ns | 0.0079 ns | 0.0074 ns | 3.6839 ns | 1.16 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 9 | 4.4378 ns | 0.0022 ns | 0.0019 ns | 4.4377 ns | 1.14 | 0.00 | -| ArraySetWithField | 9 | 3.8759 ns | 0.0029 ns | 0.0027 ns | 3.8764 ns | 1.00 | 0.00 | -| SpanSet | 9 | 4.1472 ns | 0.0158 ns | 0.0147 ns | 4.1470 ns | 1.07 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 10 | 4.7189 ns | 0.0038 ns | 0.0032 ns | 4.7184 ns | 1.15 | 0.00 | -| ArraySetWithField | 10 | 4.1148 ns | 0.0029 ns | 0.0024 ns | 4.1144 ns | 1.00 | 0.00 | -| SpanSet | 10 | 4.4050 ns | 0.0279 ns | 0.0233 ns | 4.3943 ns | 1.07 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 11 | 5.0961 ns | 0.0074 ns | 0.0062 ns | 5.0969 ns | 1.03 | 0.00 | -| ArraySetWithField | 11 | 4.9518 ns | 0.0044 ns | 0.0039 ns | 4.9520 ns | 1.00 | 0.00 | -| SpanSet | 11 | 4.9052 ns | 0.0329 ns | 0.0275 ns | 4.8949 ns | 0.99 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 12 | 5.2174 ns | 0.0074 ns | 0.0066 ns | 5.2167 ns | 0.92 | 0.00 | -| ArraySetWithField | 12 | 5.6778 ns | 0.0081 ns | 0.0076 ns | 5.6778 ns | 1.00 | 0.00 | -| SpanSet | 12 | 5.4086 ns | 0.0486 ns | 0.0455 ns | 5.4007 ns | 0.95 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 13 | 5.6888 ns | 0.0095 ns | 0.0084 ns | 5.6875 ns | 0.94 | 0.00 | -| ArraySetWithField | 13 | 6.0615 ns | 0.0056 ns | 0.0049 ns | 6.0600 ns | 1.00 | 0.00 | -| SpanSet | 13 | 5.7281 ns | 0.0331 ns | 0.0309 ns | 5.7292 ns | 0.94 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 14 | 5.8935 ns | 0.0120 ns | 0.0106 ns | 5.8901 ns | 0.93 | 0.00 | -| ArraySetWithField | 14 | 6.3079 ns | 0.0156 ns | 0.0146 ns | 6.3124 ns | 1.00 | 0.00 | -| SpanSet | 14 | 6.0179 ns | 0.0182 ns | 0.0170 ns | 6.0210 ns | 0.95 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 15 | 6.6929 ns | 0.0119 ns | 0.0112 ns | 6.6895 ns | 1.00 | 0.00 | -| ArraySetWithField | 15 | 6.6939 ns | 0.0056 ns | 0.0050 ns | 6.6924 ns | 1.00 | 0.00 | -| SpanSet | 15 | 6.5041 ns | 0.0192 ns | 0.0170 ns | 6.5039 ns | 0.97 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 16 | 6.9466 ns | 0.0123 ns | 0.0115 ns | 6.9451 ns | 0.99 | 0.00 | -| ArraySetWithField | 16 | 6.9918 ns | 0.0161 ns | 0.0126 ns | 6.9904 ns | 1.00 | 0.00 | -| SpanSet | 16 | 6.8335 ns | 0.0129 ns | 0.0115 ns | 6.8350 ns | 0.98 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 17 | 7.8803 ns | 0.1539 ns | 0.1364 ns | 7.8157 ns | 1.07 | 0.02 | -| ArraySetWithField | 17 | 7.3937 ns | 0.0072 ns | 0.0067 ns | 7.3923 ns | 1.00 | 0.00 | -| SpanSet | 17 | 7.3889 ns | 0.0295 ns | 0.0276 ns | 7.3834 ns | 1.00 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 18 | 8.0929 ns | 0.0084 ns | 0.0070 ns | 8.0907 ns | 1.04 | 0.00 | -| ArraySetWithField | 18 | 7.8115 ns | 0.0064 ns | 0.0057 ns | 7.8126 ns | 1.00 | 0.00 | -| SpanSet | 18 | 7.8917 ns | 0.1759 ns | 0.1646 ns | 7.8150 ns | 1.01 | 0.02 | -| | | | | | | | | -| ArraySetWithVar | 19 | 8.5985 ns | 0.0268 ns | 0.0237 ns | 8.5871 ns | 1.05 | 0.02 | -| ArraySetWithField | 19 | 8.2165 ns | 0.1507 ns | 0.1410 ns | 8.1337 ns | 1.00 | 0.00 | -| SpanSet | 19 | 8.4661 ns | 0.2031 ns | 0.2494 ns | 8.3056 ns | 1.04 | 0.03 | -| | | | | | | | | -| ArraySetWithVar | 20 | 8.8796 ns | 0.0080 ns | 0.0075 ns | 8.8776 ns | 1.03 | 0.01 | -| ArraySetWithField | 20 | 8.6620 ns | 0.0694 ns | 0.0615 ns | 8.6587 ns | 1.00 | 0.00 | -| SpanSet | 20 | 8.5786 ns | 0.0131 ns | 0.0123 ns | 8.5786 ns | 0.99 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 30 | 12.2340 ns | 0.0405 ns | 0.0359 ns | 12.2361 ns | 0.93 | 0.00 | -| ArraySetWithField | 30 | 13.0996 ns | 0.0613 ns | 0.0543 ns | 13.1167 ns | 1.00 | 0.00 | -| SpanSet | 30 | 12.9861 ns | 0.0075 ns | 0.0070 ns | 12.9860 ns | 0.99 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 32 | 13.0265 ns | 0.0452 ns | 0.0423 ns | 13.0312 ns | 0.81 | 0.01 | -| ArraySetWithField | 32 | 16.0182 ns | 0.1015 ns | 0.0949 ns | 15.9814 ns | 1.00 | 0.00 | -| SpanSet | 32 | 13.9318 ns | 0.0134 ns | 0.0126 ns | 13.9300 ns | 0.87 | 0.01 | -| | | | | | | | | -| ArraySetWithVar | 40 | 15.9772 ns | 0.0802 ns | 0.0750 ns | 15.9619 ns | 0.81 | 0.00 | -| ArraySetWithField | 40 | 19.8427 ns | 0.0528 ns | 0.0494 ns | 19.8337 ns | 1.00 | 0.00 | -| SpanSet | 40 | 18.5625 ns | 0.0147 ns | 0.0138 ns | 18.5616 ns | 0.94 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 50 | 19.0897 ns | 0.0472 ns | 0.0442 ns | 19.1012 ns | 0.80 | 0.00 | -| ArraySetWithField | 50 | 23.8520 ns | 0.0708 ns | 0.0662 ns | 23.8558 ns | 1.00 | 0.00 | -| SpanSet | 50 | 23.5046 ns | 0.0227 ns | 0.0201 ns | 23.4986 ns | 0.99 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 60 | 23.4799 ns | 0.1172 ns | 0.1096 ns | 23.4780 ns | 0.87 | 0.00 | -| ArraySetWithField | 60 | 26.8609 ns | 0.0311 ns | 0.0243 ns | 26.8626 ns | 1.00 | 0.00 | -| SpanSet | 60 | 29.1054 ns | 0.0204 ns | 0.0181 ns | 29.1026 ns | 1.08 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 80 | 50.2605 ns | 0.1258 ns | 0.1115 ns | 50.2455 ns | 1.07 | 0.00 | -| ArraySetWithField | 80 | 46.8658 ns | 0.0728 ns | 0.0645 ns | 46.8692 ns | 1.00 | 0.00 | -| SpanSet | 80 | 51.4484 ns | 0.0914 ns | 0.0855 ns | 51.4708 ns | 1.10 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 90 | 36.7051 ns | 0.1824 ns | 0.1706 ns | 36.7614 ns | 0.92 | 0.00 | -| ArraySetWithField | 90 | 39.6823 ns | 0.0930 ns | 0.0870 ns | 39.6612 ns | 1.00 | 0.00 | -| SpanSet | 90 | 43.4244 ns | 0.0195 ns | 0.0182 ns | 43.4271 ns | 1.09 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 100 | 51.3160 ns | 0.0568 ns | 0.0504 ns | 51.3058 ns | 1.00 | 0.00 | -| ArraySetWithField | 100 | 51.3570 ns | 0.0377 ns | 0.0353 ns | 51.3562 ns | 1.00 | 0.00 | -| SpanSet | 100 | 57.7251 ns | 0.0708 ns | 0.0662 ns | 57.7026 ns | 1.12 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 128 | 61.5201 ns | 0.0489 ns | 0.0434 ns | 61.5210 ns | 0.97 | 0.00 | -| ArraySetWithField | 128 | 63.5051 ns | 0.0859 ns | 0.0804 ns | 63.5097 ns | 1.00 | 0.00 | -| SpanSet | 128 | 71.3592 ns | 0.1269 ns | 0.1187 ns | 71.3527 ns | 1.12 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 256 | 105.8192 ns | 0.0383 ns | 0.0358 ns | 105.8335 ns | 0.88 | 0.00 | -| ArraySetWithField | 256 | 119.9394 ns | 0.0760 ns | 0.0711 ns | 119.9179 ns | 1.00 | 0.00 | -| SpanSet | 256 | 135.2443 ns | 0.1709 ns | 0.1599 ns | 135.2831 ns | 1.13 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 512 | 210.0185 ns | 0.1510 ns | 0.1339 ns | 209.9837 ns | 0.90 | 0.00 | -| ArraySetWithField | 512 | 233.1248 ns | 0.0516 ns | 0.0431 ns | 233.1158 ns | 1.00 | 0.00 | -| SpanSet | 512 | 263.0390 ns | 0.1591 ns | 0.1410 ns | 263.0316 ns | 1.13 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 1024 | 417.8774 ns | 0.2947 ns | 0.2613 ns | 417.9022 ns | 0.91 | 0.00 | -| ArraySetWithField | 1024 | 460.3398 ns | 0.1941 ns | 0.1516 ns | 460.3139 ns | 1.00 | 0.00 | -| SpanSet | 1024 | 518.9574 ns | 0.3053 ns | 0.2706 ns | 518.8852 ns | 1.13 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 2048 | 835.0463 ns | 0.5355 ns | 0.4747 ns | 835.1100 ns | 0.91 | 0.00 | -| ArraySetWithField | 2048 | 915.4347 ns | 0.6474 ns | 0.5406 ns | 915.4247 ns | 1.00 | 0.00 | -| SpanSet | 2048 | 1,031.4134 ns | 0.7092 ns | 0.6634 ns | 1,031.5475 ns | 1.13 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 4096 | 1,711.6639 ns | 0.6226 ns | 0.5824 ns | 1,711.7812 ns | 0.94 | 0.00 | -| ArraySetWithField | 4096 | 1,830.3076 ns | 0.4474 ns | 0.3966 ns | 1,830.2355 ns | 1.00 | 0.00 | -| SpanSet | 4096 | 2,061.5471 ns | 1.6995 ns | 1.5066 ns | 2,061.7563 ns | 1.13 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 8192 | 3,414.7095 ns | 1.2613 ns | 1.1798 ns | 3,414.6534 ns | 0.94 | 0.00 | -| ArraySetWithField | 8192 | 3,645.9164 ns | 1.4002 ns | 1.3097 ns | 3,645.9304 ns | 1.00 | 0.00 | -| SpanSet | 8192 | 4,107.2606 ns | 3.4648 ns | 3.2409 ns | 4,107.4933 ns | 1.13 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 1000000 | 420,702.1225 ns | 255.2887 ns | 226.3068 ns | 420,727.8545 ns | 0.95 | 0.00 | -| ArraySetWithField | 1000000 | 444,452.6199 ns | 402.2439 ns | 356.5787 ns | 444,416.0256 ns | 1.00 | 0.00 | -| SpanSet | 1000000 | 500,024.9671 ns | 1,037.9277 ns | 970.8782 ns | 500,189.8135 ns | 1.12 | 0.00 | -| | | | | | | | | -| ArraySetWithVar | 2147483591 | 238,492,391,914.8000 ns | 4,592,687,023.3708 ns | 4,296,002,291.1676 ns | 239,458,354,055.0000 ns | 0.97 | 0.03 | -| ArraySetWithField | 2147483591 | 244,774,507,284.3333 ns | 4,025,896,310.4222 ns | 3,765,825,906.6134 ns | 246,203,799,599.0000 ns | 1.00 | 0.00 | -| SpanSet | 2147483591 | 225,900,352,939.8750 ns | 4,408,307,941.2510 ns | 5,732,045,514.6553 ns | 224,187,746,770.5000 ns | 0.92 | 0.03 | - -// * Hints * -Outliers - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (3.48 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (2.57 ns, 2.57 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (2.53 ns, 2.53 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (3.17 ns, 3.22 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (4.13 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.87 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (4.97 ns, 4.98 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.48 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were detected (4.20 ns, 4.23 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (4.76 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (5.06 ns, 5.08 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (5.10 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (6.31 ns, 6.32 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (6.60 ns, 6.60 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (5.99 ns, 6.00 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (6.41 ns, 6.45 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (6.95 ns, 6.98 ns, 6.98 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (6.83 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (7.06 ns, 7.20 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (7.11 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (7.58 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (7.97 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (7.80 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (8.60 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (8.42 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (8.94 ns..9.13 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (8.74 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (10.15 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (9.99 ns, 10.00 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (9.70 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (10.55 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (10.72 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (14.22 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 4 outliers were detected (14.86 ns..14.89 ns, 15.08 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (25.53 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (25.45 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (28.86 ns..28.99 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (31.04 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (52.93 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (48.99 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (53.44 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (53.14 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (64.12 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (212.83 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (235.92 ns, 237.35 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (265.18 ns, 265.83 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (421.48 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (463.76 ns..469.66 ns) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (522.77 ns) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (836.49 ns, 839.38 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (919.44 ns, 941.01 ns) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (1.84 us) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (2.07 us) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (4.10 us) - SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (420.17 us, 421.17 us) - SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (445.30 us) - SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (243.93 s) - -// * Legends * - TestObjectCount : Value of the 'TestObjectCount' parameter - Mean : Arithmetic mean of all measurements - Error : Half of 99.9% confidence interval - StdDev : Standard deviation of all measurements - Median : Value separating the higher half of all measurements (50th percentile) - Ratio : Mean of the ratio distribution ([Current]/[Baseline]) - RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) - 1 ns : 1 Nanosecond (0.000000001 sec) +Docker Desktop - Windows Host + +| Method | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | +|------------------ |---------------- |--------------------:|------------------:|------------------:|------:|--------:| +| ArrayGetWithVar | 1 | 1.5515 ns | 0.0611 ns | 0.0542 ns | 5.78 | 0.63 | +| ArrayGetWithField | 1 | 0.2697 ns | 0.0287 ns | 0.0268 ns | 1.00 | 0.00 | +| SpanGet | 1 | 0.5019 ns | 0.0117 ns | 0.0098 ns | 1.88 | 0.20 | +| | | | | | | | +| ArrayGetWithVar | 2 | 1.7411 ns | 0.0135 ns | 0.0113 ns | 2.78 | 0.09 | +| ArrayGetWithField | 2 | 0.6258 ns | 0.0215 ns | 0.0191 ns | 1.00 | 0.00 | +| SpanGet | 2 | 0.7584 ns | 0.0172 ns | 0.0161 ns | 1.21 | 0.04 | +| | | | | | | | +| ArrayGetWithVar | 3 | 2.0160 ns | 0.0264 ns | 0.0247 ns | 2.19 | 0.07 | +| ArrayGetWithField | 3 | 0.9226 ns | 0.0309 ns | 0.0258 ns | 1.00 | 0.00 | +| SpanGet | 3 | 1.0568 ns | 0.0240 ns | 0.0213 ns | 1.15 | 0.04 | +| | | | | | | | +| ArrayGetWithVar | 4 | 2.2360 ns | 0.0200 ns | 0.0167 ns | 1.89 | 0.07 | +| ArrayGetWithField | 4 | 1.1815 ns | 0.0457 ns | 0.0427 ns | 1.00 | 0.00 | +| SpanGet | 4 | 1.2586 ns | 0.0343 ns | 0.0321 ns | 1.07 | 0.05 | +| | | | | | | | +| ArrayGetWithVar | 5 | 2.5662 ns | 0.0591 ns | 0.0523 ns | 1.45 | 0.06 | +| ArrayGetWithField | 5 | 1.7752 ns | 0.0663 ns | 0.0554 ns | 1.00 | 0.00 | +| SpanGet | 5 | 2.3339 ns | 0.0548 ns | 0.0512 ns | 1.31 | 0.04 | +| | | | | | | | +| ArrayGetWithVar | 6 | 2.9409 ns | 0.0605 ns | 0.0566 ns | 1.46 | 0.03 | +| ArrayGetWithField | 6 | 2.0072 ns | 0.0225 ns | 0.0188 ns | 1.00 | 0.00 | +| SpanGet | 6 | 2.5796 ns | 0.0595 ns | 0.0557 ns | 1.28 | 0.03 | +| | | | | | | | +| ArrayGetWithVar | 7 | 3.2910 ns | 0.0638 ns | 0.0596 ns | 1.27 | 0.05 | +| ArrayGetWithField | 7 | 2.6211 ns | 0.0830 ns | 0.0923 ns | 1.00 | 0.00 | +| SpanGet | 7 | 3.0480 ns | 0.0499 ns | 0.0416 ns | 1.18 | 0.05 | +| | | | | | | | +| ArrayGetWithVar | 8 | 3.6615 ns | 0.1036 ns | 0.1348 ns | 1.34 | 0.05 | +| ArrayGetWithField | 8 | 2.7175 ns | 0.0753 ns | 0.0668 ns | 1.00 | 0.00 | +| SpanGet | 8 | 3.2317 ns | 0.0873 ns | 0.0681 ns | 1.19 | 0.03 | +| | | | | | | | +| ArrayGetWithVar | 9 | 4.1159 ns | 0.1028 ns | 0.0912 ns | 1.39 | 0.06 | +| ArrayGetWithField | 9 | 2.9648 ns | 0.0797 ns | 0.0707 ns | 1.00 | 0.00 | +| SpanGet | 9 | 3.4643 ns | 0.0946 ns | 0.0838 ns | 1.17 | 0.04 | +| | | | | | | | +| ArrayGetWithVar | 10 | 4.5874 ns | 0.1178 ns | 0.1210 ns | 1.38 | 0.06 | +| ArrayGetWithField | 10 | 3.3250 ns | 0.0664 ns | 0.0588 ns | 1.00 | 0.00 | +| SpanGet | 10 | 3.6339 ns | 0.0678 ns | 0.0601 ns | 1.09 | 0.02 | +| | | | | | | | +| ArrayGetWithVar | 11 | 5.0294 ns | 0.0905 ns | 0.0803 ns | 1.41 | 0.04 | +| ArrayGetWithField | 11 | 3.5648 ns | 0.0933 ns | 0.0872 ns | 1.00 | 0.00 | +| SpanGet | 11 | 4.0259 ns | 0.1108 ns | 0.1319 ns | 1.13 | 0.05 | +| | | | | | | | +| ArrayGetWithVar | 12 | 5.2701 ns | 0.1157 ns | 0.1025 ns | 1.42 | 0.04 | +| ArrayGetWithField | 12 | 3.7002 ns | 0.0957 ns | 0.0848 ns | 1.00 | 0.00 | +| SpanGet | 12 | 4.3132 ns | 0.1102 ns | 0.0977 ns | 1.17 | 0.04 | +| | | | | | | | +| ArrayGetWithVar | 13 | 5.7393 ns | 0.1438 ns | 0.1345 ns | 1.41 | 0.03 | +| ArrayGetWithField | 13 | 4.0569 ns | 0.1034 ns | 0.0863 ns | 1.00 | 0.00 | +| SpanGet | 13 | 4.4506 ns | 0.0812 ns | 0.0720 ns | 1.10 | 0.03 | +| | | | | | | | +| ArrayGetWithVar | 14 | 6.0965 ns | 0.1023 ns | 0.0854 ns | 1.40 | 0.03 | +| ArrayGetWithField | 14 | 4.3728 ns | 0.0803 ns | 0.0751 ns | 1.00 | 0.00 | +| SpanGet | 14 | 4.6293 ns | 0.1178 ns | 0.2124 ns | 1.09 | 0.06 | +| | | | | | | | +| ArrayGetWithVar | 15 | 7.0026 ns | 0.1261 ns | 0.1053 ns | 1.42 | 0.02 | +| ArrayGetWithField | 15 | 4.9188 ns | 0.0506 ns | 0.0422 ns | 1.00 | 0.00 | +| SpanGet | 15 | 5.1823 ns | 0.1318 ns | 0.1233 ns | 1.05 | 0.03 | +| | | | | | | | +| ArrayGetWithVar | 16 | 8.3418 ns | 0.1920 ns | 0.1702 ns | 1.51 | 0.04 | +| ArrayGetWithField | 16 | 5.5086 ns | 0.1068 ns | 0.0947 ns | 1.00 | 0.00 | +| SpanGet | 16 | 5.4778 ns | 0.1416 ns | 0.2246 ns | 1.02 | 0.03 | +| | | | | | | | +| ArrayGetWithVar | 17 | 8.1520 ns | 0.0699 ns | 0.0620 ns | 1.69 | 0.01 | +| ArrayGetWithField | 17 | 4.8123 ns | 0.0442 ns | 0.0369 ns | 1.00 | 0.00 | +| SpanGet | 17 | 5.5824 ns | 0.0741 ns | 0.0693 ns | 1.16 | 0.02 | +| | | | | | | | +| ArrayGetWithVar | 18 | 7.4813 ns | 0.0414 ns | 0.0367 ns | 1.42 | 0.01 | +| ArrayGetWithField | 18 | 5.2566 ns | 0.0312 ns | 0.0260 ns | 1.00 | 0.00 | +| SpanGet | 18 | 5.9601 ns | 0.0816 ns | 0.0763 ns | 1.13 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 19 | 7.7273 ns | 0.0835 ns | 0.0781 ns | 1.49 | 0.02 | +| ArrayGetWithField | 19 | 5.2033 ns | 0.0313 ns | 0.0261 ns | 1.00 | 0.00 | +| SpanGet | 19 | 6.3312 ns | 0.1551 ns | 0.1593 ns | 1.22 | 0.03 | +| | | | | | | | +| ArrayGetWithVar | 20 | 7.9391 ns | 0.0515 ns | 0.0457 ns | 1.37 | 0.03 | +| ArrayGetWithField | 20 | 5.8071 ns | 0.1415 ns | 0.1390 ns | 1.00 | 0.00 | +| SpanGet | 20 | 5.9330 ns | 0.0500 ns | 0.0443 ns | 1.02 | 0.02 | +| | | | | | | | +| ArrayGetWithVar | 30 | 10.6019 ns | 0.1303 ns | 0.1219 ns | 1.29 | 0.02 | +| ArrayGetWithField | 30 | 8.2413 ns | 0.1019 ns | 0.0851 ns | 1.00 | 0.00 | +| SpanGet | 30 | 8.4137 ns | 0.1042 ns | 0.0924 ns | 1.02 | 0.02 | +| | | | | | | | +| ArrayGetWithVar | 32 | 11.0617 ns | 0.1536 ns | 0.1362 ns | 1.27 | 0.02 | +| ArrayGetWithField | 32 | 8.6916 ns | 0.1022 ns | 0.0906 ns | 1.00 | 0.00 | +| SpanGet | 32 | 8.8803 ns | 0.0642 ns | 0.0536 ns | 1.02 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 40 | 12.8859 ns | 0.0889 ns | 0.0742 ns | 1.21 | 0.01 | +| ArrayGetWithField | 40 | 10.6318 ns | 0.0740 ns | 0.0618 ns | 1.00 | 0.00 | +| SpanGet | 40 | 10.8128 ns | 0.0622 ns | 0.0519 ns | 1.02 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 50 | 15.2773 ns | 0.1358 ns | 0.1204 ns | 1.17 | 0.01 | +| ArrayGetWithField | 50 | 13.0385 ns | 0.0772 ns | 0.0603 ns | 1.00 | 0.00 | +| SpanGet | 50 | 13.2485 ns | 0.0861 ns | 0.0719 ns | 1.02 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 60 | 19.4536 ns | 0.3026 ns | 0.2682 ns | 1.25 | 0.02 | +| ArrayGetWithField | 60 | 15.5407 ns | 0.1195 ns | 0.0998 ns | 1.00 | 0.00 | +| SpanGet | 60 | 15.7285 ns | 0.0886 ns | 0.0740 ns | 1.01 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 80 | 23.6613 ns | 0.3427 ns | 0.3206 ns | 0.95 | 0.01 | +| ArrayGetWithField | 80 | 24.9804 ns | 0.1885 ns | 0.1671 ns | 1.00 | 0.00 | +| SpanGet | 80 | 20.7933 ns | 0.2044 ns | 0.1912 ns | 0.83 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 90 | 25.2124 ns | 0.2229 ns | 0.1976 ns | 1.09 | 0.01 | +| ArrayGetWithField | 90 | 23.0452 ns | 0.1873 ns | 0.1660 ns | 1.00 | 0.00 | +| SpanGet | 90 | 23.1852 ns | 0.1221 ns | 0.1142 ns | 1.01 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 100 | 38.4832 ns | 0.3491 ns | 0.3094 ns | 1.23 | 0.02 | +| ArrayGetWithField | 100 | 31.3061 ns | 0.2504 ns | 0.2220 ns | 1.00 | 0.00 | +| SpanGet | 100 | 31.1156 ns | 0.3401 ns | 0.3015 ns | 0.99 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 128 | 45.1141 ns | 0.2042 ns | 0.1594 ns | 1.18 | 0.01 | +| ArrayGetWithField | 128 | 38.3883 ns | 0.3717 ns | 0.3477 ns | 1.00 | 0.00 | +| SpanGet | 128 | 37.9068 ns | 0.2695 ns | 0.2250 ns | 0.99 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 256 | 77.4174 ns | 0.6796 ns | 0.6024 ns | 1.12 | 0.01 | +| ArrayGetWithField | 256 | 68.8870 ns | 0.4120 ns | 0.3441 ns | 1.00 | 0.00 | +| SpanGet | 256 | 68.4291 ns | 0.4472 ns | 0.4183 ns | 0.99 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 512 | 139.0822 ns | 1.1336 ns | 1.0049 ns | 1.06 | 0.01 | +| ArrayGetWithField | 512 | 131.7129 ns | 0.8504 ns | 0.7101 ns | 1.00 | 0.00 | +| SpanGet | 512 | 131.8641 ns | 0.9284 ns | 0.8684 ns | 1.00 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 1024 | 266.5707 ns | 4.5696 ns | 5.4397 ns | 1.04 | 0.02 | +| ArrayGetWithField | 1024 | 257.5734 ns | 1.2839 ns | 1.1382 ns | 1.00 | 0.00 | +| SpanGet | 1024 | 256.7122 ns | 1.0711 ns | 0.9495 ns | 1.00 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 2048 | 511.6425 ns | 1.5722 ns | 1.3129 ns | 1.00 | 0.01 | +| ArrayGetWithField | 2048 | 509.8994 ns | 2.5392 ns | 2.2509 ns | 1.00 | 0.00 | +| SpanGet | 2048 | 507.5335 ns | 4.0426 ns | 3.3758 ns | 1.00 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 4096 | 1,019.1013 ns | 10.1205 ns | 9.4668 ns | 1.00 | 0.01 | +| ArrayGetWithField | 4096 | 1,018.5594 ns | 4.6897 ns | 4.1573 ns | 1.00 | 0.00 | +| SpanGet | 4096 | 1,012.1960 ns | 7.4658 ns | 6.6183 ns | 0.99 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 8192 | 2,017.1872 ns | 14.3314 ns | 12.7044 ns | 1.00 | 0.01 | +| ArrayGetWithField | 8192 | 2,023.1594 ns | 12.9330 ns | 11.4648 ns | 1.00 | 0.00 | +| SpanGet | 8192 | 2,014.0275 ns | 14.3402 ns | 12.7123 ns | 1.00 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 1000000 | 245,965.8295 ns | 1,733.9504 ns | 1,447.9271 ns | 1.00 | 0.01 | +| ArrayGetWithField | 1000000 | 245,337.9044 ns | 1,055.8869 ns | 881.7134 ns | 1.00 | 0.00 | +| SpanGet | 1000000 | 245,687.0731 ns | 1,561.6594 ns | 1,219.2409 ns | 1.00 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 2147483591 | 525,684,023.0769 ns | 3,207,250.2244 ns | 2,678,199.1945 ns | 0.99 | 0.01 | +| ArrayGetWithField | 2147483591 | 529,688,963.4615 ns | 3,381,258.2043 ns | 2,823,503.7386 ns | 1.00 | 0.00 | +| SpanGet | 2147483591 | 529,698,631.2857 ns | 4,050,107.8977 ns | 3,590,315.1583 ns | 1.00 | 0.01 | + +// * Warnings * +MultimodalDistribution + SpanVsArrayBenchmarks.SpanGet: Default -> It seems that the distribution is bimodal (mValue = 3.54) + +// * Hints * +Outliers + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (3.23 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was detected (1.78 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (2.12 ns, 2.14 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (3.33 ns, 3.35 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.26 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (2.59 ns, 2.62 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 2 outliers were detected (2.57 ns, 2.65 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (3.86 ns, 3.91 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (4.31 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (3.58 ns..4.00 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (3.71 ns, 3.73 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (4.94 ns, 4.98 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (5.00 ns, 5.79 ns, 5.85 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.62 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (5.22 ns..5.28 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (6.25 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.91 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (5.41 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (6.96 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (5.20 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (5.55 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (7.00 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.16 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (7.55 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (5.25 ns, 5.66 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.38 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 4 outliers were removed (6.16 ns..6.78 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.37 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (8.13 ns, 8.29 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 6 outliers were removed (7.09 ns..7.33 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (8.48 ns, 9.28 ns, 9.33 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.81 ns, 6.84 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (10.70 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (7.53 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (8.13 ns..8.25 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (10.23 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.56 ns, 6.56 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.33 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.89 ns, 7.03 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (6.89 ns, 7.00 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.66 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (8.03 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (10.35 ns, 10.41 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (10.22 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (12.95 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (10.60 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (10.67 ns, 10.75 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (14.69 ns, 14.85 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (12.44 ns, 12.66 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (12.61 ns, 12.77 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (17.56 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (14.97 ns..14.98 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (15.18 ns, 15.61 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (22.40 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (17.54 ns, 18.13 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (17.74 ns, 17.99 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (26.15 ns, 27.17 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (27.26 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (25.32 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (41.56 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (33.96 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (33.76 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (47.36 ns..47.54 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (40.60 ns, 40.85 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (81.64 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (72.86 ns, 73.52 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (139.97 ns, 145.75 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (137.07 ns, 138.83 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (286.19 ns, 314.20 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (267.48 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (265.60 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (522.93 ns, 540.60 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (508.42 ns, 525.02 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (525.76 ns, 527.95 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 3 outliers were detected (1.01 us, 1.01 us, 1.07 us) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (1.07 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (2.08 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.10 us) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (2.12 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (256.02 us, 256.31 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (250.53 us, 250.70 us) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (252.66 us..282.22 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 4 outliers were detected (519.00 ms, 522.14 ms, 531.86 ms, 536.31 ms) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (544.93 ms, 551.49 ms) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (557.67 ms) + +// * Legends * + TestObjectCount : Value of the 'TestObjectCount' parameter + Mean : Arithmetic mean of all measurements + Error : Half of 99.9% confidence interval + StdDev : Standard deviation of all measurements + Ratio : Mean of the ratio distribution ([Current]/[Baseline]) + RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) + 1 ns : 1 Nanosecond (0.000000001 sec) + +************************************************************************************************************************************************* +************************************************************************************************************************************************* +************************************************************************************************************************************************* + +BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.1555) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.203 + [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + + +| Method | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | +|------------------ |---------------- |--------------------:|----------------:|----------------:|--------------------:|------:|--------:| +| ArrayGetWithVar | 1 | 1.4115 ns | 0.0127 ns | 0.0119 ns | 1.4133 ns | 6.74 | 0.18 | +| ArrayGetWithField | 1 | 0.2095 ns | 0.0051 ns | 0.0045 ns | 0.2107 ns | 1.00 | 0.00 | +| SpanGet | 1 | 0.2636 ns | 0.0024 ns | 0.0021 ns | 0.2632 ns | 1.26 | 0.03 | +| | | | | | | | | +| ArrayGetWithVar | 2 | 1.7398 ns | 0.0122 ns | 0.0114 ns | 1.7406 ns | 2.84 | 0.14 | +| ArrayGetWithField | 2 | 0.6150 ns | 0.0407 ns | 0.0318 ns | 0.6095 ns | 1.00 | 0.00 | +| SpanGet | 2 | 0.4950 ns | 0.0079 ns | 0.0066 ns | 0.4981 ns | 0.81 | 0.05 | +| | | | | | | | | +| ArrayGetWithVar | 3 | 2.2776 ns | 0.0778 ns | 0.2294 ns | 2.4503 ns | 2.21 | 0.25 | +| ArrayGetWithField | 3 | 1.0145 ns | 0.0439 ns | 0.0410 ns | 1.0062 ns | 1.00 | 0.00 | +| SpanGet | 3 | 0.7529 ns | 0.0250 ns | 0.0234 ns | 0.7476 ns | 0.74 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 4 | 2.2875 ns | 0.0630 ns | 0.0559 ns | 2.2669 ns | 2.27 | 0.06 | +| ArrayGetWithField | 4 | 1.0066 ns | 0.0164 ns | 0.0153 ns | 1.0050 ns | 1.00 | 0.00 | +| SpanGet | 4 | 0.9895 ns | 0.0123 ns | 0.0115 ns | 0.9922 ns | 0.98 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 5 | 2.6949 ns | 0.0633 ns | 0.0592 ns | 2.6701 ns | 1.42 | 0.16 | +| ArrayGetWithField | 5 | 1.9059 ns | 0.0682 ns | 0.1868 ns | 1.8684 ns | 1.00 | 0.00 | +| SpanGet | 5 | 1.5092 ns | 0.0392 ns | 0.0348 ns | 1.5102 ns | 0.79 | 0.09 | +| | | | | | | | | +| ArrayGetWithVar | 6 | 3.1465 ns | 0.0931 ns | 0.1143 ns | 3.0808 ns | 1.69 | 0.06 | +| ArrayGetWithField | 6 | 1.8594 ns | 0.0124 ns | 0.0116 ns | 1.8588 ns | 1.00 | 0.00 | +| SpanGet | 6 | 2.0726 ns | 0.0716 ns | 0.0879 ns | 2.0578 ns | 1.11 | 0.05 | +| | | | | | | | | +| ArrayGetWithVar | 7 | 3.2474 ns | 0.0525 ns | 0.0410 ns | 3.2404 ns | 1.51 | 0.02 | +| ArrayGetWithField | 7 | 2.1444 ns | 0.0223 ns | 0.0198 ns | 2.1434 ns | 1.00 | 0.00 | +| SpanGet | 7 | 2.3791 ns | 0.0572 ns | 0.0535 ns | 2.3924 ns | 1.11 | 0.03 | +| | | | | | | | | +| ArrayGetWithVar | 8 | 3.6571 ns | 0.1017 ns | 0.2055 ns | 3.5399 ns | 1.51 | 0.07 | +| ArrayGetWithField | 8 | 2.3724 ns | 0.0196 ns | 0.0174 ns | 2.3738 ns | 1.00 | 0.00 | +| SpanGet | 8 | 2.6088 ns | 0.0644 ns | 0.0602 ns | 2.6322 ns | 1.10 | 0.03 | +| | | | | | | | | +| ArrayGetWithVar | 9 | 3.8172 ns | 0.0061 ns | 0.0057 ns | 3.8155 ns | 1.46 | 0.02 | +| ArrayGetWithField | 9 | 2.6231 ns | 0.0313 ns | 0.0293 ns | 2.6143 ns | 1.00 | 0.00 | +| SpanGet | 9 | 2.9815 ns | 0.0446 ns | 0.0372 ns | 2.9849 ns | 1.14 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 10 | 4.3250 ns | 0.1161 ns | 0.2237 ns | 4.1797 ns | 1.36 | 0.07 | +| ArrayGetWithField | 10 | 3.1594 ns | 0.0278 ns | 0.0246 ns | 3.1674 ns | 1.00 | 0.00 | +| SpanGet | 10 | 2.9200 ns | 0.0834 ns | 0.0780 ns | 2.9040 ns | 0.92 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 11 | 4.8931 ns | 0.1262 ns | 0.2308 ns | 4.9847 ns | 1.44 | 0.09 | +| ArrayGetWithField | 11 | 3.3435 ns | 0.0487 ns | 0.0432 ns | 3.3299 ns | 1.00 | 0.00 | +| SpanGet | 11 | 3.3408 ns | 0.0429 ns | 0.0380 ns | 3.3398 ns | 1.00 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 12 | 5.2640 ns | 0.1334 ns | 0.2077 ns | 5.3314 ns | 1.59 | 0.06 | +| ArrayGetWithField | 12 | 3.2920 ns | 0.0112 ns | 0.0093 ns | 3.2942 ns | 1.00 | 0.00 | +| SpanGet | 12 | 3.5210 ns | 0.0979 ns | 0.0916 ns | 3.4896 ns | 1.07 | 0.03 | +| | | | | | | | | +| ArrayGetWithVar | 13 | 5.3287 ns | 0.0715 ns | 0.0669 ns | 5.3427 ns | 1.34 | 0.02 | +| ArrayGetWithField | 13 | 3.9872 ns | 0.0499 ns | 0.0467 ns | 3.9771 ns | 1.00 | 0.00 | +| SpanGet | 13 | 4.0250 ns | 0.0803 ns | 0.0751 ns | 4.0180 ns | 1.01 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 14 | 5.5447 ns | 0.1082 ns | 0.0845 ns | 5.5129 ns | 1.35 | 0.03 | +| ArrayGetWithField | 14 | 4.1072 ns | 0.0352 ns | 0.0329 ns | 4.1011 ns | 1.00 | 0.00 | +| SpanGet | 14 | 4.3101 ns | 0.1149 ns | 0.2042 ns | 4.4471 ns | 1.05 | 0.06 | +| | | | | | | | | +| ArrayGetWithVar | 15 | 5.9592 ns | 0.1007 ns | 0.0942 ns | 5.9521 ns | 1.38 | 0.02 | +| ArrayGetWithField | 15 | 4.3303 ns | 0.0146 ns | 0.0137 ns | 4.3332 ns | 1.00 | 0.00 | +| SpanGet | 15 | 4.5349 ns | 0.0952 ns | 0.0795 ns | 4.5473 ns | 1.05 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 16 | 6.2242 ns | 0.1520 ns | 0.2081 ns | 6.1473 ns | 1.30 | 0.05 | +| ArrayGetWithField | 16 | 4.8017 ns | 0.0312 ns | 0.0292 ns | 4.8077 ns | 1.00 | 0.00 | +| SpanGet | 16 | 4.6087 ns | 0.1206 ns | 0.1128 ns | 4.5630 ns | 0.96 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 17 | 6.5752 ns | 0.1582 ns | 0.2057 ns | 6.5724 ns | 1.44 | 0.05 | +| ArrayGetWithField | 17 | 4.5792 ns | 0.0274 ns | 0.0243 ns | 4.5754 ns | 1.00 | 0.00 | +| SpanGet | 17 | 5.1442 ns | 0.0570 ns | 0.0533 ns | 5.1497 ns | 1.12 | 0.01 | +| | | | | | | | | +| ArrayGetWithVar | 18 | 6.6317 ns | 0.1327 ns | 0.1108 ns | 6.5870 ns | 1.17 | 0.02 | +| ArrayGetWithField | 18 | 5.6728 ns | 0.0296 ns | 0.0277 ns | 5.6707 ns | 1.00 | 0.00 | +| SpanGet | 18 | 4.9786 ns | 0.0787 ns | 0.0736 ns | 4.9597 ns | 0.88 | 0.02 | +| | | | | | | | | +| ArrayGetWithVar | 19 | 6.9428 ns | 0.0477 ns | 0.0398 ns | 6.9283 ns | 1.33 | 0.01 | +| ArrayGetWithField | 19 | 5.2353 ns | 0.0249 ns | 0.0221 ns | 5.2269 ns | 1.00 | 0.00 | +| SpanGet | 19 | 5.2300 ns | 0.0300 ns | 0.0266 ns | 5.2179 ns | 1.00 | 0.01 | +| | | | | | | | | +| ArrayGetWithVar | 20 | 7.4626 ns | 0.0782 ns | 0.0653 ns | 7.4410 ns | 1.28 | 0.04 | +| ArrayGetWithField | 20 | 5.7347 ns | 0.1435 ns | 0.1815 ns | 5.6633 ns | 1.00 | 0.00 | +| SpanGet | 20 | 5.4807 ns | 0.0085 ns | 0.0075 ns | 5.4807 ns | 0.94 | 0.03 | +| | | | | | | | | +| ArrayGetWithVar | 30 | 10.4216 ns | 0.2361 ns | 0.2986 ns | 10.4605 ns | 1.31 | 0.04 | +| ArrayGetWithField | 30 | 7.9253 ns | 0.0101 ns | 0.0089 ns | 7.9231 ns | 1.00 | 0.00 | +| SpanGet | 30 | 7.8815 ns | 0.0056 ns | 0.0046 ns | 7.8799 ns | 0.99 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 32 | 10.9016 ns | 0.2460 ns | 0.2928 ns | 10.9234 ns | 1.20 | 0.04 | +| ArrayGetWithField | 32 | 9.0887 ns | 0.1490 ns | 0.1393 ns | 9.0872 ns | 1.00 | 0.00 | +| SpanGet | 32 | 8.3599 ns | 0.0023 ns | 0.0018 ns | 8.3594 ns | 0.92 | 0.01 | +| | | | | | | | | +| ArrayGetWithVar | 40 | 12.1384 ns | 0.0332 ns | 0.0259 ns | 12.1259 ns | 1.18 | 0.00 | +| ArrayGetWithField | 40 | 10.2890 ns | 0.0161 ns | 0.0142 ns | 10.2858 ns | 1.00 | 0.00 | +| SpanGet | 40 | 10.2771 ns | 0.0087 ns | 0.0082 ns | 10.2725 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 50 | 14.5209 ns | 0.0094 ns | 0.0074 ns | 14.5204 ns | 1.14 | 0.00 | +| ArrayGetWithField | 50 | 12.7090 ns | 0.0251 ns | 0.0235 ns | 12.7142 ns | 1.00 | 0.00 | +| SpanGet | 50 | 12.6737 ns | 0.0104 ns | 0.0082 ns | 12.6719 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 60 | 16.9274 ns | 0.0157 ns | 0.0131 ns | 16.9289 ns | 1.12 | 0.00 | +| ArrayGetWithField | 60 | 15.0932 ns | 0.0385 ns | 0.0341 ns | 15.0869 ns | 1.00 | 0.00 | +| SpanGet | 60 | 15.0897 ns | 0.0438 ns | 0.0409 ns | 15.0743 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 80 | 22.2228 ns | 0.1792 ns | 0.1676 ns | 22.1639 ns | 1.07 | 0.01 | +| ArrayGetWithField | 80 | 20.8031 ns | 0.1991 ns | 0.1863 ns | 20.8343 ns | 1.00 | 0.00 | +| SpanGet | 80 | 20.2242 ns | 0.1555 ns | 0.1378 ns | 20.2300 ns | 0.97 | 0.01 | +| | | | | | | | | +| ArrayGetWithVar | 90 | 24.1033 ns | 0.0211 ns | 0.0176 ns | 24.0949 ns | 1.08 | 0.00 | +| ArrayGetWithField | 90 | 22.2535 ns | 0.0180 ns | 0.0160 ns | 22.2475 ns | 1.00 | 0.00 | +| SpanGet | 90 | 22.2278 ns | 0.0063 ns | 0.0052 ns | 22.2260 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 100 | 35.7519 ns | 0.1380 ns | 0.1291 ns | 35.7208 ns | 1.18 | 0.00 | +| ArrayGetWithField | 100 | 30.3591 ns | 0.0262 ns | 0.0219 ns | 30.3633 ns | 1.00 | 0.00 | +| SpanGet | 100 | 30.1375 ns | 0.0272 ns | 0.0241 ns | 30.1293 ns | 0.99 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 128 | 42.4070 ns | 0.0753 ns | 0.0668 ns | 42.3966 ns | 1.15 | 0.00 | +| ArrayGetWithField | 128 | 37.0188 ns | 0.0491 ns | 0.0436 ns | 37.0096 ns | 1.00 | 0.00 | +| SpanGet | 128 | 36.9420 ns | 0.1566 ns | 0.1465 ns | 36.8590 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 256 | 72.3880 ns | 0.5299 ns | 0.4957 ns | 72.2868 ns | 1.08 | 0.01 | +| ArrayGetWithField | 256 | 67.2595 ns | 0.1700 ns | 0.1590 ns | 67.1937 ns | 1.00 | 0.00 | +| SpanGet | 256 | 66.5708 ns | 0.1292 ns | 0.1145 ns | 66.5350 ns | 0.99 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 512 | 133.9119 ns | 0.3940 ns | 0.3290 ns | 133.9845 ns | 1.05 | 0.00 | +| ArrayGetWithField | 512 | 127.9565 ns | 0.1367 ns | 0.1141 ns | 127.9270 ns | 1.00 | 0.00 | +| SpanGet | 512 | 127.7372 ns | 0.1064 ns | 0.0943 ns | 127.7265 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 1024 | 255.4683 ns | 0.7553 ns | 0.6695 ns | 255.1568 ns | 1.02 | 0.00 | +| ArrayGetWithField | 1024 | 250.5938 ns | 0.2526 ns | 0.2239 ns | 250.5821 ns | 1.00 | 0.00 | +| SpanGet | 1024 | 250.7683 ns | 0.6080 ns | 0.5687 ns | 250.6417 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 2048 | 500.8917 ns | 1.0776 ns | 1.0080 ns | 500.4943 ns | 1.01 | 0.00 | +| ArrayGetWithField | 2048 | 495.4565 ns | 0.3916 ns | 0.3270 ns | 495.4714 ns | 1.00 | 0.00 | +| SpanGet | 2048 | 495.2572 ns | 0.4029 ns | 0.3364 ns | 495.2063 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 4096 | 992.1368 ns | 2.8754 ns | 2.6897 ns | 990.8590 ns | 1.01 | 0.00 | +| ArrayGetWithField | 4096 | 986.0712 ns | 0.8923 ns | 0.7910 ns | 985.8429 ns | 1.00 | 0.00 | +| SpanGet | 4096 | 984.9568 ns | 0.4072 ns | 0.3610 ns | 985.0019 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 8192 | 1,968.7538 ns | 0.2638 ns | 0.2060 ns | 1,968.7178 ns | 1.00 | 0.00 | +| ArrayGetWithField | 8192 | 1,966.1739 ns | 2.8904 ns | 2.5623 ns | 1,964.7451 ns | 1.00 | 0.00 | +| SpanGet | 8192 | 1,967.1070 ns | 5.1706 ns | 4.8366 ns | 1,964.2349 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 1000000 | 239,186.3037 ns | 31.2120 ns | 26.0634 ns | 239,181.6895 ns | 1.00 | 0.00 | +| ArrayGetWithField | 1000000 | 239,251.0824 ns | 190.1186 ns | 177.8370 ns | 239,231.1279 ns | 1.00 | 0.00 | +| SpanGet | 1000000 | 239,076.0725 ns | 42.7034 ns | 37.8555 ns | 239,069.7632 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArrayGetWithVar | 2147483591 | 513,362,891.6667 ns | 51,845.5735 ns | 40,477.6135 ns | 513,367,700.0000 ns | 1.00 | 0.00 | +| ArrayGetWithField | 2147483591 | 513,708,415.3846 ns | 214,407.5874 ns | 179,040.0460 ns | 513,678,800.0000 ns | 1.00 | 0.00 | +| SpanGet | 2147483591 | 513,460,507.1429 ns | 68,937.1375 ns | 61,110.9768 ns | 513,482,050.0000 ns | 1.00 | 0.00 | + +// * Warnings * +MultimodalDistribution + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> It seems that the distribution is bimodal (mValue = 3.76) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> It seems that the distribution can have several modes (mValue = 3.11) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> It seems that the distribution can have several modes (mValue = 3) + SpanVsArrayBenchmarks.SpanGet: Default -> It seems that the distribution is bimodal (mValue = 3.7) + +// * Hints * +Outliers + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were detected (2.89 ns, 2.89 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (1.70 ns, 1.72 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (1.78 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was detected (3.22 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (2.30 ns..2.31 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (1.99 ns, 2.03 ns, 2.03 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (4.22 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were detected (2.49 ns, 2.49 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (3.18 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (5.32 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (5.54 ns..5.70 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (3.71 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was detected (3.69 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (3.84 ns, 3.94 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was detected (3.93 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (4.61 ns, 4.66 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.74 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (5.13 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (4.99 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed, 3 outliers were detected (4.78 ns, 4.82 ns, 4.83 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was detected (6.67 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (7.60 ns..7.80 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (5.80 ns, 6.25 ns, 6.30 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.06 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (6.20 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (8.53 ns, 8.53 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (8.60 ns, 8.88 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (6.83 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (6.86 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (9.40 ns, 9.72 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (7.04 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 4 outliers were detected (11.40 ns..11.44 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (9.46 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (9.41 ns, 9.45 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were detected (11.72 ns, 11.76 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was detected (10.28 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (9.87 ns..9.93 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (16.07 ns..16.45 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (11.86 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (16.06 ns..16.08 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (14.23 ns..14.41 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (18.48 ns, 18.50 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (16.73 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (22.24 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (25.69 ns, 25.74 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (23.83 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (23.77 ns, 23.80 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (31.96 ns, 32.11 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (31.75 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (44.17 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (39.06 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (69.39 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 4 outliers were detected (135.67 ns, 135.69 ns, 137.00 ns, 137.67 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (132.07 ns, 132.46 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (130.78 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (259.74 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 3 outliers were detected (252.78 ns, 252.79 ns, 253.80 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (500.68 ns, 502.22 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (500.38 ns, 500.51 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (991.97 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 3 outliers were detected (986.70 ns, 986.75 ns, 991.81 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (1.97 us..1.98 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (1.98 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (239.28 us, 239.68 us) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (240.97 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (513.53 ms..514.07 ms) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (515.12 ms, 515.88 ms) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 2 outliers were detected (513.32 ms, 513.60 ms) + +// * Legends * + TestObjectCount : Value of the 'TestObjectCount' parameter + Mean : Arithmetic mean of all measurements + Error : Half of 99.9% confidence interval + StdDev : Standard deviation of all measurements + Median : Value separating the higher half of all measurements (50th percentile) + Ratio : Mean of the ratio distribution ([Current]/[Baseline]) + RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) + 1 ns : 1 Nanosecond (0.000000001 sec)BenchmarkDotNet=v0.13.3, OS=ubuntu 20.04 + +************************************************************************************************************************************************* +************************************************************************************************************************************************* +************************************************************************************************************************************************* + +Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 4 l +ogical and 2 physical cores +.NET SDK=7.0.203 + [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + + +| Method | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | +|------------------ |---------------- |--------------------:|------------------:|------------------:|------:|--------:| +| ArrayGetWithVar | 1 | 1.7144 ns | 0.0035 ns | 0.0033 ns | 4.97 | 0.01 | +| ArrayGetWithField | 1 | 0.3450 ns | 0.0009 ns | 0.0008 ns | 1.00 | 0.00 | +| SpanGet | 1 | 0.3670 ns | 0.0007 ns | 0.0007 ns | 1.06 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 2 | 1.7904 ns | 0.0007 ns | 0.0006 ns | 4.58 | 0.01 | +| ArrayGetWithField | 2 | 0.3912 ns | 0.0010 ns | 0.0009 ns | 1.00 | 0.00 | +| SpanGet | 2 | 0.6750 ns | 0.0021 ns | 0.0018 ns | 1.73 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 3 | 2.4049 ns | 0.0006 ns | 0.0005 ns | 2.50 | 0.00 | +| ArrayGetWithField | 3 | 0.9626 ns | 0.0018 ns | 0.0015 ns | 1.00 | 0.00 | +| SpanGet | 3 | 1.5743 ns | 0.0010 ns | 0.0008 ns | 1.64 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 4 | 2.9208 ns | 0.0017 ns | 0.0013 ns | 1.94 | 0.00 | +| ArrayGetWithField | 4 | 1.5076 ns | 0.0024 ns | 0.0021 ns | 1.00 | 0.00 | +| SpanGet | 4 | 1.9629 ns | 0.0027 ns | 0.0024 ns | 1.30 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 5 | 3.9197 ns | 0.0028 ns | 0.0025 ns | 1.57 | 0.00 | +| ArrayGetWithField | 5 | 2.4945 ns | 0.0048 ns | 0.0042 ns | 1.00 | 0.00 | +| SpanGet | 5 | 2.7509 ns | 0.0344 ns | 0.0322 ns | 1.10 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 6 | 3.5986 ns | 0.0261 ns | 0.0232 ns | 1.72 | 0.02 | +| ArrayGetWithField | 6 | 2.0963 ns | 0.0163 ns | 0.0152 ns | 1.00 | 0.00 | +| SpanGet | 6 | 3.0419 ns | 0.0818 ns | 0.0765 ns | 1.45 | 0.04 | +| | | | | | | | +| ArrayGetWithVar | 7 | 3.9044 ns | 0.0373 ns | 0.0349 ns | 1.64 | 0.02 | +| ArrayGetWithField | 7 | 2.3830 ns | 0.0172 ns | 0.0161 ns | 1.00 | 0.00 | +| SpanGet | 7 | 3.7281 ns | 0.0007 ns | 0.0006 ns | 1.57 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 8 | 4.1182 ns | 0.0017 ns | 0.0015 ns | 1.50 | 0.00 | +| ArrayGetWithField | 8 | 2.7423 ns | 0.0008 ns | 0.0007 ns | 1.00 | 0.00 | +| SpanGet | 8 | 3.9225 ns | 0.0006 ns | 0.0005 ns | 1.43 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 9 | 4.3981 ns | 0.0023 ns | 0.0018 ns | 1.53 | 0.00 | +| ArrayGetWithField | 9 | 2.8798 ns | 0.0008 ns | 0.0007 ns | 1.00 | 0.00 | +| SpanGet | 9 | 4.2915 ns | 0.0005 ns | 0.0005 ns | 1.49 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 10 | 4.6168 ns | 0.0045 ns | 0.0042 ns | 1.40 | 0.00 | +| ArrayGetWithField | 10 | 3.3040 ns | 0.0007 ns | 0.0006 ns | 1.00 | 0.00 | +| SpanGet | 10 | 4.3824 ns | 0.0087 ns | 0.0082 ns | 1.33 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 11 | 5.0594 ns | 0.0063 ns | 0.0049 ns | 1.35 | 0.00 | +| ArrayGetWithField | 11 | 3.7469 ns | 0.0008 ns | 0.0006 ns | 1.00 | 0.00 | +| SpanGet | 11 | 4.7152 ns | 0.0148 ns | 0.0138 ns | 1.26 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 12 | 5.1340 ns | 0.0012 ns | 0.0010 ns | 1.26 | 0.00 | +| ArrayGetWithField | 12 | 4.0666 ns | 0.0080 ns | 0.0071 ns | 1.00 | 0.00 | +| SpanGet | 12 | 5.0472 ns | 0.0073 ns | 0.0069 ns | 1.24 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 13 | 5.6316 ns | 0.0015 ns | 0.0012 ns | 1.28 | 0.01 | +| ArrayGetWithField | 13 | 4.3903 ns | 0.0249 ns | 0.0221 ns | 1.00 | 0.00 | +| SpanGet | 13 | 5.3302 ns | 0.0088 ns | 0.0078 ns | 1.21 | 0.01 | +| | | | | | | | +| ArrayGetWithVar | 14 | 5.8691 ns | 0.0060 ns | 0.0056 ns | 1.22 | 0.00 | +| ArrayGetWithField | 14 | 4.7932 ns | 0.0059 ns | 0.0056 ns | 1.00 | 0.00 | +| SpanGet | 14 | 5.6502 ns | 0.0179 ns | 0.0158 ns | 1.18 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 15 | 6.6377 ns | 0.0028 ns | 0.0022 ns | 1.27 | 0.00 | +| ArrayGetWithField | 15 | 5.2252 ns | 0.0014 ns | 0.0013 ns | 1.00 | 0.00 | +| SpanGet | 15 | 5.9511 ns | 0.0158 ns | 0.0148 ns | 1.14 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 16 | 6.8981 ns | 0.0119 ns | 0.0112 ns | 1.24 | 0.00 | +| ArrayGetWithField | 16 | 5.5505 ns | 0.0114 ns | 0.0106 ns | 1.00 | 0.00 | +| SpanGet | 16 | 6.2346 ns | 0.0200 ns | 0.0177 ns | 1.12 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 17 | 7.7612 ns | 0.0088 ns | 0.0078 ns | 1.33 | 0.00 | +| ArrayGetWithField | 17 | 5.8474 ns | 0.0084 ns | 0.0078 ns | 1.00 | 0.00 | +| SpanGet | 17 | 6.5241 ns | 0.0204 ns | 0.0191 ns | 1.12 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 18 | 8.0601 ns | 0.0168 ns | 0.0149 ns | 1.24 | 0.02 | +| ArrayGetWithField | 18 | 6.4858 ns | 0.1023 ns | 0.0957 ns | 1.00 | 0.00 | +| SpanGet | 18 | 6.8394 ns | 0.0342 ns | 0.0320 ns | 1.05 | 0.02 | +| | | | | | | | +| ArrayGetWithVar | 19 | 8.5406 ns | 0.0016 ns | 0.0013 ns | 1.27 | 0.00 | +| ArrayGetWithField | 19 | 6.7132 ns | 0.0154 ns | 0.0128 ns | 1.00 | 0.00 | +| SpanGet | 19 | 7.1487 ns | 0.0293 ns | 0.0274 ns | 1.06 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 20 | 8.8478 ns | 0.0129 ns | 0.0121 ns | 1.26 | 0.00 | +| ArrayGetWithField | 20 | 7.0262 ns | 0.0066 ns | 0.0058 ns | 1.00 | 0.00 | +| SpanGet | 20 | 7.4524 ns | 0.0215 ns | 0.0190 ns | 1.06 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 30 | 12.6107 ns | 0.0573 ns | 0.0536 ns | 1.18 | 0.01 | +| ArrayGetWithField | 30 | 10.7281 ns | 0.0160 ns | 0.0150 ns | 1.00 | 0.00 | +| SpanGet | 30 | 10.5565 ns | 0.0429 ns | 0.0380 ns | 0.98 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 32 | 13.2197 ns | 0.0958 ns | 0.0896 ns | 1.15 | 0.01 | +| ArrayGetWithField | 32 | 11.5303 ns | 0.0275 ns | 0.0244 ns | 1.00 | 0.00 | +| SpanGet | 32 | 11.7189 ns | 0.0331 ns | 0.0309 ns | 1.02 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 40 | 17.1164 ns | 0.0674 ns | 0.0598 ns | 1.04 | 0.00 | +| ArrayGetWithField | 40 | 16.4160 ns | 0.0464 ns | 0.0434 ns | 1.00 | 0.00 | +| SpanGet | 40 | 14.8238 ns | 0.0468 ns | 0.0438 ns | 0.90 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 50 | 18.5728 ns | 0.0593 ns | 0.0554 ns | 1.02 | 0.00 | +| ArrayGetWithField | 50 | 18.1323 ns | 0.0233 ns | 0.0218 ns | 1.00 | 0.00 | +| SpanGet | 50 | 18.3620 ns | 0.0352 ns | 0.0312 ns | 1.01 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 60 | 27.7889 ns | 0.0589 ns | 0.0551 ns | 1.08 | 0.00 | +| ArrayGetWithField | 60 | 25.7314 ns | 0.0342 ns | 0.0320 ns | 1.00 | 0.00 | +| SpanGet | 60 | 19.3356 ns | 0.0274 ns | 0.0243 ns | 0.75 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 80 | 50.0414 ns | 0.3840 ns | 0.3592 ns | 1.16 | 0.01 | +| ArrayGetWithField | 80 | 43.3203 ns | 0.0732 ns | 0.0685 ns | 1.00 | 0.00 | +| SpanGet | 80 | 46.2991 ns | 0.1615 ns | 0.1348 ns | 1.07 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 90 | 30.3271 ns | 0.0299 ns | 0.0250 ns | 0.92 | 0.00 | +| ArrayGetWithField | 90 | 32.9228 ns | 0.0448 ns | 0.0397 ns | 1.00 | 0.00 | +| SpanGet | 90 | 30.1212 ns | 0.0279 ns | 0.0247 ns | 0.91 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 100 | 50.9207 ns | 0.0524 ns | 0.0438 ns | 1.15 | 0.00 | +| ArrayGetWithField | 100 | 44.3034 ns | 0.0203 ns | 0.0169 ns | 1.00 | 0.00 | +| SpanGet | 100 | 48.1193 ns | 0.0569 ns | 0.0533 ns | 1.09 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 128 | 63.5936 ns | 0.0735 ns | 0.0687 ns | 1.17 | 0.00 | +| ArrayGetWithField | 128 | 54.3614 ns | 0.0326 ns | 0.0305 ns | 1.00 | 0.00 | +| SpanGet | 128 | 59.9921 ns | 0.0440 ns | 0.0390 ns | 1.10 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 256 | 101.1193 ns | 0.0666 ns | 0.0556 ns | 1.00 | 0.00 | +| ArrayGetWithField | 256 | 101.0048 ns | 0.0942 ns | 0.0835 ns | 1.00 | 0.00 | +| SpanGet | 256 | 97.7434 ns | 0.0330 ns | 0.0257 ns | 0.97 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 512 | 176.4697 ns | 0.0506 ns | 0.0473 ns | 0.90 | 0.00 | +| ArrayGetWithField | 512 | 195.4723 ns | 0.0439 ns | 0.0389 ns | 1.00 | 0.00 | +| SpanGet | 512 | 173.3604 ns | 0.0621 ns | 0.0551 ns | 0.89 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 1024 | 327.4840 ns | 0.0646 ns | 0.0540 ns | 0.85 | 0.00 | +| ArrayGetWithField | 1024 | 385.4179 ns | 0.4587 ns | 0.4066 ns | 1.00 | 0.00 | +| SpanGet | 1024 | 324.5606 ns | 0.4749 ns | 0.4210 ns | 0.84 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 2048 | 630.3876 ns | 0.4305 ns | 0.4027 ns | 0.82 | 0.00 | +| ArrayGetWithField | 2048 | 764.5638 ns | 1.1467 ns | 1.0726 ns | 1.00 | 0.00 | +| SpanGet | 2048 | 627.6572 ns | 0.7236 ns | 0.6768 ns | 0.82 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 4096 | 1,234.8919 ns | 0.1193 ns | 0.0996 ns | 0.81 | 0.00 | +| ArrayGetWithField | 4096 | 1,520.9689 ns | 0.7341 ns | 0.6508 ns | 1.00 | 0.00 | +| SpanGet | 4096 | 1,232.3784 ns | 0.6339 ns | 0.5293 ns | 0.81 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 8192 | 2,444.7565 ns | 0.4708 ns | 0.3931 ns | 0.81 | 0.00 | +| ArrayGetWithField | 8192 | 3,032.8116 ns | 0.4344 ns | 0.3391 ns | 1.00 | 0.00 | +| SpanGet | 8192 | 2,442.6178 ns | 0.5773 ns | 0.4821 ns | 0.81 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 1000000 | 295,415.8654 ns | 48.2387 ns | 42.7623 ns | 0.80 | 0.00 | +| ArrayGetWithField | 1000000 | 369,338.8544 ns | 163.6322 ns | 136.6403 ns | 1.00 | 0.00 | +| SpanGet | 1000000 | 295,432.4293 ns | 186.8233 ns | 145.8593 ns | 0.80 | 0.00 | +| | | | | | | | +| ArrayGetWithVar | 2147483591 | 635,510,534.2000 ns | 1,123,953.3384 ns | 1,051,346.6501 ns | 0.80 | 0.00 | +| ArrayGetWithField | 2147483591 | 792,820,286.0714 ns | 158,248.9330 ns | 140,283.5572 ns | 1.00 | 0.00 | +| SpanGet | 2147483591 | 634,263,796.3077 ns | 73,366.8521 ns | 61,264.6443 ns | 0.80 | 0.00 | + +// * Hints * +Outliers + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.25 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (3.68 ns, 3.69 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (2.26 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (2.55 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (4.29 ns, 4.29 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed, 3 outliers were detected (2.82 ns, 2.83 ns, 2.83 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (3.44 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (4.82 ns..4.83 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (3.38 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (3.84 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (5.80 ns, 5.91 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.38 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (5.54 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (5.61 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (6.02 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (4.61 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (5.79 ns, 5.79 ns, 5.79 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (6.29 ns..6.29 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (4.75 ns, 4.77 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (6.16 ns, 6.17 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (5.18 ns, 5.18 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (6.99 ns..8.17 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (5.62 ns, 5.62 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (7.02 ns, 7.02 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (5.96 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (7.75 ns..7.99 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (6.43 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (7.22 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (7.56 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (8.53 ns..8.54 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (8.17 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.68 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (9.99 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 3 outliers were removed (10.44 ns..10.44 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (8.62 ns, 8.93 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (8.93 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (9.38 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 2 outliers were detected (12.35 ns, 12.51 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (13.46 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed (19.70 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed, 4 outliers were detected (20.15 ns..20.19 ns, 20.29 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (21.29 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was detected (44.96 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed, 3 outliers were detected (47.84 ns, 48.47 ns, 48.59 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (32.39 ns, 32.48 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (34.93 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (32.13 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (52.69 ns, 52.92 ns, 52.93 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (46.28 ns, 46.29 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (63.12 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (103.46 ns, 103.46 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (103.80 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (100.34 ns..100.90 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (202.86 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (176.24 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (330.17 ns, 330.82 ns) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (394.09 ns) + SpanVsArrayBenchmarks.SpanGet: Default -> 1 outlier was removed (328.45 ns) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (1.24 us, 1.24 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed, 2 outliers were detected (1.52 us, 1.53 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 2 outliers were removed (2.45 us, 2.45 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 3 outliers were removed (3.04 us..3.04 us) + SpanVsArrayBenchmarks.ArrayGetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (295.35 us, 295.66 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 2 outliers were removed (369.92 us, 370.16 us) + SpanVsArrayBenchmarks.SpanGet: Default -> 3 outliers were removed (296.57 us..306.32 us) + SpanVsArrayBenchmarks.ArrayGetWithField: Default -> 1 outlier was removed (793.21 ms) + SpanVsArrayBenchmarks.SpanGet: Default -> 2 outliers were removed (634.57 ms, 634.59 ms) + +// * Legends * + TestObjectCount : Value of the 'TestObjectCount' parameter + Mean : Arithmetic mean of all measurements + Error : Half of 99.9% confidence interval + StdDev : Standard deviation of all measurements + Ratio : Mean of the ratio distribution ([Current]/[Baseline]) + RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) + 1 ns : 1 Nanosecond (0.000000001 sec) + +************************************************************************************************************************************************* +************************************************************************************************************************************************* +************************************************************************************************************************************************* + + BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.1555) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.203 + [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + + +| Method | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | +|------------------ |---------------- |----------------------:|-------------------:|-------------------:|----------------------:|------:|--------:| +| ArraySetWithVar | 1 | 1.4697 ns | 0.0243 ns | 0.0227 ns | 1.4777 ns | 4.29 | 0.29 | +| ArraySetWithField | 1 | 0.3436 ns | 0.0225 ns | 0.0210 ns | 0.3492 ns | 1.00 | 0.00 | +| SpanSet | 1 | 0.5153 ns | 0.0077 ns | 0.0069 ns | 0.5159 ns | 1.50 | 0.09 | +| | | | | | | | | +| ArraySetWithVar | 2 | 1.7058 ns | 0.0124 ns | 0.0116 ns | 1.7081 ns | 2.44 | 0.02 | +| ArraySetWithField | 2 | 0.7001 ns | 0.0017 ns | 0.0013 ns | 0.7000 ns | 1.00 | 0.00 | +| SpanSet | 2 | 1.1681 ns | 0.0445 ns | 0.0417 ns | 1.1618 ns | 1.68 | 0.07 | +| | | | | | | | | +| ArraySetWithVar | 3 | 2.1158 ns | 0.0724 ns | 0.1589 ns | 2.1493 ns | 2.18 | 0.16 | +| ArraySetWithField | 3 | 0.9698 ns | 0.0024 ns | 0.0020 ns | 0.9697 ns | 1.00 | 0.00 | +| SpanSet | 3 | 1.5822 ns | 0.0164 ns | 0.0153 ns | 1.5835 ns | 1.63 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 4 | 2.2945 ns | 0.0055 ns | 0.0049 ns | 2.2936 ns | 1.80 | 0.00 | +| ArraySetWithField | 4 | 1.2779 ns | 0.0038 ns | 0.0029 ns | 1.2779 ns | 1.00 | 0.00 | +| SpanSet | 4 | 2.0907 ns | 0.0125 ns | 0.0111 ns | 2.0963 ns | 1.64 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 5 | 2.7734 ns | 0.0494 ns | 0.0507 ns | 2.7562 ns | 1.60 | 0.03 | +| ArraySetWithField | 5 | 1.7355 ns | 0.0096 ns | 0.0080 ns | 1.7390 ns | 1.00 | 0.00 | +| SpanSet | 5 | 2.8583 ns | 0.0867 ns | 0.1586 ns | 2.7817 ns | 1.65 | 0.10 | +| | | | | | | | | +| ArraySetWithVar | 6 | 3.8121 ns | 0.0173 ns | 0.0154 ns | 3.8119 ns | 1.82 | 0.02 | +| ArraySetWithField | 6 | 2.0951 ns | 0.0165 ns | 0.0146 ns | 2.0946 ns | 1.00 | 0.00 | +| SpanSet | 6 | 3.3108 ns | 0.0354 ns | 0.0331 ns | 3.3259 ns | 1.58 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 7 | 3.4567 ns | 0.0165 ns | 0.0129 ns | 3.4596 ns | 1.41 | 0.01 | +| ArraySetWithField | 7 | 2.4506 ns | 0.0052 ns | 0.0046 ns | 2.4511 ns | 1.00 | 0.00 | +| SpanSet | 7 | 3.6886 ns | 0.0219 ns | 0.0183 ns | 3.6959 ns | 1.51 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 8 | 3.8263 ns | 0.0097 ns | 0.0086 ns | 3.8244 ns | 1.40 | 0.01 | +| ArraySetWithField | 8 | 2.7420 ns | 0.0113 ns | 0.0106 ns | 2.7401 ns | 1.00 | 0.00 | +| SpanSet | 8 | 4.3303 ns | 0.0419 ns | 0.0392 ns | 4.3372 ns | 1.58 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 9 | 4.0671 ns | 0.0144 ns | 0.0120 ns | 4.0669 ns | 1.32 | 0.00 | +| ArraySetWithField | 9 | 3.0772 ns | 0.0066 ns | 0.0055 ns | 3.0759 ns | 1.00 | 0.00 | +| SpanSet | 9 | 4.7950 ns | 0.0458 ns | 0.0429 ns | 4.7805 ns | 1.56 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 10 | 5.0931 ns | 0.0349 ns | 0.0326 ns | 5.1000 ns | 1.41 | 0.02 | +| ArraySetWithField | 10 | 3.6005 ns | 0.0558 ns | 0.0522 ns | 3.6177 ns | 1.00 | 0.00 | +| SpanSet | 10 | 5.3014 ns | 0.1238 ns | 0.1158 ns | 5.2656 ns | 1.47 | 0.04 | +| | | | | | | | | +| ArraySetWithVar | 11 | 4.6538 ns | 0.1019 ns | 0.0953 ns | 4.6584 ns | 1.27 | 0.03 | +| ArraySetWithField | 11 | 3.6546 ns | 0.0123 ns | 0.0115 ns | 3.6556 ns | 1.00 | 0.00 | +| SpanSet | 11 | 5.6726 ns | 0.0291 ns | 0.0272 ns | 5.6684 ns | 1.55 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 12 | 5.0027 ns | 0.0697 ns | 0.0652 ns | 4.9778 ns | 1.25 | 0.02 | +| ArraySetWithField | 12 | 4.0128 ns | 0.0249 ns | 0.0233 ns | 4.0165 ns | 1.00 | 0.00 | +| SpanSet | 12 | 6.0483 ns | 0.0539 ns | 0.0421 ns | 6.0564 ns | 1.51 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 13 | 5.1638 ns | 0.0386 ns | 0.0342 ns | 5.1679 ns | 1.23 | 0.01 | +| ArraySetWithField | 13 | 4.1868 ns | 0.0080 ns | 0.0071 ns | 4.1877 ns | 1.00 | 0.00 | +| SpanSet | 13 | 6.8180 ns | 0.1338 ns | 0.1252 ns | 6.8105 ns | 1.63 | 0.03 | +| | | | | | | | | +| ArraySetWithVar | 14 | 5.3945 ns | 0.0084 ns | 0.0065 ns | 5.3939 ns | 1.17 | 0.00 | +| ArraySetWithField | 14 | 4.6050 ns | 0.0163 ns | 0.0136 ns | 4.6079 ns | 1.00 | 0.00 | +| SpanSet | 14 | 7.4360 ns | 0.0431 ns | 0.0360 ns | 7.4488 ns | 1.61 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 15 | 6.0572 ns | 0.1460 ns | 0.2046 ns | 6.0832 ns | 1.25 | 0.04 | +| ArraySetWithField | 15 | 4.8496 ns | 0.0054 ns | 0.0042 ns | 4.8491 ns | 1.00 | 0.00 | +| SpanSet | 15 | 7.9418 ns | 0.0164 ns | 0.0137 ns | 7.9376 ns | 1.64 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 16 | 6.4385 ns | 0.1580 ns | 0.2412 ns | 6.3191 ns | 1.26 | 0.05 | +| ArraySetWithField | 16 | 5.1288 ns | 0.0365 ns | 0.0324 ns | 5.1361 ns | 1.00 | 0.00 | +| SpanSet | 16 | 8.8905 ns | 0.0499 ns | 0.0466 ns | 8.8896 ns | 1.73 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 17 | 6.6477 ns | 0.1621 ns | 0.1665 ns | 6.6454 ns | 1.23 | 0.04 | +| ArraySetWithField | 17 | 5.3947 ns | 0.1035 ns | 0.0864 ns | 5.3538 ns | 1.00 | 0.00 | +| SpanSet | 17 | 8.5048 ns | 0.0249 ns | 0.0221 ns | 8.5075 ns | 1.58 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 18 | 6.6377 ns | 0.1267 ns | 0.1244 ns | 6.5944 ns | 1.18 | 0.02 | +| ArraySetWithField | 18 | 5.6304 ns | 0.0105 ns | 0.0093 ns | 5.6274 ns | 1.00 | 0.00 | +| SpanSet | 18 | 8.9234 ns | 0.0360 ns | 0.0319 ns | 8.9253 ns | 1.58 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 19 | 7.0242 ns | 0.0154 ns | 0.0120 ns | 7.0265 ns | 1.16 | 0.00 | +| ArraySetWithField | 19 | 6.0558 ns | 0.0153 ns | 0.0136 ns | 6.0505 ns | 1.00 | 0.00 | +| SpanSet | 19 | 9.6918 ns | 0.0267 ns | 0.0249 ns | 9.6928 ns | 1.60 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 20 | 7.3951 ns | 0.1098 ns | 0.1027 ns | 7.3463 ns | 1.17 | 0.01 | +| ArraySetWithField | 20 | 6.3081 ns | 0.0147 ns | 0.0123 ns | 6.3062 ns | 1.00 | 0.00 | +| SpanSet | 20 | 10.3341 ns | 0.0067 ns | 0.0056 ns | 10.3315 ns | 1.64 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 30 | 9.7678 ns | 0.0492 ns | 0.0460 ns | 9.7524 ns | 1.06 | 0.01 | +| ArraySetWithField | 30 | 9.2401 ns | 0.0386 ns | 0.0342 ns | 9.2511 ns | 1.00 | 0.00 | +| SpanSet | 30 | 15.2144 ns | 0.0390 ns | 0.0345 ns | 15.2198 ns | 1.65 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 32 | 11.5139 ns | 0.2307 ns | 0.2158 ns | 11.3850 ns | 1.19 | 0.02 | +| ArraySetWithField | 32 | 9.7155 ns | 0.0127 ns | 0.0112 ns | 9.7123 ns | 1.00 | 0.00 | +| SpanSet | 32 | 16.0872 ns | 0.0204 ns | 0.0170 ns | 16.0871 ns | 1.66 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 40 | 12.2375 ns | 0.0264 ns | 0.0247 ns | 12.2253 ns | 1.01 | 0.00 | +| ArraySetWithField | 40 | 12.1236 ns | 0.0144 ns | 0.0134 ns | 12.1221 ns | 1.00 | 0.00 | +| SpanSet | 40 | 19.9416 ns | 0.0273 ns | 0.0255 ns | 19.9322 ns | 1.64 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 50 | 14.6316 ns | 0.0303 ns | 0.0268 ns | 14.6241 ns | 0.94 | 0.00 | +| ArraySetWithField | 50 | 15.5678 ns | 0.0862 ns | 0.0764 ns | 15.5547 ns | 1.00 | 0.00 | +| SpanSet | 50 | 24.7167 ns | 0.0153 ns | 0.0119 ns | 24.7160 ns | 1.59 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 60 | 17.0088 ns | 0.0186 ns | 0.0165 ns | 17.0064 ns | 0.92 | 0.01 | +| ArraySetWithField | 60 | 18.5370 ns | 0.1463 ns | 0.1368 ns | 18.5426 ns | 1.00 | 0.00 | +| SpanSet | 60 | 29.5779 ns | 0.1183 ns | 0.1107 ns | 29.6144 ns | 1.60 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 80 | 24.1961 ns | 0.1555 ns | 0.1455 ns | 24.1733 ns | 0.91 | 0.01 | +| ArraySetWithField | 80 | 26.4982 ns | 0.1534 ns | 0.1435 ns | 26.4651 ns | 1.00 | 0.00 | +| SpanSet | 80 | 40.4041 ns | 0.4015 ns | 0.3755 ns | 40.3401 ns | 1.52 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 90 | 24.2325 ns | 0.0650 ns | 0.0577 ns | 24.2251 ns | 0.72 | 0.01 | +| ArraySetWithField | 90 | 33.6785 ns | 0.2283 ns | 0.2136 ns | 33.7178 ns | 1.00 | 0.00 | +| SpanSet | 90 | 43.9471 ns | 0.1354 ns | 0.1057 ns | 43.9477 ns | 1.30 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 100 | 34.6069 ns | 0.3842 ns | 0.3593 ns | 34.7487 ns | 0.97 | 0.01 | +| ArraySetWithField | 100 | 35.5776 ns | 0.1210 ns | 0.1131 ns | 35.5837 ns | 1.00 | 0.00 | +| SpanSet | 100 | 53.7344 ns | 0.1538 ns | 0.1439 ns | 53.7185 ns | 1.51 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 128 | 41.4045 ns | 0.4361 ns | 0.4079 ns | 41.5116 ns | 0.95 | 0.01 | +| ArraySetWithField | 128 | 43.6934 ns | 0.1310 ns | 0.1162 ns | 43.6749 ns | 1.00 | 0.00 | +| SpanSet | 128 | 66.5672 ns | 0.1397 ns | 0.1238 ns | 66.5548 ns | 1.52 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 256 | 70.9427 ns | 0.4782 ns | 0.4473 ns | 71.0490 ns | 0.89 | 0.01 | +| ArraySetWithField | 256 | 80.0742 ns | 0.2967 ns | 0.2631 ns | 80.0270 ns | 1.00 | 0.00 | +| SpanSet | 256 | 127.5915 ns | 0.4899 ns | 0.4343 ns | 127.3657 ns | 1.59 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 512 | 132.1828 ns | 0.3919 ns | 0.3474 ns | 132.2670 ns | 0.86 | 0.00 | +| ArraySetWithField | 512 | 154.2140 ns | 0.3738 ns | 0.3497 ns | 154.2198 ns | 1.00 | 0.00 | +| SpanSet | 512 | 250.3647 ns | 0.5664 ns | 0.5021 ns | 250.0886 ns | 1.62 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 1024 | 256.1749 ns | 1.2610 ns | 1.1179 ns | 255.8400 ns | 0.84 | 0.00 | +| ArraySetWithField | 1024 | 303.9608 ns | 0.7641 ns | 0.7148 ns | 303.6921 ns | 1.00 | 0.00 | +| SpanSet | 1024 | 471.4042 ns | 0.9878 ns | 0.9240 ns | 471.5121 ns | 1.55 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 2048 | 501.2071 ns | 1.4541 ns | 1.2890 ns | 500.8381 ns | 0.83 | 0.00 | +| ArraySetWithField | 2048 | 600.8989 ns | 2.7570 ns | 2.4440 ns | 600.8161 ns | 1.00 | 0.00 | +| SpanSet | 2048 | 935.1442 ns | 1.5942 ns | 1.4912 ns | 934.6576 ns | 1.56 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 4096 | 996.5799 ns | 0.9021 ns | 0.7997 ns | 996.5021 ns | 0.83 | 0.00 | +| ArraySetWithField | 4096 | 1,201.1907 ns | 4.7698 ns | 4.4616 ns | 1,202.4870 ns | 1.00 | 0.00 | +| SpanSet | 4096 | 1,890.3773 ns | 6.1361 ns | 5.7397 ns | 1,890.7349 ns | 1.57 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 8192 | 1,987.9107 ns | 8.2600 ns | 6.8975 ns | 1,986.8454 ns | 0.83 | 0.00 | +| ArraySetWithField | 8192 | 2,399.1963 ns | 3.6931 ns | 2.8833 ns | 2,398.9801 ns | 1.00 | 0.00 | +| SpanSet | 8192 | 3,785.9897 ns | 21.6577 ns | 18.0852 ns | 3,782.0320 ns | 1.58 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 1000000 | 1,095,660.7117 ns | 21,714.0404 ns | 33,806.1449 ns | 1,083,141.5039 ns | 0.98 | 0.03 | +| ArraySetWithField | 1000000 | 1,111,976.3359 ns | 20,906.9048 ns | 27,910.1174 ns | 1,101,771.0938 ns | 1.00 | 0.00 | +| SpanSet | 1000000 | 1,114,171.4583 ns | 16,801.4894 ns | 15,716.1236 ns | 1,117,650.9766 ns | 1.00 | 0.04 | +| | | | | | | | | +| ArraySetWithVar | 2147483591 | 2,211,687,771.4286 ns | 16,208,703.4177 ns | 14,368,593.3923 ns | 2,215,022,850.0000 ns | 0.99 | 0.01 | +| ArraySetWithField | 2147483591 | 2,234,781,915.3846 ns | 14,747,844.4235 ns | 12,315,118.0269 ns | 2,232,597,000.0000 ns | 1.00 | 0.00 | +| SpanSet | 2147483591 | 2,256,799,913.3333 ns | 29,236,562.1000 ns | 27,347,898.3280 ns | 2,241,684,800.0000 ns | 1.01 | 0.02 | + +// * Warnings * +MultimodalDistribution + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> It seems that the distribution is bimodal (mValue = 3.78) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> It seems that the distribution is bimodal (mValue = 3.5) + +// * Hints * +Outliers + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were detected (2.93 ns, 2.96 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (1.81 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (2.01 ns, 2.05 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was detected (3.19 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (2.22 ns..2.28 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (2.49 ns, 2.49 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (3.06 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (3.82 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed, 4 outliers were detected (2.77 ns, 2.79 ns..2.82 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 3 outliers were detected (3.57 ns, 3.57 ns, 3.62 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 4 outliers were removed (4.57 ns..4.77 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed, 5 outliers were detected (3.23 ns..3.23 ns, 3.26 ns, 3.27 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (4.84 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.37 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (3.72 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed, 4 outliers were detected (4.92 ns, 4.99 ns..5.39 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (3.98 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed, 4 outliers were detected (5.15 ns, 5.17 ns, 5.24 ns, 5.25 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.47 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (5.63 ns, 5.69 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (4.62 ns, 4.67 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (7.12 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (5.46 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 3 outliers were removed, 5 outliers were detected (7.48 ns, 7.48 ns, 7.69 ns..8.06 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (6.94 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (5.71 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed (6.93 ns..7.40 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed, 3 outliers were detected (6.07 ns, 6.14 ns, 6.14 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed, 5 outliers were detected (8.86 ns..8.92 ns, 8.99 ns, 9.00 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (6.37 ns..6.42 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (9.52 ns, 9.60 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (6.92 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (7.52 ns, 7.56 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (9.95 ns, 10.07 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed (8.68 ns..8.91 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (7.16 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (10.35 ns, 10.52 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 3 outliers were removed (8.69 ns..8.92 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (7.64 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (11.12 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (7.96 ns, 7.97 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (11.87 ns, 11.88 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 3 outliers were detected (10.65 ns, 10.72 ns, 10.81 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (16.84 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (11.28 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed, 3 outliers were detected (17.55 ns, 17.65 ns, 17.65 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (16.20 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (18.37 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 3 outliers were removed (26.29 ns..26.37 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (18.58 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (27.68 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (26.02 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 3 outliers were removed (45.90 ns..45.93 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was detected (35.18 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (36.80 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was detected (41.98 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 2 outliers were detected (44.93 ns, 45.65 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (69.12 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (82.86 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (131.98 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (133.69 ns, 136.28 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (257.71 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (262.80 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (507.27 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 2 outliers were detected (598.19 ns, 612.01 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (1.00 us) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (1.19 us) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (2.04 us, 2.08 us) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (2.42 us..2.44 us) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (3.85 us, 3.94 us) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 4 outliers were removed (1.22 ms..1.35 ms) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were detected (1.08 ms, 1.08 ms) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (2.18 s, 2.26 s) SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (2.28 s, 2.28 s) + +// * Legends * + TestObjectCount : Value of the 'TestObjectCount' parameter + Mean : Arithmetic mean of all measurements + Error : Half of 99.9% confidence interval + StdDev : Standard deviation of all measurements + Median : Value separating the higher half of all measurements (50th percentile) + Ratio : Mean of the ratio distribution ([Current]/[Baseline]) + RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) + 1 ns : 1 Nanosecond (0.000000001 sec) + +************************************************************************************************************************************************* +************************************************************************************************************************************************* +************************************************************************************************************************************************* + +BenchmarkDotNet=v0.13.3, OS=ubuntu 20.04 +Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 4 logical and 2 physical cores +.NET SDK=7.0.203 + [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + + +| Method | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | +|------------------ |---------------- |------------------------:|----------------------:|----------------------:|------------------------:|------:|--------:| +| ArraySetWithVar | 1 | 1.6005 ns | 0.0025 ns | 0.0022 ns | 1.6007 ns | 4.61 | 0.03 | +| ArraySetWithField | 1 | 0.3466 ns | 0.0027 ns | 0.0025 ns | 0.3478 ns | 1.00 | 0.00 | +| SpanSet | 1 | 0.7008 ns | 0.0007 ns | 0.0006 ns | 0.7008 ns | 2.02 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 2 | 1.9617 ns | 0.0028 ns | 0.0026 ns | 1.9621 ns | 2.97 | 0.01 | +| ArraySetWithField | 2 | 0.6612 ns | 0.0016 ns | 0.0013 ns | 0.6610 ns | 1.00 | 0.00 | +| SpanSet | 2 | 0.9224 ns | 0.0009 ns | 0.0009 ns | 0.9223 ns | 1.40 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 3 | 3.9180 ns | 0.0178 ns | 0.0166 ns | 3.9195 ns | 3.07 | 0.02 | +| ArraySetWithField | 3 | 1.2773 ns | 0.0067 ns | 0.0056 ns | 1.2749 ns | 1.00 | 0.00 | +| SpanSet | 3 | 1.6728 ns | 0.0065 ns | 0.0060 ns | 1.6733 ns | 1.31 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 4 | 3.0629 ns | 0.0035 ns | 0.0032 ns | 3.0636 ns | 1.66 | 0.00 | +| ArraySetWithField | 4 | 1.8461 ns | 0.0032 ns | 0.0030 ns | 1.8457 ns | 1.00 | 0.00 | +| SpanSet | 4 | 2.2457 ns | 0.0045 ns | 0.0039 ns | 2.2458 ns | 1.22 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 5 | 3.9794 ns | 0.0025 ns | 0.0022 ns | 3.9800 ns | 1.32 | 0.05 | +| ArraySetWithField | 5 | 3.0059 ns | 0.0939 ns | 0.1153 ns | 3.0882 ns | 1.00 | 0.00 | +| SpanSet | 5 | 3.1000 ns | 0.0028 ns | 0.0023 ns | 3.0997 ns | 1.03 | 0.04 | +| | | | | | | | | +| ArraySetWithVar | 6 | 3.5894 ns | 0.0089 ns | 0.0079 ns | 3.5899 ns | 1.49 | 0.02 | +| ArraySetWithField | 6 | 2.4166 ns | 0.0354 ns | 0.0331 ns | 2.4147 ns | 1.00 | 0.00 | +| SpanSet | 6 | 2.7727 ns | 0.0181 ns | 0.0161 ns | 2.7759 ns | 1.15 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 7 | 3.8705 ns | 0.0090 ns | 0.0084 ns | 3.8673 ns | 1.16 | 0.00 | +| ArraySetWithField | 7 | 3.3283 ns | 0.0074 ns | 0.0069 ns | 3.3268 ns | 1.00 | 0.00 | +| SpanSet | 7 | 3.1766 ns | 0.0102 ns | 0.0085 ns | 3.1786 ns | 0.95 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 8 | 4.1455 ns | 0.0030 ns | 0.0028 ns | 4.1448 ns | 1.30 | 0.00 | +| ArraySetWithField | 8 | 3.1821 ns | 0.0027 ns | 0.0024 ns | 3.1821 ns | 1.00 | 0.00 | +| SpanSet | 8 | 3.6841 ns | 0.0079 ns | 0.0074 ns | 3.6839 ns | 1.16 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 9 | 4.4378 ns | 0.0022 ns | 0.0019 ns | 4.4377 ns | 1.14 | 0.00 | +| ArraySetWithField | 9 | 3.8759 ns | 0.0029 ns | 0.0027 ns | 3.8764 ns | 1.00 | 0.00 | +| SpanSet | 9 | 4.1472 ns | 0.0158 ns | 0.0147 ns | 4.1470 ns | 1.07 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 10 | 4.7189 ns | 0.0038 ns | 0.0032 ns | 4.7184 ns | 1.15 | 0.00 | +| ArraySetWithField | 10 | 4.1148 ns | 0.0029 ns | 0.0024 ns | 4.1144 ns | 1.00 | 0.00 | +| SpanSet | 10 | 4.4050 ns | 0.0279 ns | 0.0233 ns | 4.3943 ns | 1.07 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 11 | 5.0961 ns | 0.0074 ns | 0.0062 ns | 5.0969 ns | 1.03 | 0.00 | +| ArraySetWithField | 11 | 4.9518 ns | 0.0044 ns | 0.0039 ns | 4.9520 ns | 1.00 | 0.00 | +| SpanSet | 11 | 4.9052 ns | 0.0329 ns | 0.0275 ns | 4.8949 ns | 0.99 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 12 | 5.2174 ns | 0.0074 ns | 0.0066 ns | 5.2167 ns | 0.92 | 0.00 | +| ArraySetWithField | 12 | 5.6778 ns | 0.0081 ns | 0.0076 ns | 5.6778 ns | 1.00 | 0.00 | +| SpanSet | 12 | 5.4086 ns | 0.0486 ns | 0.0455 ns | 5.4007 ns | 0.95 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 13 | 5.6888 ns | 0.0095 ns | 0.0084 ns | 5.6875 ns | 0.94 | 0.00 | +| ArraySetWithField | 13 | 6.0615 ns | 0.0056 ns | 0.0049 ns | 6.0600 ns | 1.00 | 0.00 | +| SpanSet | 13 | 5.7281 ns | 0.0331 ns | 0.0309 ns | 5.7292 ns | 0.94 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 14 | 5.8935 ns | 0.0120 ns | 0.0106 ns | 5.8901 ns | 0.93 | 0.00 | +| ArraySetWithField | 14 | 6.3079 ns | 0.0156 ns | 0.0146 ns | 6.3124 ns | 1.00 | 0.00 | +| SpanSet | 14 | 6.0179 ns | 0.0182 ns | 0.0170 ns | 6.0210 ns | 0.95 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 15 | 6.6929 ns | 0.0119 ns | 0.0112 ns | 6.6895 ns | 1.00 | 0.00 | +| ArraySetWithField | 15 | 6.6939 ns | 0.0056 ns | 0.0050 ns | 6.6924 ns | 1.00 | 0.00 | +| SpanSet | 15 | 6.5041 ns | 0.0192 ns | 0.0170 ns | 6.5039 ns | 0.97 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 16 | 6.9466 ns | 0.0123 ns | 0.0115 ns | 6.9451 ns | 0.99 | 0.00 | +| ArraySetWithField | 16 | 6.9918 ns | 0.0161 ns | 0.0126 ns | 6.9904 ns | 1.00 | 0.00 | +| SpanSet | 16 | 6.8335 ns | 0.0129 ns | 0.0115 ns | 6.8350 ns | 0.98 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 17 | 7.8803 ns | 0.1539 ns | 0.1364 ns | 7.8157 ns | 1.07 | 0.02 | +| ArraySetWithField | 17 | 7.3937 ns | 0.0072 ns | 0.0067 ns | 7.3923 ns | 1.00 | 0.00 | +| SpanSet | 17 | 7.3889 ns | 0.0295 ns | 0.0276 ns | 7.3834 ns | 1.00 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 18 | 8.0929 ns | 0.0084 ns | 0.0070 ns | 8.0907 ns | 1.04 | 0.00 | +| ArraySetWithField | 18 | 7.8115 ns | 0.0064 ns | 0.0057 ns | 7.8126 ns | 1.00 | 0.00 | +| SpanSet | 18 | 7.8917 ns | 0.1759 ns | 0.1646 ns | 7.8150 ns | 1.01 | 0.02 | +| | | | | | | | | +| ArraySetWithVar | 19 | 8.5985 ns | 0.0268 ns | 0.0237 ns | 8.5871 ns | 1.05 | 0.02 | +| ArraySetWithField | 19 | 8.2165 ns | 0.1507 ns | 0.1410 ns | 8.1337 ns | 1.00 | 0.00 | +| SpanSet | 19 | 8.4661 ns | 0.2031 ns | 0.2494 ns | 8.3056 ns | 1.04 | 0.03 | +| | | | | | | | | +| ArraySetWithVar | 20 | 8.8796 ns | 0.0080 ns | 0.0075 ns | 8.8776 ns | 1.03 | 0.01 | +| ArraySetWithField | 20 | 8.6620 ns | 0.0694 ns | 0.0615 ns | 8.6587 ns | 1.00 | 0.00 | +| SpanSet | 20 | 8.5786 ns | 0.0131 ns | 0.0123 ns | 8.5786 ns | 0.99 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 30 | 12.2340 ns | 0.0405 ns | 0.0359 ns | 12.2361 ns | 0.93 | 0.00 | +| ArraySetWithField | 30 | 13.0996 ns | 0.0613 ns | 0.0543 ns | 13.1167 ns | 1.00 | 0.00 | +| SpanSet | 30 | 12.9861 ns | 0.0075 ns | 0.0070 ns | 12.9860 ns | 0.99 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 32 | 13.0265 ns | 0.0452 ns | 0.0423 ns | 13.0312 ns | 0.81 | 0.01 | +| ArraySetWithField | 32 | 16.0182 ns | 0.1015 ns | 0.0949 ns | 15.9814 ns | 1.00 | 0.00 | +| SpanSet | 32 | 13.9318 ns | 0.0134 ns | 0.0126 ns | 13.9300 ns | 0.87 | 0.01 | +| | | | | | | | | +| ArraySetWithVar | 40 | 15.9772 ns | 0.0802 ns | 0.0750 ns | 15.9619 ns | 0.81 | 0.00 | +| ArraySetWithField | 40 | 19.8427 ns | 0.0528 ns | 0.0494 ns | 19.8337 ns | 1.00 | 0.00 | +| SpanSet | 40 | 18.5625 ns | 0.0147 ns | 0.0138 ns | 18.5616 ns | 0.94 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 50 | 19.0897 ns | 0.0472 ns | 0.0442 ns | 19.1012 ns | 0.80 | 0.00 | +| ArraySetWithField | 50 | 23.8520 ns | 0.0708 ns | 0.0662 ns | 23.8558 ns | 1.00 | 0.00 | +| SpanSet | 50 | 23.5046 ns | 0.0227 ns | 0.0201 ns | 23.4986 ns | 0.99 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 60 | 23.4799 ns | 0.1172 ns | 0.1096 ns | 23.4780 ns | 0.87 | 0.00 | +| ArraySetWithField | 60 | 26.8609 ns | 0.0311 ns | 0.0243 ns | 26.8626 ns | 1.00 | 0.00 | +| SpanSet | 60 | 29.1054 ns | 0.0204 ns | 0.0181 ns | 29.1026 ns | 1.08 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 80 | 50.2605 ns | 0.1258 ns | 0.1115 ns | 50.2455 ns | 1.07 | 0.00 | +| ArraySetWithField | 80 | 46.8658 ns | 0.0728 ns | 0.0645 ns | 46.8692 ns | 1.00 | 0.00 | +| SpanSet | 80 | 51.4484 ns | 0.0914 ns | 0.0855 ns | 51.4708 ns | 1.10 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 90 | 36.7051 ns | 0.1824 ns | 0.1706 ns | 36.7614 ns | 0.92 | 0.00 | +| ArraySetWithField | 90 | 39.6823 ns | 0.0930 ns | 0.0870 ns | 39.6612 ns | 1.00 | 0.00 | +| SpanSet | 90 | 43.4244 ns | 0.0195 ns | 0.0182 ns | 43.4271 ns | 1.09 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 100 | 51.3160 ns | 0.0568 ns | 0.0504 ns | 51.3058 ns | 1.00 | 0.00 | +| ArraySetWithField | 100 | 51.3570 ns | 0.0377 ns | 0.0353 ns | 51.3562 ns | 1.00 | 0.00 | +| SpanSet | 100 | 57.7251 ns | 0.0708 ns | 0.0662 ns | 57.7026 ns | 1.12 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 128 | 61.5201 ns | 0.0489 ns | 0.0434 ns | 61.5210 ns | 0.97 | 0.00 | +| ArraySetWithField | 128 | 63.5051 ns | 0.0859 ns | 0.0804 ns | 63.5097 ns | 1.00 | 0.00 | +| SpanSet | 128 | 71.3592 ns | 0.1269 ns | 0.1187 ns | 71.3527 ns | 1.12 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 256 | 105.8192 ns | 0.0383 ns | 0.0358 ns | 105.8335 ns | 0.88 | 0.00 | +| ArraySetWithField | 256 | 119.9394 ns | 0.0760 ns | 0.0711 ns | 119.9179 ns | 1.00 | 0.00 | +| SpanSet | 256 | 135.2443 ns | 0.1709 ns | 0.1599 ns | 135.2831 ns | 1.13 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 512 | 210.0185 ns | 0.1510 ns | 0.1339 ns | 209.9837 ns | 0.90 | 0.00 | +| ArraySetWithField | 512 | 233.1248 ns | 0.0516 ns | 0.0431 ns | 233.1158 ns | 1.00 | 0.00 | +| SpanSet | 512 | 263.0390 ns | 0.1591 ns | 0.1410 ns | 263.0316 ns | 1.13 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 1024 | 417.8774 ns | 0.2947 ns | 0.2613 ns | 417.9022 ns | 0.91 | 0.00 | +| ArraySetWithField | 1024 | 460.3398 ns | 0.1941 ns | 0.1516 ns | 460.3139 ns | 1.00 | 0.00 | +| SpanSet | 1024 | 518.9574 ns | 0.3053 ns | 0.2706 ns | 518.8852 ns | 1.13 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 2048 | 835.0463 ns | 0.5355 ns | 0.4747 ns | 835.1100 ns | 0.91 | 0.00 | +| ArraySetWithField | 2048 | 915.4347 ns | 0.6474 ns | 0.5406 ns | 915.4247 ns | 1.00 | 0.00 | +| SpanSet | 2048 | 1,031.4134 ns | 0.7092 ns | 0.6634 ns | 1,031.5475 ns | 1.13 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 4096 | 1,711.6639 ns | 0.6226 ns | 0.5824 ns | 1,711.7812 ns | 0.94 | 0.00 | +| ArraySetWithField | 4096 | 1,830.3076 ns | 0.4474 ns | 0.3966 ns | 1,830.2355 ns | 1.00 | 0.00 | +| SpanSet | 4096 | 2,061.5471 ns | 1.6995 ns | 1.5066 ns | 2,061.7563 ns | 1.13 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 8192 | 3,414.7095 ns | 1.2613 ns | 1.1798 ns | 3,414.6534 ns | 0.94 | 0.00 | +| ArraySetWithField | 8192 | 3,645.9164 ns | 1.4002 ns | 1.3097 ns | 3,645.9304 ns | 1.00 | 0.00 | +| SpanSet | 8192 | 4,107.2606 ns | 3.4648 ns | 3.2409 ns | 4,107.4933 ns | 1.13 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 1000000 | 420,702.1225 ns | 255.2887 ns | 226.3068 ns | 420,727.8545 ns | 0.95 | 0.00 | +| ArraySetWithField | 1000000 | 444,452.6199 ns | 402.2439 ns | 356.5787 ns | 444,416.0256 ns | 1.00 | 0.00 | +| SpanSet | 1000000 | 500,024.9671 ns | 1,037.9277 ns | 970.8782 ns | 500,189.8135 ns | 1.12 | 0.00 | +| | | | | | | | | +| ArraySetWithVar | 2147483591 | 238,492,391,914.8000 ns | 4,592,687,023.3708 ns | 4,296,002,291.1676 ns | 239,458,354,055.0000 ns | 0.97 | 0.03 | +| ArraySetWithField | 2147483591 | 244,774,507,284.3333 ns | 4,025,896,310.4222 ns | 3,765,825,906.6134 ns | 246,203,799,599.0000 ns | 1.00 | 0.00 | +| SpanSet | 2147483591 | 225,900,352,939.8750 ns | 4,408,307,941.2510 ns | 5,732,045,514.6553 ns | 224,187,746,770.5000 ns | 0.92 | 0.03 | + +// * Hints * +Outliers + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (3.48 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (2.57 ns, 2.57 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (2.53 ns, 2.53 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (3.17 ns, 3.22 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (4.13 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.87 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (4.97 ns, 4.98 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (5.48 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were detected (4.20 ns, 4.23 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (4.76 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (5.06 ns, 5.08 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (5.10 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (6.31 ns, 6.32 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (6.60 ns, 6.60 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (5.99 ns, 6.00 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (6.41 ns, 6.45 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed, 3 outliers were detected (6.95 ns, 6.98 ns, 6.98 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (6.83 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 2 outliers were removed (7.06 ns, 7.20 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (7.11 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (7.58 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (7.97 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (7.80 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (8.60 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (8.42 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (8.94 ns..9.13 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (8.74 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (10.15 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 2 outliers were removed (9.99 ns, 10.00 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (9.70 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (10.55 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (10.72 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (14.22 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed, 4 outliers were detected (14.86 ns..14.89 ns, 15.08 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (25.53 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (25.45 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (28.86 ns..28.99 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (31.04 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (52.93 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (48.99 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (53.44 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was detected (53.14 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (64.12 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (212.83 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (235.92 ns, 237.35 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed, 2 outliers were detected (265.18 ns, 265.83 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed (421.48 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 3 outliers were removed (463.76 ns..469.66 ns) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (522.77 ns) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (836.49 ns, 839.38 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 2 outliers were removed (919.44 ns, 941.01 ns) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (1.84 us) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (2.07 us) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was detected (4.10 us) + SpanVsArrayBenchmarks.ArraySetWithVar: Default -> 1 outlier was removed, 2 outliers were detected (420.17 us, 421.17 us) + SpanVsArrayBenchmarks.ArraySetWithField: Default -> 1 outlier was removed (445.30 us) + SpanVsArrayBenchmarks.SpanSet: Default -> 1 outlier was removed (243.93 s) + +// * Legends * + TestObjectCount : Value of the 'TestObjectCount' parameter + Mean : Arithmetic mean of all measurements + Error : Half of 99.9% confidence interval + StdDev : Standard deviation of all measurements + Median : Value separating the higher half of all measurements (50th percentile) + Ratio : Mean of the ratio distribution ([Current]/[Baseline]) + RatioSD : Standard deviation of the ratio distribution ([Current]/[Baseline]) + 1 ns : 1 Nanosecond (0.000000001 sec) diff --git a/Recyclable.Collections.Benchmarks/POC/TaskRunVsTaskFactoryStartNew.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/TaskRunVsTaskFactoryStartNew.Benchmarks.cs index 546d108..ed30b3e 100644 --- a/Recyclable.Collections.Benchmarks/POC/TaskRunVsTaskFactoryStartNew.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/TaskRunVsTaskFactoryStartNew.Benchmarks.cs @@ -1,63 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Threading.Tasks.Sources; -using BenchmarkDotNet.Attributes; -using Microsoft.Extensions.ObjectPool; - -namespace Recyclable.Collections.Benchmarks.POC -{ - [MemoryDiagnoser] - public class TaskRunVsTaskFactoryStartNewBenchmarks - { - public int NumberOfTasks = 100; - private static readonly TaskFactory TaskPool = new(); - - [Benchmark] - public void OwnTaskFactory() - { - for (var i = 0; i < NumberOfTasks; i++) - { - _ = TaskPool.StartNew(() => {}); - } - } - - [Benchmark] - public void TaskRun() - { - for (var i = 0; i < NumberOfTasks; i++) - { - _ = Task.Run(() => { }); - } - } - - [Benchmark(Baseline = true)] - public void TaskFactoryStartNew() - { - for (var i = 0; i < NumberOfTasks; i++) - { - _ = Task.Factory.StartNew(() => { }); - } - } - - [Benchmark] - public void TaskConstructor() - { - for (var i = 0; i < NumberOfTasks; i++) - { - new Task(() => { }).Start(); - } - } - - [Benchmark] - public void TaskConstructorWithKnownScheduler() - { - TaskScheduler scheduler = TaskScheduler.Current; - for (var i = 0; i < NumberOfTasks; i++) - { - new Task(() => { }).Start(scheduler); - } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; +using BenchmarkDotNet.Attributes; +using Microsoft.Extensions.ObjectPool; + +namespace Recyclable.Collections.Benchmarks.POC +{ + [MemoryDiagnoser] + public class TaskRunVsTaskFactoryStartNewBenchmarks + { + public int NumberOfTasks = 100; + private static readonly TaskFactory TaskPool = new(); + + [Benchmark] + public void OwnTaskFactory() + { + for (var i = 0; i < NumberOfTasks; i++) + { + _ = TaskPool.StartNew(() => {}); + } + } + + [Benchmark] + public void TaskRun() + { + for (var i = 0; i < NumberOfTasks; i++) + { + _ = Task.Run(() => { }); + } + } + + [Benchmark(Baseline = true)] + public void TaskFactoryStartNew() + { + for (var i = 0; i < NumberOfTasks; i++) + { + _ = Task.Factory.StartNew(() => { }); + } + } + + [Benchmark] + public void TaskConstructor() + { + for (var i = 0; i < NumberOfTasks; i++) + { + new Task(() => { }).Start(); + } + } + + [Benchmark] + public void TaskConstructorWithKnownScheduler() + { + TaskScheduler scheduler = TaskScheduler.Current; + for (var i = 0; i < NumberOfTasks; i++) + { + new Task(() => { }).Start(scheduler); + } + } + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/Program.cs b/Recyclable.Collections.Benchmarks/Program.cs index 0ae9ba7..8f7eb87 100644 --- a/Recyclable.Collections.Benchmarks/Program.cs +++ b/Recyclable.Collections.Benchmarks/Program.cs @@ -1,65 +1,65 @@ -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Running; -using Recyclable.Collections.Benchmarks.POC; - -#pragma warning disable RCS1036, RCS1213, IDE0051 - -namespace Recyclable.Collections.Benchmarks -{ - public static class Program - { - static IConfig BenchmarkConfig { get; } = ManualConfig.Create(DefaultConfig.Instance) - .WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary); - - static void RunAssemblyBenchmarks() - { - _ = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(new[] { "-f*" }); - } - - private static void RunRecyclableCollectionsBenchmarks() - { - _ = BenchmarkRunner.Run(BenchmarkConfig); - } - - static void RunSelectedBenchmarks() - { - // **************** - // *** Template *** - // **************** - var benchmark = new RecyclableCollectionsBenchmarks(); - benchmark.Setup(); - - foreach (var _ in Enumerable.Range(1, 1000)) - { - // benchmark.RecyclableList_Create_WithCapacity(); - } - - benchmark.Cleanup(); - } - - static void RunPocBenchmarks() - { - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - // ArraySizeLimitPocBenchmarks>(BenchmarkConfig); - } - - static void Main() - { - RunRecyclableCollectionsBenchmarks(); - // RunPocBenchmarks(); - // RunSelectedBenchmarks(); - // RunAssemblyBenchmarks(); - } - } -} +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Running; +using Recyclable.Collections.Benchmarks.POC; + +#pragma warning disable RCS1036, RCS1213, IDE0051 + +namespace Recyclable.Collections.Benchmarks +{ + public static class Program + { + static IConfig BenchmarkConfig { get; } = ManualConfig.Create(DefaultConfig.Instance) + .WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary); + + static void RunAssemblyBenchmarks() + { + _ = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(new[] { "-f*" }); + } + + private static void RunRecyclableCollectionsBenchmarks() + { + _ = BenchmarkRunner.Run(BenchmarkConfig); + } + + static void RunSelectedBenchmarks() + { + // **************** + // *** Template *** + // **************** + var benchmark = new RecyclableCollectionsBenchmarks(); + benchmark.Setup(); + + foreach (var _ in Enumerable.Range(1, 1000)) + { + // benchmark.RecyclableList_Create_WithCapacity(); + } + + benchmark.Cleanup(); + } + + static void RunPocBenchmarks() + { + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + // ArraySizeLimitPocBenchmarks>(BenchmarkConfig); + } + + static void Main() + { + RunRecyclableCollectionsBenchmarks(); + // RunPocBenchmarks(); + // RunSelectedBenchmarks(); + // RunAssemblyBenchmarks(); + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Properties/launchSettings.json b/Recyclable.Collections.Benchmarks/Properties/launchSettings.json index 192f7ef..607bca1 100644 --- a/Recyclable.Collections.Benchmarks/Properties/launchSettings.json +++ b/Recyclable.Collections.Benchmarks/Properties/launchSettings.json @@ -1,12 +1,12 @@ -{ - "profiles": { - "WSL": { - "commandName": "WSL2", - "distributionName": "" - }, - ".Net": { - "commandName": "Project", - "nativeDebugging": true - } - } +{ + "profiles": { + "WSL": { + "commandName": "WSL2", + "distributionName": "" + }, + ".Net": { + "commandName": "Project", + "nativeDebugging": true + } + } } \ No newline at end of file diff --git a/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj b/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj index f663a83..b359131 100644 --- a/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj +++ b/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj @@ -1,22 +1,22 @@ - - - - Exe - net8.0;net7.0;net6.0 - enable - enable - AnyCPU;x64 - Recyclable.Collections.Benchmarks.Program - - - - - - - - - - - - - + + + + Exe + net8.0;net7.0;net6.0 + enable + enable + AnyCPU;x64 + Recyclable.Collections.Benchmarks.Program + + + + + + + + + + + + + diff --git a/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs b/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs index 3dbfcd2..9b0390c 100644 --- a/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs +++ b/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs @@ -1,340 +1,340 @@ -using BenchmarkDotNet.Attributes; -using Collections.Pooled; -using Recyclable.Collections.Benchmarks.Core; -using Recyclable.Collections.Benchmarks.POC; - -namespace Recyclable.Collections.Benchmarks -{ - public enum RecyclableCollectionsBenchmarkSource - { - Unknown, - Array, - List, - PooledList, - RecyclableList, - RecyclableLongList, - } - - [MemoryDiagnoser] - public class RecyclableBenchmarkBase : PocBenchmarkBase - { - protected long[]? _testObjects; - protected long[] TestObjects => _testObjects ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); - - protected List? _testObjectsAsList; - protected List TestObjectsAsList => _testObjectsAsList ?? throw new NullReferenceException("Something went wrong and the field is not initialized"); - - protected PooledList? _testObjectsAsPooledList; - public PooledList TestObjectsAsPooledList => _testObjectsAsPooledList ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); - protected RecyclableList? _testObjectsAsRecyclableList; - protected RecyclableList TestObjectsAsRecyclableList => _testObjectsAsRecyclableList ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); - protected RecyclableLongList? _testObjectsAsRecyclableLongList; - protected RecyclableLongList TestObjectsAsRecyclableLongList => _testObjectsAsRecyclableLongList ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); - protected IEnumerable TestObjectsAsIEnumerable - { - get - { - for (long i = 0; i < TestObjectCount; i++) - { - yield return i; - } - } - } - - public override void Setup() - { - PrepareData(RecyclableCollectionsBenchmarkSource.Array); - base.Setup(); - } - - protected override void PrepareData(T benchmarkType) - { - Console.WriteLine($"******* PREPARING DATA FOR {benchmarkType} *******"); - switch (benchmarkType) - { - case RecyclableCollectionsBenchmarkSource.Unknown: - break; - - case RecyclableCollectionsBenchmarkSource.Array: - _testObjects ??= DataGenerator.EnumerateTestObjects(TestObjectCount); - break; - - case RecyclableCollectionsBenchmarkSource.List: - _testObjectsAsList ??= TestObjects.ToList(); - break; - - case RecyclableCollectionsBenchmarkSource.PooledList: - _testObjectsAsPooledList ??= new PooledList(TestObjects, ClearMode.Auto); - break; - - case RecyclableCollectionsBenchmarkSource.RecyclableList: - _testObjectsAsRecyclableList ??= new(TestObjects, initialCapacity: TestObjectCount); - break; - - case RecyclableCollectionsBenchmarkSource.RecyclableLongList: - _testObjectsAsRecyclableLongList ??= new(TestObjects, BlockSize, initialCapacity: base.TestObjectCount); - break; - - default: - throw CreateUnknownBenchmarkTypeException(benchmarkType); - } - - base.PrepareData(benchmarkType); - } - - public override void Cleanup() - { - Console.WriteLine("******* GLOBAL CLEANUP *******"); - // Enable this if item type is changed to reference type - //if (_testObjects != null) - //{ - // Array.Fill(_testObjects, 0); - //} - - _testObjects = default; - _testObjectsAsList = default; - _testObjectsAsPooledList?.Dispose(); - _testObjectsAsPooledList = default; - _testObjectsAsRecyclableList?.Dispose(); - _testObjectsAsRecyclableList = default; - _testObjectsAsRecyclableLongList?.Dispose(); - _testObjectsAsRecyclableLongList = default; - base.Cleanup(); - } - } - - //[MemoryDiagnoser] - //public class ListVsLinkedListBenchmarks - //{ - // [Benchmark] - // public void RecyclableList() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // using var list = new RecyclableList(initialCapacity: dataCount); - // for (long i = 0; i < dataCount; i++) - // { - // list.Add(data[i]); - // } - - // for (long i = 0; i < list.LongCount; i++) - // { - // DoNothing(list[i]); - // } - - // list.Clear(); - // } - - // [Benchmark(Baseline = true)] - // public void RecyclableLongList() - // { - // var data = TestObjects; - // long dataCount = TestObjectCount; - // using var list = new RecyclableLongList(BlockSize, totalItemsCount: dataCount); - // for (long i = 0; i < dataCount; i++) - // { - // list.Add(data[i]); - // } - - // for (long i = 0; i < list.LongCount; i++) - // { - // DoNothing(list[i]); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void List() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new List(capacity: dataCount); - // for (var i = 0; i < dataCount; i++) - // { - // list.Add(data[i]); - // } - - // for (var i = 0; i < list.Count; i++) - // { - // DoNothing(list[i]); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void LinkedList() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new LinkedList(); - // for (var i = 0; i < dataCount; i++) - // { - // _ = list.AddLast(data[i]); - // } - - // foreach (var node in list) - // { - // DoNothing(node); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void RecyclableQueue() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new RecyclableQueue(BlockSize); - // for (var i = 0; i < dataCount; i++) - // { - // list.Enqueue(data[i]); - // } - - // while (list.LongCount > 0) - // { - // DoNothing(list.Dequeue()); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void Queue() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new Queue(capacity: dataCount); - // for (var i = 0; i < dataCount; i++) - // { - // list.Enqueue(data[i]); - // } - - // while (list.Count > 0) - // { - // DoNothing(list.Dequeue()); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void PriorityQueue() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new PriorityQueue(initialCapacity: dataCount); - // for (var i = 0; i < dataCount; i++) - // { - // list.Enqueue(data[i], i); - // } - - // while (list.Count > 0) - // { - // DoNothing(list.Dequeue()); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void RecyclableSortedList_InUpdateMode() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new RecyclableSortedList(BlockSize); - // list.BeginUpdate(); - // for (var i = 0; i < dataCount; i++) - // { - // list.Add(i, data[i]); - // } - - // list.EndUpdate(); - - // for (var i = 0; i < list.LongCount; i++) - // { - // DoNothing(list[i]); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void RecyclableSortedList() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new RecyclableSortedList(BlockSize); - // for (var i = 0; i < dataCount; i++) - // { - // list.Add(i, data[i]); - // } - - // for (var i = 0; i < list.LongCount; i++) - // { - // DoNothing(list[i]); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void SortedList() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new SortedList(); - // for (var i = 0; i < dataCount; i++) - // { - // list.Add(i, data[i]); - // } - - // for (var i = 0; i < list.Count; i++) - // { - // DoNothing(list[i]); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void RecyclableStack() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new RecyclableStack(BlockSize); - // for (var i = 0; i < dataCount; i++) - // { - // list.Push(data[i]); - // } - - // while (list.LongCount > 0) - // { - // DoNothing(list.Pop()); - // } - - // list.Clear(); - // } - - // //[Benchmark] - // public void Stack() - // { - // var data = TestObjects; - // var dataCount = TestObjectCount; - // var list = new Stack(); - // for (var i = 0; i < dataCount; i++) - // { - // list.Push(data[i]); - // } - - // while (list.Count > 0) - // { - // DoNothing(list.Pop()); - // } - - // list.Clear(); - // } - //} -} +using BenchmarkDotNet.Attributes; +using Collections.Pooled; +using Recyclable.Collections.Benchmarks.Core; +using Recyclable.Collections.Benchmarks.POC; + +namespace Recyclable.Collections.Benchmarks +{ + public enum RecyclableCollectionsBenchmarkSource + { + Unknown, + Array, + List, + PooledList, + RecyclableList, + RecyclableLongList, + } + + [MemoryDiagnoser] + public class RecyclableBenchmarkBase : PocBenchmarkBase + { + protected long[]? _testObjects; + protected long[] TestObjects => _testObjects ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); + + protected List? _testObjectsAsList; + protected List TestObjectsAsList => _testObjectsAsList ?? throw new NullReferenceException("Something went wrong and the field is not initialized"); + + protected PooledList? _testObjectsAsPooledList; + public PooledList TestObjectsAsPooledList => _testObjectsAsPooledList ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); + protected RecyclableList? _testObjectsAsRecyclableList; + protected RecyclableList TestObjectsAsRecyclableList => _testObjectsAsRecyclableList ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); + protected RecyclableLongList? _testObjectsAsRecyclableLongList; + protected RecyclableLongList TestObjectsAsRecyclableLongList => _testObjectsAsRecyclableLongList ?? throw new NullReferenceException("Something is wrong and the field is not initialized"); + protected IEnumerable TestObjectsAsIEnumerable + { + get + { + for (long i = 0; i < TestObjectCount; i++) + { + yield return i; + } + } + } + + public override void Setup() + { + PrepareData(RecyclableCollectionsBenchmarkSource.Array); + base.Setup(); + } + + protected override void PrepareData(T benchmarkType) + { + Console.WriteLine($"******* PREPARING DATA FOR {benchmarkType} *******"); + switch (benchmarkType) + { + case RecyclableCollectionsBenchmarkSource.Unknown: + break; + + case RecyclableCollectionsBenchmarkSource.Array: + _testObjects ??= DataGenerator.EnumerateTestObjects(TestObjectCount); + break; + + case RecyclableCollectionsBenchmarkSource.List: + _testObjectsAsList ??= TestObjects.ToList(); + break; + + case RecyclableCollectionsBenchmarkSource.PooledList: + _testObjectsAsPooledList ??= new PooledList(TestObjects, ClearMode.Auto); + break; + + case RecyclableCollectionsBenchmarkSource.RecyclableList: + _testObjectsAsRecyclableList ??= new(TestObjects, initialCapacity: TestObjectCount); + break; + + case RecyclableCollectionsBenchmarkSource.RecyclableLongList: + _testObjectsAsRecyclableLongList ??= new(TestObjects, BlockSize, initialCapacity: base.TestObjectCount); + break; + + default: + throw CreateUnknownBenchmarkTypeException(benchmarkType); + } + + base.PrepareData(benchmarkType); + } + + public override void Cleanup() + { + Console.WriteLine("******* GLOBAL CLEANUP *******"); + // Enable this if item type is changed to reference type + //if (_testObjects != null) + //{ + // Array.Fill(_testObjects, 0); + //} + + _testObjects = default; + _testObjectsAsList = default; + _testObjectsAsPooledList?.Dispose(); + _testObjectsAsPooledList = default; + _testObjectsAsRecyclableList?.Dispose(); + _testObjectsAsRecyclableList = default; + _testObjectsAsRecyclableLongList?.Dispose(); + _testObjectsAsRecyclableLongList = default; + base.Cleanup(); + } + } + + //[MemoryDiagnoser] + //public class ListVsLinkedListBenchmarks + //{ + // [Benchmark] + // public void RecyclableList() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // using var list = new RecyclableList(initialCapacity: dataCount); + // for (long i = 0; i < dataCount; i++) + // { + // list.Add(data[i]); + // } + + // for (long i = 0; i < list.LongCount; i++) + // { + // DoNothing(list[i]); + // } + + // list.Clear(); + // } + + // [Benchmark(Baseline = true)] + // public void RecyclableLongList() + // { + // var data = TestObjects; + // long dataCount = TestObjectCount; + // using var list = new RecyclableLongList(BlockSize, totalItemsCount: dataCount); + // for (long i = 0; i < dataCount; i++) + // { + // list.Add(data[i]); + // } + + // for (long i = 0; i < list.LongCount; i++) + // { + // DoNothing(list[i]); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void List() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new List(capacity: dataCount); + // for (var i = 0; i < dataCount; i++) + // { + // list.Add(data[i]); + // } + + // for (var i = 0; i < list.Count; i++) + // { + // DoNothing(list[i]); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void LinkedList() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new LinkedList(); + // for (var i = 0; i < dataCount; i++) + // { + // _ = list.AddLast(data[i]); + // } + + // foreach (var node in list) + // { + // DoNothing(node); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void RecyclableQueue() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new RecyclableQueue(BlockSize); + // for (var i = 0; i < dataCount; i++) + // { + // list.Enqueue(data[i]); + // } + + // while (list.LongCount > 0) + // { + // DoNothing(list.Dequeue()); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void Queue() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new Queue(capacity: dataCount); + // for (var i = 0; i < dataCount; i++) + // { + // list.Enqueue(data[i]); + // } + + // while (list.Count > 0) + // { + // DoNothing(list.Dequeue()); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void PriorityQueue() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new PriorityQueue(initialCapacity: dataCount); + // for (var i = 0; i < dataCount; i++) + // { + // list.Enqueue(data[i], i); + // } + + // while (list.Count > 0) + // { + // DoNothing(list.Dequeue()); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void RecyclableSortedList_InUpdateMode() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new RecyclableSortedList(BlockSize); + // list.BeginUpdate(); + // for (var i = 0; i < dataCount; i++) + // { + // list.Add(i, data[i]); + // } + + // list.EndUpdate(); + + // for (var i = 0; i < list.LongCount; i++) + // { + // DoNothing(list[i]); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void RecyclableSortedList() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new RecyclableSortedList(BlockSize); + // for (var i = 0; i < dataCount; i++) + // { + // list.Add(i, data[i]); + // } + + // for (var i = 0; i < list.LongCount; i++) + // { + // DoNothing(list[i]); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void SortedList() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new SortedList(); + // for (var i = 0; i < dataCount; i++) + // { + // list.Add(i, data[i]); + // } + + // for (var i = 0; i < list.Count; i++) + // { + // DoNothing(list[i]); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void RecyclableStack() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new RecyclableStack(BlockSize); + // for (var i = 0; i < dataCount; i++) + // { + // list.Push(data[i]); + // } + + // while (list.LongCount > 0) + // { + // DoNothing(list.Pop()); + // } + + // list.Clear(); + // } + + // //[Benchmark] + // public void Stack() + // { + // var data = TestObjects; + // var dataCount = TestObjectCount; + // var list = new Stack(); + // for (var i = 0; i < dataCount; i++) + // { + // list.Push(data[i]); + // } + + // while (list.Count > 0) + // { + // DoNothing(list.Pop()); + // } + + // list.Clear(); + // } + //} +} diff --git a/Recyclable.Collections.Benchmarks/Results/Benchmarks.md b/Recyclable.Collections.Benchmarks/Results/Benchmarks.md index 7fe28fa..fe4bf49 100644 --- a/Recyclable.Collections.Benchmarks/Results/Benchmarks.md +++ b/Recyclable.Collections.Benchmarks/Results/Benchmarks.md @@ -1,8579 +1,8579 @@ -# Parameter-less `constructor` -```CSharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1848/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.305 - [Host] : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 -``` -
-Empty Collection Creation Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | Mean | Error | StdDev | Ratio | Gen0 | Allocated | Alloc Ratio | -|--------- |--------- |------------- |------------------- |----------:|----------:|----------:|------:|-------:|----------:|------------:| -| Baseline | Create | List | Array | 6.667 ns | 0.0216 ns | 0.0180 ns | 1.00 | 0.0153 | 32 B | 1.00 | -| Actual | Create | List | Array | 5.204 ns | 0.0343 ns | 0.0304 ns | 0.78 | 0.0115 | 24 B | 0.75 | -| | | | | | | | | | | | -| Baseline | Create | List | PooledList | 6.383 ns | 0.0141 ns | 0.0118 ns | 1.00 | 0.0153 | 32 B | 1.00 | -| Actual | Create | List | PooledList | 11.740 ns | 0.0815 ns | 0.0681 ns | 1.84 | 0.0268 | 56 B | 1.75 | -| | | | | | | | | | | | -| Baseline | Create | List | RecyclableList | 6.721 ns | 0.0632 ns | 0.0528 ns | 1.00 | 0.0153 | 32 B | 1.00 | -| Actual | Create | List | RecyclableList | 9.081 ns | 0.0232 ns | 0.0206 ns | 1.35 | 0.0229 | 48 B | 1.50 | -| | | | | | | | | | | | -| Baseline | Create | List | RecyclableLongList | 6.624 ns | 0.0146 ns | 0.0130 ns | 1.00 | 0.0153 | 32 B | 1.00 | -| Actual | Create | List | RecyclableLongList | 28.379 ns | 0.0283 ns | 0.0221 ns | 4.28 | 0.0497 | 104 B | 3.25 | -
- -# `constructor` with capacity parameter -```CSharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.400 - [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 -``` -
-Empty Collection with Desired Capacity Creation Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |-------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | Create_WithCapacity | List | Array | 0 | 8.794 ns | 0.0973 ns | 0.0862 ns | 8.771 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 0 | 6.510 ns | 0.0360 ns | 0.0337 ns | 6.508 ns | 0.74 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 1 | 11.175 ns | 0.0565 ns | 0.0501 ns | 11.193 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 1 | 6.103 ns | 0.0167 ns | 0.0148 ns | 6.101 ns | 0.55 | 0.00 | 0.0153 | - | - | 32 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 2 | 11.317 ns | 0.0374 ns | 0.0292 ns | 11.321 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 2 | 6.439 ns | 0.1524 ns | 0.1426 ns | 6.369 ns | 0.57 | 0.01 | 0.0191 | - | - | 40 B | 0.56 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 3 | 11.561 ns | 0.0775 ns | 0.0647 ns | 11.575 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 3 | 12.728 ns | 0.0275 ns | 0.0229 ns | 12.722 ns | 1.10 | 0.01 | 0.0229 | - | - | 48 B | 0.60 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 4 | 11.798 ns | 0.0975 ns | 0.0865 ns | 11.782 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 4 | 6.793 ns | 0.0227 ns | 0.0213 ns | 6.792 ns | 0.58 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 5 | 12.220 ns | 0.0901 ns | 0.0799 ns | 12.229 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 5 | 7.094 ns | 0.0372 ns | 0.0330 ns | 7.088 ns | 0.58 | 0.00 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 6 | 12.426 ns | 0.0283 ns | 0.0236 ns | 12.421 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 6 | 7.348 ns | 0.0262 ns | 0.0245 ns | 7.338 ns | 0.59 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 7 | 12.654 ns | 0.0336 ns | 0.0281 ns | 12.647 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 7 | 7.540 ns | 0.0343 ns | 0.0304 ns | 7.524 ns | 0.60 | 0.00 | 0.0383 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 8 | 12.856 ns | 0.0567 ns | 0.0530 ns | 12.848 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 8 | 7.775 ns | 0.0314 ns | 0.0278 ns | 7.765 ns | 0.60 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 9 | 13.117 ns | 0.0616 ns | 0.0546 ns | 13.111 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 9 | 8.018 ns | 0.0645 ns | 0.0572 ns | 8.003 ns | 0.61 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 10 | 13.193 ns | 0.0396 ns | 0.0330 ns | 13.186 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 10 | 8.194 ns | 0.0215 ns | 0.0201 ns | 8.188 ns | 0.62 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 11 | 13.527 ns | 0.0391 ns | 0.0326 ns | 13.516 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 11 | 8.378 ns | 0.0193 ns | 0.0161 ns | 8.378 ns | 0.62 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 12 | 13.802 ns | 0.0655 ns | 0.0613 ns | 13.783 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 12 | 8.611 ns | 0.0272 ns | 0.0242 ns | 8.607 ns | 0.62 | 0.00 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 13 | 14.053 ns | 0.0271 ns | 0.0253 ns | 14.050 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 13 | 8.925 ns | 0.0454 ns | 0.0425 ns | 8.899 ns | 0.64 | 0.00 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 14 | 14.341 ns | 0.0406 ns | 0.0380 ns | 14.331 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 14 | 9.128 ns | 0.0112 ns | 0.0099 ns | 9.126 ns | 0.64 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 15 | 14.612 ns | 0.0142 ns | 0.0111 ns | 14.610 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 15 | 9.349 ns | 0.0174 ns | 0.0162 ns | 9.352 ns | 0.64 | 0.00 | 0.0689 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 16 | 14.773 ns | 0.2429 ns | 0.2272 ns | 14.659 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 16 | 9.645 ns | 0.0356 ns | 0.0333 ns | 9.634 ns | 0.65 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 17 | 15.141 ns | 0.0370 ns | 0.0346 ns | 15.138 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 17 | 9.898 ns | 0.0296 ns | 0.0231 ns | 9.894 ns | 0.65 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 18 | 15.646 ns | 0.0735 ns | 0.0651 ns | 15.641 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 18 | 10.111 ns | 0.0378 ns | 0.0335 ns | 10.113 ns | 0.65 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 19 | 15.664 ns | 0.1044 ns | 0.0925 ns | 15.635 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 19 | 10.336 ns | 0.0323 ns | 0.0302 ns | 10.331 ns | 0.66 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 20 | 15.911 ns | 0.0350 ns | 0.0327 ns | 15.908 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 20 | 10.563 ns | 0.0624 ns | 0.0584 ns | 10.564 ns | 0.66 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 30 | 18.589 ns | 0.3573 ns | 0.3167 ns | 18.419 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 30 | 12.730 ns | 0.0198 ns | 0.0176 ns | 12.724 ns | 0.68 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 32 | 18.854 ns | 0.0193 ns | 0.0151 ns | 18.857 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 32 | 13.159 ns | 0.0293 ns | 0.0274 ns | 13.150 ns | 0.70 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 36 | 19.684 ns | 0.0371 ns | 0.0347 ns | 19.680 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 36 | 14.243 ns | 0.0368 ns | 0.0326 ns | 14.253 ns | 0.72 | 0.00 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 37 | 20.062 ns | 0.0431 ns | 0.0360 ns | 20.056 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 37 | 14.508 ns | 0.0213 ns | 0.0199 ns | 14.508 ns | 0.72 | 0.00 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 40 | 20.657 ns | 0.0654 ns | 0.0580 ns | 20.633 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Create_WithCapacity | List | Array | 40 | 21.004 ns | 0.0672 ns | 0.0596 ns | 21.001 ns | 1.02 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 40 | 15.015 ns | 0.0484 ns | 0.0404 ns | 15.003 ns | 0.73 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| Actual | Create_WithCapacity | List | Array | 40 | 15.370 ns | 0.0691 ns | 0.0613 ns | 15.355 ns | 0.74 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 50 | 23.358 ns | 0.0493 ns | 0.0412 ns | 23.359 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 50 | 17.535 ns | 0.0862 ns | 0.0764 ns | 17.537 ns | 0.75 | 0.00 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 60 | 25.770 ns | 0.1931 ns | 0.1807 ns | 25.768 ns | 1.00 | 0.00 | 0.2563 | - | - | 536 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 60 | 19.931 ns | 0.0535 ns | 0.0501 ns | 19.924 ns | 0.77 | 0.00 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 70 | 28.588 ns | 0.3963 ns | 0.3707 ns | 28.514 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 70 | 22.296 ns | 0.1300 ns | 0.1216 ns | 22.284 ns | 0.78 | 0.01 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 80 | 30.929 ns | 0.1715 ns | 0.1521 ns | 30.923 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 80 | 24.510 ns | 0.1309 ns | 0.1160 ns | 24.566 ns | 0.79 | 0.01 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 90 | 33.452 ns | 0.1287 ns | 0.1141 ns | 33.507 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 90 | 26.897 ns | 0.1334 ns | 0.1248 ns | 26.882 ns | 0.80 | 0.00 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 100 | 35.406 ns | 0.1847 ns | 0.1728 ns | 35.363 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 100 | 28.708 ns | 0.2343 ns | 0.2192 ns | 28.736 ns | 0.81 | 0.01 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 128 | 42.206 ns | 0.0955 ns | 0.0893 ns | 42.224 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 128 | 35.495 ns | 0.0463 ns | 0.0387 ns | 35.499 ns | 0.84 | 0.00 | 0.5010 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 256 | 72.286 ns | 0.2765 ns | 0.2586 ns | 72.235 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 256 | 62.502 ns | 0.0647 ns | 0.0573 ns | 62.511 ns | 0.86 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 512 | 129.920 ns | 0.3823 ns | 0.3389 ns | 129.956 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 512 | 120.251 ns | 0.3007 ns | 0.2511 ns | 120.299 ns | 0.93 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 1024 | 264.760 ns | 2.8477 ns | 2.6637 ns | 264.704 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 1024 | 248.010 ns | 0.5264 ns | 0.4667 ns | 248.174 ns | 0.94 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 2048 | 453.531 ns | 0.7149 ns | 0.6687 ns | 453.496 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 2048 | 432.982 ns | 0.6459 ns | 0.5725 ns | 432.802 ns | 0.95 | 0.00 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 4096 | 857.799 ns | 2.7053 ns | 2.2590 ns | 857.170 ns | 1.00 | 0.00 | 15.6240 | - | - | 32824 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 4096 | 807.757 ns | 1.2454 ns | 1.1040 ns | 807.645 ns | 0.94 | 0.00 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 8192 | 1,606.336 ns | 7.5581 ns | 6.7001 ns | 1,605.795 ns | 1.00 | 0.00 | 31.2481 | - | - | 65592 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 8192 | 1,518.664 ns | 8.2983 ns | 7.3563 ns | 1,517.190 ns | 0.95 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 16384 | 5,150.667 ns | 38.2438 ns | 33.9021 ns | 5,143.017 ns | 1.00 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131142 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 16384 | 5,088.226 ns | 35.8742 ns | 31.8015 ns | 5,099.274 ns | 0.99 | 0.01 | 41.6641 | 41.6641 | 41.6641 | 131110 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 32768 | 8,580.747 ns | 68.6504 ns | 60.8568 ns | 8,567.583 ns | 1.00 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262227 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 32768 | 8,542.554 ns | 43.5994 ns | 38.6497 ns | 8,537.675 ns | 1.00 | 0.01 | 83.3282 | 83.3282 | 83.3282 | 262196 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 65536 | 57,482.508 ns | 1,140.3677 ns | 3,043.8722 ns | 57,183.252 ns | 1.00 | 0.00 | 26.1841 | 26.0010 | 26.0010 | 524477 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 65536 | 56,901.088 ns | 1,136.4487 ns | 2,295.6824 ns | 56,687.024 ns | 0.99 | 0.07 | 14.5874 | 14.5874 | 14.5874 | 524312 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 131072 | 112,239.721 ns | 1,974.9606 ns | 2,425.4289 ns | 111,705.103 ns | 1.00 | 0.00 | 21.2402 | 21.1182 | 21.1182 | 1048713 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 131072 | 115,821.163 ns | 1,102.8526 ns | 1,031.6090 ns | 115,916.626 ns | 1.03 | 0.03 | 17.7002 | 17.7002 | 17.7002 | 1048602 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | Array | 850000 | 913,490.789 ns | 21,890.5845 ns | 59,554.9497 ns | 906,929.297 ns | 1.00 | 0.00 | 121.0938 | 121.0938 | 121.0938 | 6800554 B | 1.00 | -| Actual | Create_WithCapacity | List | Array | 850000 | 1,174,344.692 ns | 32,539.7651 ns | 93,884.6623 ns | 1,176,002.734 ns | 1.30 | 0.13 | 119.1406 | 119.1406 | 119.1406 | 6800060 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 0 | 8.532 ns | 0.0333 ns | 0.0311 ns | 8.521 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 0 | 14.699 ns | 0.0596 ns | 0.0529 ns | 14.685 ns | 1.72 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 1 | 11.067 ns | 0.0248 ns | 0.0193 ns | 11.070 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 1 | 40.743 ns | 0.3081 ns | 0.2882 ns | 40.775 ns | 3.68 | 0.03 | 0.0268 | - | - | 56 B | 0.88 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 2 | 11.326 ns | 0.0226 ns | 0.0200 ns | 11.328 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 2 | 40.432 ns | 0.2894 ns | 0.2707 ns | 40.490 ns | 3.57 | 0.03 | 0.0268 | - | - | 56 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 3 | 11.585 ns | 0.0800 ns | 0.0668 ns | 11.603 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 3 | 40.659 ns | 0.2042 ns | 0.1910 ns | 40.653 ns | 3.51 | 0.02 | 0.0268 | - | - | 56 B | 0.70 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 4 | 11.779 ns | 0.0831 ns | 0.0777 ns | 11.777 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 4 | 40.823 ns | 0.2985 ns | 0.2792 ns | 40.841 ns | 3.47 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 5 | 12.048 ns | 0.0429 ns | 0.0380 ns | 12.051 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 5 | 40.487 ns | 0.3611 ns | 0.3378 ns | 40.616 ns | 3.36 | 0.03 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 6 | 12.279 ns | 0.0378 ns | 0.0335 ns | 12.270 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 6 | 40.674 ns | 0.2628 ns | 0.2459 ns | 40.678 ns | 3.31 | 0.02 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 7 | 12.515 ns | 0.0426 ns | 0.0398 ns | 12.498 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 7 | 40.836 ns | 0.2591 ns | 0.2423 ns | 40.781 ns | 3.26 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 8 | 12.719 ns | 0.0210 ns | 0.0186 ns | 12.716 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 8 | 40.566 ns | 0.3832 ns | 0.3584 ns | 40.615 ns | 3.19 | 0.02 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 9 | 12.997 ns | 0.0327 ns | 0.0306 ns | 12.995 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 9 | 40.818 ns | 0.3113 ns | 0.2760 ns | 40.799 ns | 3.14 | 0.02 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 10 | 13.281 ns | 0.0371 ns | 0.0329 ns | 13.275 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 10 | 40.470 ns | 0.4647 ns | 0.3881 ns | 40.484 ns | 3.05 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 11 | 13.548 ns | 0.0475 ns | 0.0444 ns | 13.544 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 11 | 40.590 ns | 0.2013 ns | 0.1883 ns | 40.551 ns | 3.00 | 0.01 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 12 | 13.839 ns | 0.0283 ns | 0.0236 ns | 13.836 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 12 | 40.733 ns | 0.2969 ns | 0.2632 ns | 40.737 ns | 2.94 | 0.02 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 13 | 14.030 ns | 0.0327 ns | 0.0306 ns | 14.026 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 13 | 40.675 ns | 0.3296 ns | 0.3083 ns | 40.684 ns | 2.90 | 0.02 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 14 | 14.333 ns | 0.0412 ns | 0.0365 ns | 14.323 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 14 | 40.426 ns | 0.2263 ns | 0.2117 ns | 40.341 ns | 2.82 | 0.02 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 15 | 14.610 ns | 0.0283 ns | 0.0265 ns | 14.604 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 15 | 40.578 ns | 0.3183 ns | 0.2977 ns | 40.560 ns | 2.78 | 0.02 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 16 | 14.835 ns | 0.1649 ns | 0.1462 ns | 14.894 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 16 | 40.774 ns | 0.2925 ns | 0.2736 ns | 40.816 ns | 2.75 | 0.03 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 17 | 15.023 ns | 0.0222 ns | 0.0185 ns | 15.029 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 17 | 40.819 ns | 0.2867 ns | 0.2542 ns | 40.797 ns | 2.72 | 0.02 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 18 | 15.334 ns | 0.0851 ns | 0.0755 ns | 15.320 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 18 | 40.838 ns | 0.2213 ns | 0.2070 ns | 40.822 ns | 2.66 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 19 | 15.947 ns | 0.3424 ns | 0.3035 ns | 15.979 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 19 | 40.376 ns | 0.4533 ns | 0.4240 ns | 40.441 ns | 2.53 | 0.06 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 20 | 15.810 ns | 0.0401 ns | 0.0376 ns | 15.805 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 20 | 40.753 ns | 0.4456 ns | 0.4168 ns | 40.809 ns | 2.58 | 0.03 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 30 | 18.330 ns | 0.0754 ns | 0.0705 ns | 18.318 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 30 | 40.625 ns | 0.2963 ns | 0.2772 ns | 40.555 ns | 2.22 | 0.02 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 32 | 18.891 ns | 0.0729 ns | 0.0569 ns | 18.896 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 32 | 40.729 ns | 0.4086 ns | 0.3822 ns | 40.761 ns | 2.16 | 0.02 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 36 | 19.793 ns | 0.0560 ns | 0.0524 ns | 19.794 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 36 | 41.021 ns | 0.3923 ns | 0.3478 ns | 40.892 ns | 2.07 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 37 | 20.130 ns | 0.0920 ns | 0.0861 ns | 20.137 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 37 | 40.652 ns | 0.3785 ns | 0.3540 ns | 40.723 ns | 2.02 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 40 | 20.649 ns | 0.0436 ns | 0.0364 ns | 20.639 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Create_WithCapacity | List | PooledList | 40 | 20.800 ns | 0.0654 ns | 0.0580 ns | 20.786 ns | 1.01 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 40 | 40.907 ns | 0.3172 ns | 0.2967 ns | 40.901 ns | 1.98 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | Create_WithCapacity | List | PooledList | 40 | 40.571 ns | 0.4134 ns | 0.3452 ns | 40.717 ns | 1.96 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 50 | 23.080 ns | 0.0363 ns | 0.0322 ns | 23.075 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 50 | 40.648 ns | 0.3675 ns | 0.3438 ns | 40.683 ns | 1.76 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 60 | 25.713 ns | 0.0907 ns | 0.0849 ns | 25.676 ns | 1.00 | 0.00 | 0.2563 | - | - | 536 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 60 | 40.615 ns | 0.3634 ns | 0.3035 ns | 40.597 ns | 1.58 | 0.01 | 0.0268 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 70 | 27.885 ns | 0.0836 ns | 0.0741 ns | 27.854 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 70 | 40.901 ns | 0.2351 ns | 0.2199 ns | 40.905 ns | 1.47 | 0.01 | 0.0268 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 80 | 30.178 ns | 0.0845 ns | 0.0749 ns | 30.167 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 80 | 40.782 ns | 0.2986 ns | 0.2794 ns | 40.858 ns | 1.35 | 0.01 | 0.0268 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 850000 | 766,087.349 ns | 22,990.2438 ns | 66,698.8659 ns | 760,261.914 ns | 1.000 | 0.00 | 158.2031 | 158.2031 | 158.2031 | 6800374 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 850000 | 35.102 ns | 0.1324 ns | 0.1238 ns | 35.141 ns | 0.000 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 90 | 33.140 ns | 0.0557 ns | 0.0465 ns | 33.145 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 90 | 40.570 ns | 0.6301 ns | 0.5894 ns | 40.715 ns | 1.22 | 0.02 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 100 | 34.926 ns | 0.1141 ns | 0.1012 ns | 34.925 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 100 | 41.164 ns | 0.2153 ns | 0.2014 ns | 41.141 ns | 1.18 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 128 | 42.094 ns | 0.0520 ns | 0.0406 ns | 42.090 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 128 | 40.753 ns | 0.3205 ns | 0.2841 ns | 40.779 ns | 0.97 | 0.01 | 0.0268 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 256 | 71.258 ns | 0.1568 ns | 0.1309 ns | 71.293 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 256 | 36.677 ns | 0.0875 ns | 0.0731 ns | 36.675 ns | 0.51 | 0.00 | 0.0268 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 512 | 128.119 ns | 0.2293 ns | 0.2032 ns | 128.130 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | Create_WithCapacity | List | PooledList | 512 | 36.798 ns | 0.0783 ns | 0.0733 ns | 36.783 ns | 0.29 | 0.00 | 0.0268 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 1024 | 264.816 ns | 1.3197 ns | 1.1699 ns | 264.277 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 1024 | 36.877 ns | 0.1768 ns | 0.1654 ns | 36.821 ns | 0.14 | 0.00 | 0.0268 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 2048 | 459.156 ns | 1.0573 ns | 0.9373 ns | 458.881 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 2048 | 36.719 ns | 0.0682 ns | 0.0569 ns | 36.730 ns | 0.08 | 0.00 | 0.0268 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 4096 | 861.708 ns | 3.0492 ns | 2.8522 ns | 860.754 ns | 1.00 | 0.00 | 15.6240 | - | - | 32824 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 4096 | 36.942 ns | 0.1813 ns | 0.1514 ns | 36.904 ns | 0.04 | 0.00 | 0.0268 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 8192 | 1,622.517 ns | 6.0965 ns | 5.4044 ns | 1,621.396 ns | 1.00 | 0.00 | 31.2481 | - | - | 65592 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 8192 | 37.130 ns | 0.2061 ns | 0.1827 ns | 37.124 ns | 0.02 | 0.00 | 0.0268 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 16384 | 5,179.041 ns | 43.2041 ns | 40.4132 ns | 5,164.414 ns | 1.000 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131142 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 16384 | 34.978 ns | 0.1481 ns | 0.1313 ns | 34.939 ns | 0.007 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 32768 | 8,650.943 ns | 44.3956 ns | 39.3556 ns | 8,651.624 ns | 1.000 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262228 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 32768 | 35.368 ns | 0.3100 ns | 0.2748 ns | 35.280 ns | 0.004 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 65536 | 57,316.758 ns | 1,143.6954 ns | 2,581.5111 ns | 57,381.525 ns | 1.000 | 0.00 | 20.7520 | 20.6299 | 20.6299 | 524437 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 65536 | 34.845 ns | 0.0610 ns | 0.0541 ns | 34.838 ns | 0.001 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | PooledList | 131072 | 115,216.456 ns | 2,240.4536 ns | 2,397.2603 ns | 115,155.756 ns | 1.000 | 0.00 | 21.4844 | 21.3623 | 21.3623 | 1048716 B | 1.000 | -| Actual | Create_WithCapacity | List | PooledList | 131072 | 34.654 ns | 0.0571 ns | 0.0506 ns | 34.657 ns | 0.000 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 0 | 8.572 ns | 0.0362 ns | 0.0283 ns | 8.560 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 0 | 15.491 ns | 0.0393 ns | 0.0367 ns | 15.478 ns | 1.81 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 1 | 11.291 ns | 0.0663 ns | 0.0620 ns | 11.254 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 1 | 15.079 ns | 0.0994 ns | 0.0930 ns | 15.087 ns | 1.34 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 2 | 11.540 ns | 0.0748 ns | 0.0663 ns | 11.540 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 2 | 15.058 ns | 0.0966 ns | 0.0754 ns | 15.084 ns | 1.30 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 3 | 11.784 ns | 0.0681 ns | 0.0637 ns | 11.809 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 3 | 15.021 ns | 0.0457 ns | 0.0405 ns | 15.014 ns | 1.27 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 4 | 11.928 ns | 0.0155 ns | 0.0121 ns | 11.931 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 4 | 15.660 ns | 0.1204 ns | 0.1126 ns | 15.593 ns | 1.31 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 5 | 12.274 ns | 0.0716 ns | 0.0670 ns | 12.243 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 5 | 15.716 ns | 0.0260 ns | 0.0203 ns | 15.716 ns | 1.28 | 0.01 | 0.0536 | - | - | 112 B | 1.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 6 | 12.655 ns | 0.0843 ns | 0.0788 ns | 12.630 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 6 | 16.132 ns | 0.0405 ns | 0.0338 ns | 16.126 ns | 1.27 | 0.01 | 0.0574 | - | - | 120 B | 1.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 7 | 12.865 ns | 0.0880 ns | 0.0824 ns | 12.832 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 7 | 16.432 ns | 0.0837 ns | 0.0742 ns | 16.397 ns | 1.28 | 0.01 | 0.0612 | - | - | 128 B | 1.14 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 8 | 13.071 ns | 0.0490 ns | 0.0434 ns | 13.057 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 8 | 16.742 ns | 0.0843 ns | 0.0788 ns | 16.728 ns | 1.28 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 9 | 13.327 ns | 0.0606 ns | 0.0473 ns | 13.318 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 9 | 17.032 ns | 0.1103 ns | 0.0921 ns | 17.011 ns | 1.28 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 10 | 22.303 ns | 0.2637 ns | 0.2466 ns | 22.183 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 10 | 17.333 ns | 0.2533 ns | 0.2246 ns | 17.200 ns | 0.78 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 11 | 14.571 ns | 0.0288 ns | 0.0255 ns | 14.570 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 11 | 17.700 ns | 0.1704 ns | 0.1594 ns | 17.697 ns | 1.22 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 12 | 14.080 ns | 0.0500 ns | 0.0467 ns | 14.072 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 12 | 17.894 ns | 0.1682 ns | 0.1573 ns | 17.913 ns | 1.27 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 13 | 14.443 ns | 0.0596 ns | 0.0557 ns | 14.417 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 13 | 18.104 ns | 0.0554 ns | 0.0491 ns | 18.097 ns | 1.25 | 0.01 | 0.0842 | - | - | 176 B | 1.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 14 | 14.667 ns | 0.0484 ns | 0.0429 ns | 14.670 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 14 | 18.267 ns | 0.1232 ns | 0.1028 ns | 18.230 ns | 1.25 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 15 | 15.070 ns | 0.1371 ns | 0.1283 ns | 15.050 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 15 | 18.682 ns | 0.0388 ns | 0.0324 ns | 18.676 ns | 1.24 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 16 | 15.157 ns | 0.1678 ns | 0.1570 ns | 15.197 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 16 | 18.855 ns | 0.1278 ns | 0.1133 ns | 18.797 ns | 1.24 | 0.02 | 0.0956 | - | - | 200 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 17 | 15.600 ns | 0.1292 ns | 0.1145 ns | 15.574 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 17 | 19.510 ns | 0.3931 ns | 0.3282 ns | 19.417 ns | 1.25 | 0.02 | 0.0995 | - | - | 208 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 18 | 15.658 ns | 0.0641 ns | 0.0536 ns | 15.645 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 18 | 19.451 ns | 0.2090 ns | 0.1955 ns | 19.357 ns | 1.24 | 0.02 | 0.1033 | - | - | 216 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 19 | 15.841 ns | 0.0672 ns | 0.0629 ns | 15.826 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 19 | 19.854 ns | 0.1596 ns | 0.1333 ns | 19.855 ns | 1.25 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 20 | 16.223 ns | 0.0930 ns | 0.0870 ns | 16.217 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 20 | 19.784 ns | 0.0589 ns | 0.0492 ns | 19.772 ns | 1.22 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 30 | 18.746 ns | 0.0851 ns | 0.0755 ns | 18.745 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 30 | 23.656 ns | 0.4590 ns | 1.1260 ns | 23.077 ns | 1.28 | 0.06 | 0.1492 | - | - | 312 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 32 | 19.269 ns | 0.0728 ns | 0.0645 ns | 19.287 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 32 | 23.036 ns | 0.1317 ns | 0.1232 ns | 23.039 ns | 1.20 | 0.01 | 0.1568 | - | - | 328 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 36 | 20.292 ns | 0.0466 ns | 0.0364 ns | 20.302 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 36 | 24.311 ns | 0.1388 ns | 0.1299 ns | 24.275 ns | 1.20 | 0.01 | 0.1721 | - | - | 360 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 37 | 26.710 ns | 0.5518 ns | 0.7913 ns | 26.489 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 37 | 28.807 ns | 0.3520 ns | 0.3292 ns | 28.745 ns | 1.06 | 0.03 | 0.0382 | - | - | 80 B | 0.23 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 40 | 28.402 ns | 0.4691 ns | 0.4388 ns | 28.495 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Create_WithCapacity | List | RecyclableList | 40 | 28.804 ns | 0.3662 ns | 0.3426 ns | 28.891 ns | 1.01 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 40 | 28.496 ns | 0.1235 ns | 0.0964 ns | 28.516 ns | 1.00 | 0.01 | 0.0382 | - | - | 80 B | 0.21 | -| Actual | Create_WithCapacity | List | RecyclableList | 40 | 29.178 ns | 0.1820 ns | 0.1703 ns | 29.140 ns | 1.03 | 0.02 | 0.0382 | - | - | 80 B | 0.21 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 50 | 32.370 ns | 0.6696 ns | 0.6264 ns | 32.241 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 50 | 27.715 ns | 0.0843 ns | 0.0658 ns | 27.719 ns | 0.86 | 0.01 | 0.0382 | - | - | 80 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 60 | 36.875 ns | 0.5662 ns | 0.5296 ns | 36.914 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 60 | 28.580 ns | 0.1273 ns | 0.1191 ns | 28.583 ns | 0.78 | 0.01 | 0.0382 | - | - | 80 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 70 | 40.701 ns | 0.7455 ns | 0.6608 ns | 40.675 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 70 | 27.998 ns | 0.3049 ns | 0.2852 ns | 28.000 ns | 0.69 | 0.01 | 0.0382 | - | - | 80 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 80 | 46.181 ns | 0.5498 ns | 0.5143 ns | 46.283 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 80 | 28.905 ns | 0.1872 ns | 0.1751 ns | 28.906 ns | 0.63 | 0.01 | 0.0382 | - | - | 80 B | 0.11 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 90 | 48.275 ns | 0.5940 ns | 0.5265 ns | 48.186 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 90 | 28.154 ns | 0.5105 ns | 0.4775 ns | 28.004 ns | 0.58 | 0.01 | 0.0382 | - | - | 80 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 100 | 53.034 ns | 0.9229 ns | 0.8633 ns | 53.176 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 100 | 27.663 ns | 0.1570 ns | 0.1311 ns | 27.633 ns | 0.52 | 0.01 | 0.0382 | - | - | 80 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 128 | 60.282 ns | 0.9462 ns | 0.8851 ns | 60.049 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 128 | 28.745 ns | 0.5088 ns | 0.4759 ns | 28.494 ns | 0.48 | 0.01 | 0.0382 | - | - | 80 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 256 | 109.375 ns | 2.2369 ns | 3.3481 ns | 109.297 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 256 | 27.895 ns | 0.3189 ns | 0.2827 ns | 27.816 ns | 0.25 | 0.00 | 0.0382 | - | - | 80 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 512 | 209.704 ns | 4.0963 ns | 4.5530 ns | 208.877 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableList | 512 | 28.814 ns | 0.1983 ns | 0.1757 ns | 28.867 ns | 0.14 | 0.00 | 0.0382 | - | - | 80 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 1024 | 417.485 ns | 7.5967 ns | 7.1059 ns | 416.094 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 1024 | 27.821 ns | 0.1536 ns | 0.1362 ns | 27.817 ns | 0.07 | 0.00 | 0.0382 | - | - | 80 B | 0.010 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 2048 | 761.447 ns | 13.2713 ns | 11.7646 ns | 760.725 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 2048 | 28.788 ns | 0.1512 ns | 0.1262 ns | 28.789 ns | 0.04 | 0.00 | 0.0382 | - | - | 80 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 4096 | 1,504.779 ns | 29.8901 ns | 27.9593 ns | 1,498.650 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 4096 | 29.377 ns | 0.0983 ns | 0.0920 ns | 29.331 ns | 0.02 | 0.00 | 0.0382 | - | - | 80 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 8192 | 2,851.462 ns | 56.1910 ns | 55.1871 ns | 2,849.142 ns | 1.000 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 8192 | 27.906 ns | 0.2526 ns | 0.2363 ns | 27.907 ns | 0.010 | 0.00 | 0.0382 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 16384 | 7,021.374 ns | 136.5100 ns | 134.0711 ns | 7,048.221 ns | 1.000 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131154 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 16384 | 28.812 ns | 0.4457 ns | 0.4169 ns | 28.846 ns | 0.004 | 0.00 | 0.0382 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 32768 | 12,082.734 ns | 232.6650 ns | 217.6349 ns | 12,154.080 ns | 1.000 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262252 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 32768 | 28.093 ns | 0.0981 ns | 0.0917 ns | 28.094 ns | 0.002 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 65536 | 55,237.774 ns | 1,087.9834 ns | 3,086.4278 ns | 54,824.014 ns | 1.000 | 0.00 | 15.1978 | 15.0757 | 15.0757 | 524410 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 65536 | 28.349 ns | 0.3804 ns | 0.3559 ns | 28.364 ns | 0.001 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 131072 | 111,970.124 ns | 2,235.3755 ns | 2,484.6139 ns | 111,622.583 ns | 1.000 | 0.00 | 18.0664 | 18.0664 | 18.0664 | 1048668 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 131072 | 28.695 ns | 0.5393 ns | 0.5045 ns | 28.595 ns | 0.000 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableList | 850000 | 624,614.489 ns | 12,330.2167 ns | 30,246.2317 ns | 627,941.406 ns | 1.000 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800113 B | 1.000 | -| Actual | Create_WithCapacity | List | RecyclableList | 850000 | 28.988 ns | 0.0957 ns | 0.0848 ns | 28.985 ns | 0.000 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 0 | 8.641 ns | 0.1799 ns | 0.1683 ns | 8.567 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 0 | 16.675 ns | 0.0816 ns | 0.0724 ns | 16.657 ns | 1.94 | 0.03 | 0.0382 | - | - | 80 B | 2.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 1 | 11.506 ns | 0.0147 ns | 0.0123 ns | 11.503 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 1 | 29.047 ns | 0.1217 ns | 0.1016 ns | 29.028 ns | 2.52 | 0.01 | 0.0688 | - | - | 144 B | 2.25 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 2 | 11.791 ns | 0.0239 ns | 0.0224 ns | 11.784 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 2 | 29.615 ns | 0.1361 ns | 0.1206 ns | 29.622 ns | 2.51 | 0.01 | 0.0727 | - | - | 152 B | 2.11 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 3 | 11.952 ns | 0.0637 ns | 0.0565 ns | 11.950 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 3 | 30.131 ns | 0.2189 ns | 0.1940 ns | 30.117 ns | 2.52 | 0.02 | 0.0803 | - | - | 168 B | 2.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 4 | 12.282 ns | 0.0636 ns | 0.0595 ns | 12.248 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 4 | 30.828 ns | 0.2745 ns | 0.2567 ns | 30.743 ns | 2.51 | 0.03 | 0.0803 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 5 | 12.525 ns | 0.0186 ns | 0.0165 ns | 12.520 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 5 | 31.648 ns | 0.2236 ns | 0.2092 ns | 31.576 ns | 2.53 | 0.02 | 0.0956 | - | - | 200 B | 2.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 6 | 12.921 ns | 0.0307 ns | 0.0256 ns | 12.921 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 6 | 31.500 ns | 0.0995 ns | 0.0882 ns | 31.495 ns | 2.44 | 0.01 | 0.0956 | - | - | 200 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 7 | 13.165 ns | 0.0488 ns | 0.0407 ns | 13.154 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 7 | 31.508 ns | 0.2525 ns | 0.2238 ns | 31.529 ns | 2.39 | 0.02 | 0.0956 | - | - | 200 B | 1.79 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 8 | 13.364 ns | 0.0236 ns | 0.0209 ns | 13.366 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 8 | 32.238 ns | 0.2959 ns | 0.2471 ns | 32.220 ns | 2.41 | 0.02 | 0.0956 | - | - | 200 B | 1.67 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 9 | 13.484 ns | 0.0330 ns | 0.0309 ns | 13.482 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 9 | 33.752 ns | 0.5185 ns | 0.4850 ns | 33.546 ns | 2.50 | 0.03 | 0.1262 | - | - | 264 B | 2.06 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 10 | 13.865 ns | 0.0312 ns | 0.0277 ns | 13.857 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 10 | 33.121 ns | 0.5487 ns | 0.5133 ns | 33.074 ns | 2.39 | 0.04 | 0.1262 | - | - | 264 B | 1.94 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 11 | 14.326 ns | 0.0662 ns | 0.0587 ns | 14.309 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 11 | 33.160 ns | 0.5840 ns | 0.5463 ns | 32.932 ns | 2.32 | 0.04 | 0.1262 | - | - | 264 B | 1.83 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 12 | 14.550 ns | 0.0369 ns | 0.0327 ns | 14.540 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 12 | 33.213 ns | 0.5252 ns | 0.4913 ns | 33.228 ns | 2.28 | 0.03 | 0.1262 | - | - | 264 B | 1.74 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 13 | 14.884 ns | 0.0403 ns | 0.0337 ns | 14.873 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 13 | 34.242 ns | 0.7002 ns | 0.7783 ns | 34.615 ns | 2.29 | 0.05 | 0.1262 | - | - | 264 B | 1.65 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 14 | 15.208 ns | 0.0449 ns | 0.0398 ns | 15.204 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 14 | 33.231 ns | 0.6229 ns | 0.5826 ns | 33.077 ns | 2.19 | 0.04 | 0.1262 | - | - | 264 B | 1.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 15 | 15.484 ns | 0.0658 ns | 0.0514 ns | 15.493 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 15 | 33.510 ns | 0.5161 ns | 0.4575 ns | 33.307 ns | 2.17 | 0.03 | 0.1262 | - | - | 264 B | 1.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 16 | 15.512 ns | 0.1294 ns | 0.1210 ns | 15.574 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 16 | 34.181 ns | 0.7008 ns | 1.2990 ns | 33.818 ns | 2.22 | 0.11 | 0.1262 | - | - | 264 B | 1.43 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 17 | 16.013 ns | 0.0860 ns | 0.0762 ns | 15.992 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 17 | 37.798 ns | 0.1380 ns | 0.1223 ns | 37.818 ns | 2.36 | 0.01 | 0.1874 | - | - | 392 B | 2.04 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 18 | 16.060 ns | 0.0304 ns | 0.0270 ns | 16.059 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 18 | 38.251 ns | 0.4169 ns | 0.3900 ns | 38.144 ns | 2.38 | 0.02 | 0.1874 | - | - | 392 B | 1.96 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 19 | 16.508 ns | 0.0541 ns | 0.0423 ns | 16.502 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 19 | 39.055 ns | 0.7917 ns | 0.8472 ns | 38.831 ns | 2.36 | 0.05 | 0.1874 | - | - | 392 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 20 | 16.729 ns | 0.0531 ns | 0.0471 ns | 16.725 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 20 | 38.159 ns | 0.3399 ns | 0.3179 ns | 38.146 ns | 2.28 | 0.02 | 0.1874 | - | - | 392 B | 1.81 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 30 | 19.820 ns | 0.2157 ns | 0.1912 ns | 19.733 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 30 | 38.634 ns | 0.2544 ns | 0.2255 ns | 38.687 ns | 1.95 | 0.02 | 0.1874 | - | - | 392 B | 1.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 32 | 20.022 ns | 0.0943 ns | 0.0836 ns | 20.034 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 32 | 38.758 ns | 0.2123 ns | 0.1882 ns | 38.774 ns | 1.94 | 0.01 | 0.1874 | - | - | 392 B | 1.26 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 36 | 27.208 ns | 0.2772 ns | 0.2457 ns | 27.279 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 36 | 61.496 ns | 1.2087 ns | 1.1306 ns | 61.464 ns | 2.26 | 0.05 | 0.3098 | - | - | 648 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 37 | 27.537 ns | 0.3722 ns | 0.3482 ns | 27.531 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 37 | 61.433 ns | 0.9491 ns | 0.8878 ns | 61.194 ns | 2.23 | 0.05 | 0.3098 | - | - | 648 B | 1.84 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 40 | 28.330 ns | 0.5843 ns | 0.6955 ns | 28.032 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 40 | 28.585 ns | 0.5161 ns | 0.4827 ns | 28.796 ns | 1.00 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 40 | 61.108 ns | 0.6814 ns | 0.5690 ns | 60.823 ns | 2.14 | 0.07 | 0.3098 | - | - | 648 B | 1.72 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 40 | 62.167 ns | 1.2413 ns | 1.1611 ns | 62.343 ns | 2.18 | 0.05 | 0.3098 | - | - | 648 B | 1.72 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 50 | 33.311 ns | 0.6371 ns | 0.5959 ns | 33.070 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 50 | 61.894 ns | 1.1607 ns | 1.0857 ns | 61.574 ns | 1.86 | 0.05 | 0.3098 | - | - | 648 B | 1.42 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 60 | 37.306 ns | 0.4483 ns | 0.4193 ns | 37.300 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 60 | 62.291 ns | 0.9605 ns | 0.8985 ns | 62.322 ns | 1.67 | 0.03 | 0.3098 | - | - | 648 B | 1.21 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 70 | 41.206 ns | 0.7348 ns | 0.6873 ns | 41.165 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 70 | 91.764 ns | 1.2975 ns | 1.2137 ns | 91.984 ns | 2.23 | 0.06 | 0.5546 | - | - | 1160 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 80 | 45.392 ns | 0.8333 ns | 0.7795 ns | 45.526 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 80 | 90.164 ns | 1.0799 ns | 1.0102 ns | 90.655 ns | 1.99 | 0.05 | 0.5546 | - | - | 1160 B | 1.67 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 850000 | 656,947.360 ns | 17,787.5241 ns | 50,460.2454 ns | 636,222.461 ns | 1.00 | 0.00 | 123.0469 | 123.0469 | 123.0469 | 6800745 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 850000 | 1,496,298.889 ns | 43,206.4617 ns | 126,717.0728 ns | 1,494,900.391 ns | 2.27 | 0.25 | 119.1406 | 119.1406 | 119.1406 | 8389274 B | 1.23 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 90 | 48.629 ns | 0.6893 ns | 0.6448 ns | 48.563 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 90 | 88.859 ns | 1.1700 ns | 1.0944 ns | 89.597 ns | 1.83 | 0.04 | 0.5546 | - | - | 1160 B | 1.49 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 100 | 52.691 ns | 0.6591 ns | 0.6165 ns | 52.714 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 100 | 92.634 ns | 1.3756 ns | 1.2867 ns | 92.696 ns | 1.76 | 0.03 | 0.5546 | - | - | 1160 B | 1.36 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 128 | 62.371 ns | 1.0562 ns | 0.9880 ns | 62.038 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 128 | 90.946 ns | 1.0812 ns | 1.0114 ns | 91.301 ns | 1.46 | 0.03 | 0.5546 | - | - | 1160 B | 1.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 256 | 114.528 ns | 1.9599 ns | 1.8333 ns | 115.153 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 256 | 140.498 ns | 2.7854 ns | 2.6055 ns | 140.287 ns | 1.23 | 0.03 | 1.0438 | - | - | 2184 B | 1.04 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 512 | 210.072 ns | 4.1622 ns | 5.1115 ns | 210.196 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 512 | 239.950 ns | 1.8626 ns | 1.6511 ns | 240.120 ns | 1.13 | 0.03 | 2.0199 | - | - | 4232 B | 1.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 1024 | 406.188 ns | 7.9887 ns | 11.9571 ns | 402.896 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 1024 | 455.595 ns | 9.0528 ns | 14.8740 ns | 454.604 ns | 1.13 | 0.03 | 3.9840 | - | - | 8328 B | 1.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 2048 | 755.290 ns | 14.8358 ns | 13.8774 ns | 760.330 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 2048 | 821.697 ns | 14.4337 ns | 13.5013 ns | 823.052 ns | 1.09 | 0.03 | 7.8735 | - | - | 16520 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 4096 | 1,521.324 ns | 29.2983 ns | 27.4056 ns | 1,519.864 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 4096 | 1,539.423 ns | 28.8659 ns | 29.6432 ns | 1,540.028 ns | 1.01 | 0.02 | 15.6250 | - | - | 32904 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 8192 | 2,889.058 ns | 56.5863 ns | 79.3261 ns | 2,877.317 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 8192 | 2,982.358 ns | 57.8507 ns | 64.3009 ns | 2,997.111 ns | 1.03 | 0.03 | 31.2462 | - | - | 65672 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 16384 | 6,967.153 ns | 130.2541 ns | 127.9270 ns | 7,000.579 ns | 1.00 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131154 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 16384 | 6,318.139 ns | 124.8858 ns | 246.5123 ns | 6,184.764 ns | 0.90 | 0.04 | 62.4847 | 0.0153 | - | 131432 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 32768 | 12,260.303 ns | 226.3066 ns | 222.2634 ns | 12,298.917 ns | 1.00 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262251 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 32768 | 23,504.992 ns | 1,276.0641 ns | 3,762.5039 ns | 24,730.835 ns | 1.88 | 0.34 | 83.2825 | 27.7405 | - | 262504 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 65536 | 56,509.341 ns | 1,127.7672 ns | 1,788.7583 ns | 56,217.896 ns | 1.00 | 0.00 | 16.9067 | 16.7847 | 16.7847 | 524409 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 65536 | 59,968.457 ns | 2,929.5848 ns | 8,637.9469 ns | 55,217.700 ns | 1.10 | 0.16 | 150.0244 | 49.9268 | - | 524649 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Create_WithCapacity | List | RecyclableLongList | 131072 | 114,768.456 ns | 1,955.0600 ns | 1,632.5637 ns | 114,705.005 ns | 1.00 | 0.00 | 17.7002 | 17.5781 | 17.5781 | 1048680 B | 1.00 | -| Actual | Create_WithCapacity | List | RecyclableLongList | 131072 | 129,203.260 ns | 2,555.1942 ns | 3,745.3706 ns | 130,198.633 ns | 1.12 | 0.03 | 144.5313 | 143.3105 | 143.3105 | 1049772 B | 1.00 | -
- -# `Add` Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1848/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.305 - [Host] : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 -``` - -
-Add to the List by 1 Item Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------- |------------- |------------------- |---------------- |-----------------:|----------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|-----------:|------------:| -| Baseline | Add | List | Array | 0 | 8.033 ns | 0.0382 ns | 0.0339 ns | 8.023 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Add | List | Array | 0 | 6.741 ns | 0.0160 ns | 0.0142 ns | 6.741 ns | 0.84 | 0.00 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 1 | 17.455 ns | 0.0980 ns | 0.0916 ns | 17.423 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | Array | 1 | 7.369 ns | 0.0102 ns | 0.0090 ns | 7.370 ns | 0.42 | 0.00 | 0.0153 | - | - | 32 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 2 | 18.813 ns | 0.1189 ns | 0.1112 ns | 18.843 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | Array | 2 | 8.087 ns | 0.1802 ns | 0.1686 ns | 8.061 ns | 0.43 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 3 | 20.091 ns | 0.0246 ns | 0.0205 ns | 20.094 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | Array | 3 | 9.195 ns | 0.1377 ns | 0.1221 ns | 9.222 ns | 0.46 | 0.01 | 0.0229 | - | - | 48 B | 0.55 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 4 | 21.729 ns | 0.2308 ns | 0.2159 ns | 21.673 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | Array | 4 | 9.084 ns | 0.0479 ns | 0.0448 ns | 9.062 ns | 0.42 | 0.00 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 5 | 36.580 ns | 0.2406 ns | 0.2250 ns | 36.483 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | Array | 5 | 11.402 ns | 0.2552 ns | 0.5438 ns | 11.540 ns | 0.31 | 0.02 | 0.0306 | - | - | 64 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 6 | 37.636 ns | 0.3012 ns | 0.2670 ns | 37.529 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | Array | 6 | 11.036 ns | 0.2219 ns | 0.2076 ns | 10.944 ns | 0.29 | 0.01 | 0.0344 | - | - | 72 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 7 | 39.535 ns | 0.8012 ns | 1.0133 ns | 38.880 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | Array | 7 | 12.411 ns | 0.2758 ns | 0.4830 ns | 12.560 ns | 0.32 | 0.02 | 0.0383 | - | - | 80 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 8 | 40.353 ns | 0.0906 ns | 0.0803 ns | 40.361 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | Array | 8 | 11.993 ns | 0.0298 ns | 0.0264 ns | 11.995 ns | 0.30 | 0.00 | 0.0421 | - | - | 88 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 9 | 56.600 ns | 0.0942 ns | 0.0835 ns | 56.582 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 9 | 12.769 ns | 0.1302 ns | 0.1154 ns | 12.724 ns | 0.23 | 0.00 | 0.0459 | - | - | 96 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 10 | 57.839 ns | 0.0755 ns | 0.0589 ns | 57.832 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 10 | 13.175 ns | 0.0206 ns | 0.0161 ns | 13.177 ns | 0.23 | 0.00 | 0.0497 | - | - | 104 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 11 | 58.288 ns | 0.1512 ns | 0.1415 ns | 58.341 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 11 | 13.790 ns | 0.1009 ns | 0.0894 ns | 13.759 ns | 0.24 | 0.00 | 0.0536 | - | - | 112 B | 0.34 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 12 | 59.575 ns | 0.6993 ns | 0.5839 ns | 59.379 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 12 | 14.724 ns | 0.0201 ns | 0.0188 ns | 14.726 ns | 0.25 | 0.00 | 0.0574 | - | - | 120 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 13 | 60.561 ns | 0.1263 ns | 0.1181 ns | 60.518 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 13 | 14.858 ns | 0.0357 ns | 0.0316 ns | 14.855 ns | 0.25 | 0.00 | 0.0612 | - | - | 128 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 14 | 62.597 ns | 0.1452 ns | 0.1287 ns | 62.546 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 14 | 15.422 ns | 0.0164 ns | 0.0145 ns | 15.418 ns | 0.25 | 0.00 | 0.0650 | - | - | 136 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 15 | 62.490 ns | 0.1796 ns | 0.1592 ns | 62.422 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 15 | 16.053 ns | 0.0252 ns | 0.0223 ns | 16.050 ns | 0.26 | 0.00 | 0.0688 | - | - | 144 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 16 | 63.315 ns | 0.1435 ns | 0.1272 ns | 63.303 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | Array | 16 | 16.534 ns | 0.0716 ns | 0.0670 ns | 16.541 ns | 0.26 | 0.00 | 0.0727 | - | - | 152 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 17 | 87.500 ns | 0.2475 ns | 0.2315 ns | 87.514 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | Array | 17 | 17.084 ns | 0.1716 ns | 0.1606 ns | 17.092 ns | 0.20 | 0.00 | 0.0765 | - | - | 160 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 18 | 89.031 ns | 0.5091 ns | 0.4762 ns | 88.915 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | Array | 18 | 17.642 ns | 0.1828 ns | 0.1710 ns | 17.588 ns | 0.20 | 0.00 | 0.0803 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 19 | 89.654 ns | 0.7483 ns | 0.6999 ns | 89.320 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | Array | 19 | 18.101 ns | 0.0776 ns | 0.0688 ns | 18.088 ns | 0.20 | 0.00 | 0.0842 | - | - | 176 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 20 | 90.061 ns | 0.1295 ns | 0.1211 ns | 90.023 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | Array | 20 | 18.400 ns | 0.0403 ns | 0.0336 ns | 18.394 ns | 0.20 | 0.00 | 0.0880 | - | - | 184 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 30 | 104.068 ns | 0.0708 ns | 0.0627 ns | 104.084 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | Array | 30 | 25.608 ns | 0.1295 ns | 0.1148 ns | 25.633 ns | 0.25 | 0.00 | 0.1262 | - | - | 264 B | 0.43 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 32 | 108.695 ns | 0.1806 ns | 0.1601 ns | 108.655 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | Array | 32 | 24.860 ns | 0.1925 ns | 0.1801 ns | 24.795 ns | 0.23 | 0.00 | 0.1339 | - | - | 280 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 36 | 138.552 ns | 0.7358 ns | 0.6883 ns | 138.185 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | Array | 36 | 27.468 ns | 0.1945 ns | 0.1518 ns | 27.473 ns | 0.20 | 0.00 | 0.1492 | - | - | 312 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 37 | 142.248 ns | 0.2908 ns | 0.2578 ns | 142.181 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | Array | 37 | 27.628 ns | 0.0348 ns | 0.0309 ns | 27.627 ns | 0.19 | 0.00 | 0.1530 | - | - | 320 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 40 | 142.819 ns | 0.4148 ns | 0.3677 ns | 142.795 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Baseline | Add | List | Array | 40 | 146.721 ns | 0.2889 ns | 0.2412 ns | 146.835 ns | 1.03 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | Array | 40 | 29.512 ns | 0.1310 ns | 0.1161 ns | 29.535 ns | 0.21 | 0.00 | 0.1644 | - | - | 344 B | 0.30 | -| Actual | Add | List | Array | 40 | 29.541 ns | 0.0862 ns | 0.0764 ns | 29.555 ns | 0.21 | 0.00 | 0.1644 | - | - | 344 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 50 | 164.659 ns | 0.2573 ns | 0.2148 ns | 164.684 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | Array | 50 | 34.893 ns | 0.0448 ns | 0.0419 ns | 34.898 ns | 0.21 | 0.00 | 0.2027 | - | - | 424 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 60 | 180.790 ns | 0.2945 ns | 0.2299 ns | 180.719 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | Array | 60 | 40.447 ns | 0.1116 ns | 0.0932 ns | 40.417 ns | 0.22 | 0.00 | 0.2410 | - | - | 504 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 70 | 238.612 ns | 0.7258 ns | 0.6434 ns | 238.608 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | Array | 70 | 46.006 ns | 0.0326 ns | 0.0289 ns | 46.000 ns | 0.19 | 0.00 | 0.2792 | - | - | 584 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 80 | 259.791 ns | 0.6094 ns | 0.5700 ns | 259.671 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | Array | 80 | 51.788 ns | 0.0679 ns | 0.0602 ns | 51.788 ns | 0.20 | 0.00 | 0.3175 | - | - | 664 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 90 | 276.018 ns | 0.8256 ns | 0.7722 ns | 276.131 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | Array | 90 | 64.024 ns | 0.0708 ns | 0.0627 ns | 64.020 ns | 0.23 | 0.00 | 0.3557 | - | - | 744 B | 0.34 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 100 | 294.046 ns | 0.1864 ns | 0.1652 ns | 294.023 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | Array | 100 | 69.580 ns | 0.2511 ns | 0.2226 ns | 69.481 ns | 0.24 | 0.00 | 0.3940 | - | - | 824 B | 0.38 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 128 | 369.921 ns | 1.6578 ns | 1.5507 ns | 369.718 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | Array | 128 | 84.133 ns | 0.3742 ns | 0.3500 ns | 84.247 ns | 0.23 | 0.00 | 0.5009 | - | - | 1048 B | 0.48 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 256 | 658.121 ns | 8.3863 ns | 7.8445 ns | 657.285 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | -| Actual | Add | List | Array | 256 | 152.324 ns | 0.2058 ns | 0.1824 ns | 152.311 ns | 0.23 | 0.00 | 0.9899 | - | - | 2072 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 512 | 1,259.055 ns | 12.1079 ns | 11.3258 ns | 1,260.961 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.00 | -| Actual | Add | List | Array | 512 | 298.602 ns | 0.5479 ns | 0.5125 ns | 298.526 ns | 0.24 | 0.00 | 1.9684 | - | - | 4120 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 1024 | 2,447.643 ns | 4.3201 ns | 3.8297 ns | 2,447.211 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.00 | -| Actual | Add | List | Array | 1024 | 602.886 ns | 1.0941 ns | 0.9136 ns | 602.778 ns | 0.25 | 0.00 | 3.9215 | - | - | 8216 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 2048 | 4,773.429 ns | 12.5602 ns | 10.4883 ns | 4,769.400 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.00 | -| Actual | Add | List | Array | 2048 | 1,153.119 ns | 1.1908 ns | 0.9944 ns | 1,153.070 ns | 0.24 | 0.00 | 7.8125 | - | - | 16408 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 4096 | 9,643.209 ns | 150.8823 ns | 161.4424 ns | 9,608.025 ns | 1.00 | 0.00 | 31.2347 | - | - | 65800 B | 1.00 | -| Actual | Add | List | Array | 4096 | 2,308.915 ns | 12.9740 ns | 11.5011 ns | 2,310.650 ns | 0.24 | 0.00 | 15.6250 | - | - | 32792 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 8192 | 19,006.731 ns | 40.6787 ns | 33.9686 ns | 19,005.428 ns | 1.00 | 0.00 | 62.4695 | - | - | 131360 B | 1.00 | -| Actual | Add | List | Array | 8192 | 4,544.546 ns | 14.7264 ns | 13.0546 ns | 4,546.077 ns | 0.24 | 0.00 | 31.2500 | - | - | 65560 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 16384 | 99,432.122 ns | 1,226.6540 ns | 1,147.4129 ns | 99,493.298 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262470 B | 1.00 | -| Actual | Add | List | Array | 16384 | 53,846.916 ns | 1,052.7723 ns | 1,700.0310 ns | 54,590.524 ns | 0.54 | 0.02 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 32768 | 238,603.364 ns | 2,097.2235 ns | 1,961.7442 ns | 238,871.558 ns | 1.00 | 0.00 | 124.7559 | 124.7559 | 124.7559 | 524666 B | 1.00 | -| Actual | Add | List | Array | 32768 | 107,921.938 ns | 2,080.3387 ns | 2,395.7212 ns | 108,853.857 ns | 0.45 | 0.01 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 65536 | 331,843.094 ns | 4,004.7558 ns | 3,746.0510 ns | 332,202.710 ns | 1.00 | 0.00 | 303.7109 | 239.2578 | 239.2578 | 1049482 B | 1.00 | -| Actual | Add | List | Array | 65536 | 124,833.178 ns | 719.7578 ns | 638.0466 ns | 124,786.945 ns | 0.38 | 0.00 | 121.0938 | 120.7275 | 120.7275 | 524348 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 131072 | 681,620.501 ns | 9,832.4499 ns | 9,197.2798 ns | 681,824.316 ns | 1.00 | 0.00 | 554.6875 | 489.2578 | 488.2813 | 2097724 B | 1.00 | -| Actual | Add | List | Array | 131072 | 295,837.488 ns | 5,844.6224 ns | 9,924.6123 ns | 296,832.471 ns | 0.43 | 0.02 | 185.5469 | 185.0586 | 185.0586 | 1048657 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | Array | 850000 | 5,070,303.125 ns | 95,643.4469 ns | 89,464.9395 ns | 5,092,130.469 ns | 1.00 | 0.00 | 390.6250 | 328.1250 | 328.1250 | 16777783 B | 1.00 | -| Actual | Add | List | Array | 850000 | 2,145,544.347 ns | 42,532.6308 ns | 43,677.8803 ns | 2,156,411.719 ns | 0.42 | 0.01 | 132.8125 | 132.8125 | 132.8125 | 6800069 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 0 | 7.700 ns | 0.0518 ns | 0.0484 ns | 7.690 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Add | List | PooledList | 0 | 11.361 ns | 0.0867 ns | 0.0811 ns | 11.328 ns | 1.48 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 1 | 17.634 ns | 0.1149 ns | 0.1075 ns | 17.581 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | PooledList | 1 | 40.997 ns | 0.1620 ns | 0.1265 ns | 40.975 ns | 2.33 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 2 | 19.008 ns | 0.0482 ns | 0.0403 ns | 19.005 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | PooledList | 2 | 42.086 ns | 0.2286 ns | 0.2027 ns | 42.022 ns | 2.21 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 3 | 20.428 ns | 0.1225 ns | 0.1146 ns | 20.476 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | PooledList | 3 | 43.049 ns | 0.2538 ns | 0.2250 ns | 43.000 ns | 2.11 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 4 | 21.819 ns | 0.1039 ns | 0.0972 ns | 21.795 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | PooledList | 4 | 44.171 ns | 0.0466 ns | 0.0413 ns | 44.158 ns | 2.02 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 5 | 37.121 ns | 0.1254 ns | 0.1111 ns | 37.120 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | PooledList | 5 | 45.232 ns | 0.1245 ns | 0.1040 ns | 45.230 ns | 1.22 | 0.00 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 6 | 38.119 ns | 0.1733 ns | 0.1536 ns | 38.110 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | PooledList | 6 | 46.498 ns | 0.1169 ns | 0.0976 ns | 46.470 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 7 | 39.653 ns | 0.1233 ns | 0.1093 ns | 39.699 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | PooledList | 7 | 47.585 ns | 0.1474 ns | 0.1379 ns | 47.581 ns | 1.20 | 0.00 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 8 | 40.778 ns | 0.1488 ns | 0.1391 ns | 40.774 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | PooledList | 8 | 48.619 ns | 0.0815 ns | 0.0723 ns | 48.618 ns | 1.19 | 0.00 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 9 | 57.638 ns | 0.1614 ns | 0.1510 ns | 57.589 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 9 | 50.105 ns | 0.0790 ns | 0.0659 ns | 50.118 ns | 0.87 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 10 | 57.500 ns | 0.5174 ns | 0.4040 ns | 57.424 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 10 | 51.045 ns | 0.0697 ns | 0.0618 ns | 51.064 ns | 0.89 | 0.01 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 11 | 58.915 ns | 0.1539 ns | 0.1285 ns | 58.883 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 11 | 52.316 ns | 0.2133 ns | 0.1995 ns | 52.297 ns | 0.89 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 12 | 60.451 ns | 0.1910 ns | 0.1595 ns | 60.429 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 12 | 53.234 ns | 0.2026 ns | 0.1895 ns | 53.156 ns | 0.88 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 13 | 60.929 ns | 0.2336 ns | 0.1950 ns | 60.947 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 13 | 54.696 ns | 0.6139 ns | 0.5442 ns | 54.554 ns | 0.90 | 0.01 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 14 | 62.398 ns | 0.2811 ns | 0.2348 ns | 62.288 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 14 | 55.769 ns | 0.1017 ns | 0.0850 ns | 55.783 ns | 0.89 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 15 | 64.183 ns | 1.2920 ns | 1.3824 ns | 63.752 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 15 | 57.072 ns | 0.3578 ns | 0.3347 ns | 56.949 ns | 0.89 | 0.02 | 0.0268 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 16 | 65.284 ns | 0.6517 ns | 0.6096 ns | 64.837 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | PooledList | 16 | 57.888 ns | 0.5176 ns | 0.4841 ns | 57.652 ns | 0.89 | 0.01 | 0.0267 | - | - | 56 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 17 | 88.115 ns | 0.5236 ns | 0.4898 ns | 87.932 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | PooledList | 17 | 91.222 ns | 0.5085 ns | 0.4756 ns | 91.004 ns | 1.04 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 18 | 89.468 ns | 0.4826 ns | 0.4514 ns | 89.423 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | PooledList | 18 | 92.830 ns | 0.5198 ns | 0.4862 ns | 92.749 ns | 1.04 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 19 | 91.125 ns | 1.7199 ns | 1.5247 ns | 91.011 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | PooledList | 19 | 95.217 ns | 0.4741 ns | 0.3959 ns | 95.223 ns | 1.04 | 0.02 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 20 | 91.012 ns | 0.2337 ns | 0.2072 ns | 91.017 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | PooledList | 20 | 95.837 ns | 0.7139 ns | 0.6678 ns | 96.027 ns | 1.05 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 30 | 105.551 ns | 0.3321 ns | 0.2944 ns | 105.441 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | PooledList | 30 | 106.289 ns | 0.7819 ns | 0.7314 ns | 106.239 ns | 1.01 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 32 | 109.594 ns | 0.4618 ns | 0.4094 ns | 109.500 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | PooledList | 32 | 107.351 ns | 0.2386 ns | 0.2232 ns | 107.352 ns | 0.98 | 0.00 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 36 | 138.412 ns | 0.2950 ns | 0.2615 ns | 138.363 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | PooledList | 36 | 147.774 ns | 0.8643 ns | 0.6748 ns | 147.659 ns | 1.07 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 37 | 142.823 ns | 0.3153 ns | 0.2949 ns | 142.731 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | PooledList | 37 | 148.741 ns | 2.6124 ns | 2.1814 ns | 148.167 ns | 1.04 | 0.02 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 40 | 143.066 ns | 0.8261 ns | 0.7727 ns | 142.829 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Baseline | Add | List | PooledList | 40 | 143.745 ns | 0.7424 ns | 0.6945 ns | 143.494 ns | 1.00 | 0.01 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | PooledList | 40 | 151.610 ns | 0.5251 ns | 0.4100 ns | 151.646 ns | 1.06 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| Actual | Add | List | PooledList | 40 | 154.915 ns | 3.0876 ns | 4.7150 ns | 152.163 ns | 1.09 | 0.03 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 50 | 164.814 ns | 0.3968 ns | 0.3518 ns | 164.858 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | PooledList | 50 | 164.625 ns | 1.5734 ns | 1.2284 ns | 164.346 ns | 1.00 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 60 | 184.427 ns | 0.8978 ns | 0.8398 ns | 184.338 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | PooledList | 60 | 182.822 ns | 0.4111 ns | 0.3209 ns | 182.910 ns | 0.99 | 0.00 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 70 | 237.079 ns | 1.4282 ns | 1.1926 ns | 236.635 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | PooledList | 70 | 235.069 ns | 4.6215 ns | 5.5015 ns | 232.821 ns | 0.99 | 0.02 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 80 | 262.980 ns | 1.5282 ns | 1.3547 ns | 262.553 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | PooledList | 80 | 245.673 ns | 4.9301 ns | 4.6116 ns | 243.354 ns | 0.94 | 0.02 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 850000 | 5,502,952.108 ns | 109,243.5236 ns | 251,005.1623 ns | 5,454,132.031 ns | 1.00 | 0.00 | 539.0625 | 476.5625 | 476.5625 | 16777825 B | 1.000 | -| Actual | Add | List | PooledList | 850000 | 2,649,836.198 ns | 51,126.4933 ns | 60,862.4534 ns | 2,661,834.375 ns | 0.47 | 0.03 | - | - | - | 60 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 90 | 280.964 ns | 1.8658 ns | 1.7453 ns | 280.252 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | PooledList | 90 | 261.955 ns | 4.5450 ns | 4.2514 ns | 261.306 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 100 | 298.058 ns | 1.1116 ns | 0.9854 ns | 297.780 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | PooledList | 100 | 280.695 ns | 5.2956 ns | 4.9535 ns | 278.643 ns | 0.94 | 0.02 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 128 | 357.004 ns | 2.5621 ns | 2.2712 ns | 356.061 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | PooledList | 128 | 331.804 ns | 4.6908 ns | 4.3878 ns | 330.872 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 256 | 689.656 ns | 9.6686 ns | 8.5710 ns | 687.452 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | -| Actual | Add | List | PooledList | 256 | 583.558 ns | 8.5448 ns | 7.5748 ns | 582.324 ns | 0.85 | 0.02 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 512 | 1,297.035 ns | 6.9322 ns | 6.4844 ns | 1,297.570 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.000 | -| Actual | Add | List | PooledList | 512 | 1,061.203 ns | 6.0453 ns | 5.3590 ns | 1,061.295 ns | 0.82 | 0.01 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 1024 | 2,466.639 ns | 18.3824 ns | 17.1949 ns | 2,463.952 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.000 | -| Actual | Add | List | PooledList | 1024 | 1,990.787 ns | 7.5229 ns | 6.6688 ns | 1,988.413 ns | 0.81 | 0.01 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 2048 | 4,813.775 ns | 25.9190 ns | 22.9766 ns | 4,804.923 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.000 | -| Actual | Add | List | PooledList | 2048 | 3,888.997 ns | 27.9618 ns | 26.1555 ns | 3,876.038 ns | 0.81 | 0.01 | 0.0229 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 4096 | 9,600.058 ns | 45.5350 ns | 42.5934 ns | 9,583.844 ns | 1.00 | 0.00 | 31.2347 | - | - | 65800 B | 1.000 | -| Actual | Add | List | PooledList | 4096 | 7,635.909 ns | 35.6304 ns | 33.3287 ns | 7,642.136 ns | 0.80 | 0.00 | 0.0229 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 8192 | 19,131.735 ns | 121.6350 ns | 107.8262 ns | 19,122.871 ns | 1.00 | 0.00 | 62.4695 | - | - | 131360 B | 1.000 | -| Actual | Add | List | PooledList | 8192 | 15,130.284 ns | 45.8569 ns | 42.8945 ns | 15,143.172 ns | 0.79 | 0.01 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 16384 | 100,331.825 ns | 1,160.0969 ns | 1,085.1553 ns | 100,557.629 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262470 B | 1.000 | -| Actual | Add | List | PooledList | 16384 | 30,119.963 ns | 63.0163 ns | 55.8623 ns | 30,142.162 ns | 0.30 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 32768 | 241,285.522 ns | 1,233.0907 ns | 1,153.4338 ns | 241,714.429 ns | 1.00 | 0.00 | 124.7559 | 124.7559 | 124.7559 | 524666 B | 1.000 | -| Actual | Add | List | PooledList | 32768 | 60,602.320 ns | 178.4272 ns | 148.9948 ns | 60,550.781 ns | 0.25 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 65536 | 322,940.840 ns | 4,940.3438 ns | 4,621.2006 ns | 320,584.082 ns | 1.00 | 0.00 | 309.0820 | 244.6289 | 244.6289 | 1049281 B | 1.000 | -| Actual | Add | List | PooledList | 65536 | 123,522.166 ns | 626.4347 ns | 523.1014 ns | 123,385.669 ns | 0.38 | 0.01 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | PooledList | 131072 | 672,761.709 ns | 9,071.8768 ns | 8,485.8392 ns | 674,810.205 ns | 1.00 | 0.00 | 545.8984 | 480.4688 | 479.4922 | 2097698 B | 1.000 | -| Actual | Add | List | PooledList | 131072 | 252,269.259 ns | 3,874.8105 ns | 3,025.1971 ns | 251,411.523 ns | 0.38 | 0.01 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 0 | 8.018 ns | 0.0635 ns | 0.0594 ns | 8.041 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Add | List | RecyclableList | 0 | 15.321 ns | 0.1213 ns | 0.1075 ns | 15.313 ns | 1.91 | 0.02 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 1 | 17.505 ns | 0.1973 ns | 0.1846 ns | 17.392 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableList | 1 | 16.884 ns | 0.1091 ns | 0.1021 ns | 16.846 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 2 | 18.945 ns | 0.1441 ns | 0.1348 ns | 18.938 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableList | 2 | 18.200 ns | 0.1295 ns | 0.1148 ns | 18.167 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 3 | 20.424 ns | 0.2287 ns | 0.2027 ns | 20.416 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableList | 3 | 19.881 ns | 0.1207 ns | 0.1070 ns | 19.854 ns | 0.97 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 4 | 21.884 ns | 0.1471 ns | 0.1376 ns | 21.934 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableList | 4 | 21.007 ns | 0.1721 ns | 0.1610 ns | 21.013 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 5 | 36.817 ns | 0.0343 ns | 0.0268 ns | 36.825 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableList | 5 | 31.968 ns | 0.1603 ns | 0.1500 ns | 31.937 ns | 0.87 | 0.00 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 6 | 37.939 ns | 0.2612 ns | 0.2443 ns | 37.801 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableList | 6 | 33.506 ns | 0.1212 ns | 0.1134 ns | 33.501 ns | 0.88 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 7 | 39.472 ns | 0.3008 ns | 0.2512 ns | 39.405 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableList | 7 | 34.591 ns | 0.2516 ns | 0.2353 ns | 34.472 ns | 0.88 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 8 | 40.953 ns | 0.8000 ns | 0.9213 ns | 40.563 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableList | 8 | 35.592 ns | 0.1095 ns | 0.1024 ns | 35.617 ns | 0.87 | 0.02 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 9 | 57.107 ns | 0.1778 ns | 0.1485 ns | 57.045 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 9 | 49.302 ns | 0.1433 ns | 0.1197 ns | 49.311 ns | 0.86 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 10 | 58.241 ns | 0.1395 ns | 0.1165 ns | 58.278 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 10 | 50.815 ns | 0.2948 ns | 0.2757 ns | 50.779 ns | 0.87 | 0.01 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 11 | 59.210 ns | 0.1507 ns | 0.1259 ns | 59.211 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 11 | 51.965 ns | 0.1268 ns | 0.1059 ns | 51.959 ns | 0.88 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 12 | 60.599 ns | 0.2032 ns | 0.1696 ns | 60.592 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 12 | 52.909 ns | 0.1594 ns | 0.1331 ns | 52.903 ns | 0.87 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 13 | 61.049 ns | 0.0643 ns | 0.0570 ns | 61.036 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 13 | 54.339 ns | 0.0755 ns | 0.0669 ns | 54.331 ns | 0.89 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 14 | 62.358 ns | 0.1531 ns | 0.1357 ns | 62.400 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 14 | 56.144 ns | 0.1168 ns | 0.1036 ns | 56.163 ns | 0.90 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 15 | 63.530 ns | 0.0833 ns | 0.0779 ns | 63.521 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 15 | 57.851 ns | 0.1181 ns | 0.0986 ns | 57.847 ns | 0.91 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 16 | 65.093 ns | 0.1062 ns | 0.0942 ns | 65.074 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableList | 16 | 60.058 ns | 0.1210 ns | 0.1010 ns | 60.015 ns | 0.92 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 17 | 87.710 ns | 0.1417 ns | 0.1106 ns | 87.716 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableList | 17 | 77.522 ns | 0.5277 ns | 0.4678 ns | 77.457 ns | 0.88 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 18 | 89.182 ns | 0.5988 ns | 0.5601 ns | 88.895 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableList | 18 | 79.010 ns | 0.5328 ns | 0.4984 ns | 78.897 ns | 0.89 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 19 | 90.497 ns | 0.1709 ns | 0.1515 ns | 90.499 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableList | 19 | 79.987 ns | 0.4227 ns | 0.3954 ns | 79.921 ns | 0.88 | 0.00 | 0.2984 | - | - | 624 B | 1.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 20 | 91.573 ns | 0.5269 ns | 0.4929 ns | 91.608 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableList | 20 | 81.727 ns | 0.3712 ns | 0.2898 ns | 81.655 ns | 0.89 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 30 | 106.617 ns | 0.8215 ns | 0.7282 ns | 106.293 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableList | 30 | 100.859 ns | 0.7713 ns | 0.7215 ns | 100.567 ns | 0.95 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 32 | 110.048 ns | 0.7183 ns | 0.6367 ns | 109.706 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableList | 32 | 104.524 ns | 0.7240 ns | 0.6418 ns | 104.221 ns | 0.95 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 36 | 140.719 ns | 0.9997 ns | 0.8862 ns | 140.767 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableList | 36 | 141.169 ns | 1.1777 ns | 1.0440 ns | 140.722 ns | 1.00 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 37 | 165.637 ns | 1.2722 ns | 1.1900 ns | 165.963 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableList | 37 | 144.659 ns | 1.0143 ns | 0.9488 ns | 144.322 ns | 0.87 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 40 | 165.237 ns | 1.3832 ns | 1.1550 ns | 165.132 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Baseline | Add | List | RecyclableList | 40 | 163.664 ns | 1.1046 ns | 1.0332 ns | 163.838 ns | 0.99 | 0.01 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableList | 40 | 146.470 ns | 0.7366 ns | 0.6891 ns | 146.541 ns | 0.89 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | -| Actual | Add | List | RecyclableList | 40 | 148.296 ns | 1.7024 ns | 1.5924 ns | 148.417 ns | 0.90 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 50 | 187.073 ns | 1.0599 ns | 0.9396 ns | 187.414 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableList | 50 | 166.848 ns | 1.1393 ns | 1.0657 ns | 166.792 ns | 0.89 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 60 | 206.552 ns | 1.3124 ns | 1.2276 ns | 206.420 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableList | 60 | 188.599 ns | 0.7523 ns | 0.6669 ns | 188.579 ns | 0.91 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 70 | 282.226 ns | 2.2872 ns | 2.1394 ns | 281.671 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableList | 70 | 233.285 ns | 0.9523 ns | 0.7952 ns | 233.157 ns | 0.83 | 0.01 | 0.3288 | - | - | 688 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 80 | 303.570 ns | 3.0719 ns | 2.8734 ns | 303.353 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableList | 80 | 252.410 ns | 0.6316 ns | 0.5274 ns | 252.398 ns | 0.83 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 90 | 323.372 ns | 3.8273 ns | 3.5801 ns | 323.331 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableList | 90 | 272.868 ns | 0.8681 ns | 0.7696 ns | 272.937 ns | 0.84 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 100 | 340.384 ns | 3.5274 ns | 3.2995 ns | 340.390 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableList | 100 | 295.380 ns | 0.7464 ns | 0.6982 ns | 295.373 ns | 0.87 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 128 | 413.742 ns | 3.3498 ns | 3.1334 ns | 413.403 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableList | 128 | 390.098 ns | 4.1294 ns | 3.8627 ns | 390.072 ns | 0.94 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 256 | 769.715 ns | 6.5688 ns | 6.1445 ns | 772.426 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | -| Actual | Add | List | RecyclableList | 256 | 699.225 ns | 5.7090 ns | 5.3402 ns | 698.463 ns | 0.91 | 0.01 | 0.3443 | - | - | 720 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 512 | 1,454.110 ns | 9.5587 ns | 8.9412 ns | 1,455.582 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.00 | -| Actual | Add | List | RecyclableList | 512 | 1,319.050 ns | 6.4715 ns | 6.0535 ns | 1,319.357 ns | 0.91 | 0.01 | 0.3586 | - | - | 752 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 1024 | 2,790.613 ns | 23.3264 ns | 21.8195 ns | 2,791.224 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.00 | -| Actual | Add | List | RecyclableList | 1024 | 2,516.359 ns | 10.4172 ns | 9.7443 ns | 2,511.535 ns | 0.90 | 0.01 | 0.3738 | - | - | 784 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 2048 | 5,452.530 ns | 43.7569 ns | 40.9302 ns | 5,451.658 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.00 | -| Actual | Add | List | RecyclableList | 2048 | 4,858.333 ns | 6.0045 ns | 4.6879 ns | 4,858.583 ns | 0.89 | 0.01 | 0.3891 | - | - | 816 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 4096 | 10,978.421 ns | 133.3892 ns | 118.2461 ns | 10,949.155 ns | 1.00 | 0.00 | 31.2500 | - | - | 65800 B | 1.00 | -| Actual | Add | List | RecyclableList | 4096 | 9,442.868 ns | 27.8393 ns | 26.0409 ns | 9,437.257 ns | 0.86 | 0.01 | 0.3967 | - | - | 848 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 8192 | 21,623.674 ns | 203.4720 ns | 190.3278 ns | 21,642.752 ns | 1.00 | 0.00 | 62.4695 | - | - | 131360 B | 1.000 | -| Actual | Add | List | RecyclableList | 8192 | 18,582.662 ns | 11.4299 ns | 10.6916 ns | 18,582.411 ns | 0.86 | 0.01 | 0.3967 | - | - | 880 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 16384 | 107,337.902 ns | 773.4862 ns | 685.6754 ns | 107,384.119 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262484 B | 1.000 | -| Actual | Add | List | RecyclableList | 16384 | 36,961.097 ns | 80.2025 ns | 75.0215 ns | 36,943.439 ns | 0.34 | 0.00 | 0.4272 | - | - | 913 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 32768 | 251,240.365 ns | 4,851.9535 ns | 4,538.5203 ns | 252,014.453 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524705 B | 1.000 | -| Actual | Add | List | RecyclableList | 32768 | 74,149.835 ns | 64.1453 ns | 53.5643 ns | 74,154.578 ns | 0.30 | 0.01 | 0.3662 | - | - | 945 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 65536 | 349,929.362 ns | 6,402.9722 ns | 7,622.2829 ns | 347,623.926 ns | 1.00 | 0.00 | 301.2695 | 237.3047 | 236.8164 | 1049520 B | 1.000 | -| Actual | Add | List | RecyclableList | 65536 | 149,080.693 ns | 652.7460 ns | 610.5790 ns | 149,109.790 ns | 0.43 | 0.01 | 0.2441 | - | - | 978 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 131072 | 713,644.505 ns | 10,223.0035 ns | 9,562.6038 ns | 715,050.684 ns | 1.00 | 0.00 | 509.7656 | 443.3594 | 443.3594 | 2097844 B | 1.000 | -| Actual | Add | List | RecyclableList | 131072 | 305,267.419 ns | 1,794.1951 ns | 1,678.2912 ns | 304,732.324 ns | 0.43 | 0.01 | 0.4883 | - | - | 1011 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableList | 850000 | 5,691,174.211 ns | 123,156.7249 ns | 355,335.3105 ns | 5,633,410.547 ns | 1.00 | 0.00 | 492.1875 | 429.6875 | 429.6875 | 16778027 B | 1.000 | -| Actual | Add | List | RecyclableList | 850000 | 2,787,265.202 ns | 9,531.4846 ns | 7,441.5563 ns | 2,788,524.805 ns | 0.47 | 0.04 | - | - | - | 1131 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 0 | 8.384 ns | 0.0586 ns | 0.0548 ns | 8.385 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 0 | 20.286 ns | 0.1347 ns | 0.1260 ns | 20.329 ns | 2.42 | 0.02 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 1 | 19.945 ns | 0.0993 ns | 0.0880 ns | 19.927 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 1 | 75.415 ns | 0.7266 ns | 0.6441 ns | 75.418 ns | 3.78 | 0.03 | 0.0802 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 2 | 20.675 ns | 0.2710 ns | 0.2263 ns | 20.583 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 2 | 86.717 ns | 1.7452 ns | 3.6429 ns | 88.205 ns | 4.18 | 0.24 | 0.0802 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 3 | 22.080 ns | 0.1019 ns | 0.0903 ns | 22.083 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 3 | 81.541 ns | 0.5248 ns | 0.4909 ns | 81.553 ns | 3.69 | 0.02 | 0.0802 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 4 | 23.371 ns | 0.1231 ns | 0.1091 ns | 23.346 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 4 | 85.006 ns | 0.4883 ns | 0.4328 ns | 85.106 ns | 3.64 | 0.02 | 0.0802 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 5 | 39.838 ns | 0.3306 ns | 0.3092 ns | 39.769 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 5 | 86.063 ns | 0.4371 ns | 0.3875 ns | 86.100 ns | 2.16 | 0.02 | 0.0802 | - | - | 168 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 6 | 41.861 ns | 0.8162 ns | 0.7634 ns | 41.752 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 6 | 88.275 ns | 0.6796 ns | 0.6357 ns | 88.154 ns | 2.11 | 0.04 | 0.0802 | - | - | 168 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 7 | 42.661 ns | 0.3107 ns | 0.2755 ns | 42.653 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 7 | 88.562 ns | 0.8110 ns | 0.7586 ns | 88.311 ns | 2.08 | 0.02 | 0.0802 | - | - | 168 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 8 | 44.020 ns | 0.3425 ns | 0.3203 ns | 43.993 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 8 | 92.595 ns | 0.7985 ns | 0.7469 ns | 92.489 ns | 2.10 | 0.03 | 0.0802 | - | - | 168 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 9 | 63.325 ns | 0.4171 ns | 0.3483 ns | 63.263 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 9 | 94.618 ns | 0.8370 ns | 0.6989 ns | 94.378 ns | 1.49 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 10 | 63.525 ns | 0.5032 ns | 0.4707 ns | 63.491 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 10 | 95.573 ns | 1.2717 ns | 1.1273 ns | 95.691 ns | 1.50 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 11 | 65.088 ns | 0.2576 ns | 0.2284 ns | 65.136 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 11 | 97.291 ns | 1.2254 ns | 1.0863 ns | 97.596 ns | 1.49 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 12 | 65.883 ns | 0.4009 ns | 0.3750 ns | 65.677 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 12 | 99.850 ns | 1.4821 ns | 1.3863 ns | 99.570 ns | 1.52 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 13 | 67.287 ns | 0.5276 ns | 0.4935 ns | 67.157 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 13 | 96.432 ns | 1.4651 ns | 1.3704 ns | 96.270 ns | 1.43 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 14 | 68.172 ns | 0.5728 ns | 0.5358 ns | 67.977 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 14 | 103.185 ns | 0.9583 ns | 0.8496 ns | 103.187 ns | 1.51 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 15 | 69.322 ns | 0.5185 ns | 0.4850 ns | 69.103 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 15 | 105.456 ns | 1.5842 ns | 1.4819 ns | 104.964 ns | 1.52 | 0.03 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 16 | 73.778 ns | 0.3225 ns | 0.2693 ns | 73.839 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 16 | 102.235 ns | 0.6084 ns | 0.5691 ns | 102.039 ns | 1.38 | 0.01 | 0.0802 | - | - | 168 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 17 | 101.380 ns | 0.5631 ns | 0.4992 ns | 101.314 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 17 | 107.447 ns | 0.9613 ns | 0.8522 ns | 107.407 ns | 1.06 | 0.01 | 0.0802 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 18 | 100.839 ns | 1.2064 ns | 1.1285 ns | 101.071 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 18 | 117.190 ns | 0.6547 ns | 0.5803 ns | 117.167 ns | 1.16 | 0.01 | 0.0801 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 19 | 102.415 ns | 0.7294 ns | 0.6823 ns | 102.515 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 19 | 112.592 ns | 1.8827 ns | 1.5721 ns | 112.661 ns | 1.10 | 0.01 | 0.0802 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 20 | 104.456 ns | 0.8894 ns | 0.7427 ns | 104.565 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 20 | 114.310 ns | 1.6334 ns | 1.5279 ns | 113.937 ns | 1.09 | 0.02 | 0.0802 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 30 | 116.928 ns | 1.2475 ns | 1.1059 ns | 117.115 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 30 | 136.558 ns | 1.4824 ns | 1.1574 ns | 136.480 ns | 1.17 | 0.01 | 0.0801 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 32 | 122.223 ns | 1.5140 ns | 1.4162 ns | 121.981 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 32 | 140.096 ns | 1.5823 ns | 1.4800 ns | 139.502 ns | 1.15 | 0.02 | 0.0801 | - | - | 168 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 36 | 167.399 ns | 1.2763 ns | 1.1314 ns | 167.352 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 36 | 151.458 ns | 1.2939 ns | 1.0805 ns | 151.263 ns | 0.90 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 37 | 166.487 ns | 1.3446 ns | 1.2577 ns | 166.490 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 37 | 148.684 ns | 1.1163 ns | 1.0441 ns | 148.635 ns | 0.89 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 40 | 171.411 ns | 1.3932 ns | 1.3032 ns | 171.491 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Baseline | Add | List | RecyclableLongList | 40 | 170.678 ns | 1.0280 ns | 0.8584 ns | 170.616 ns | 0.99 | 0.01 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 40 | 160.982 ns | 3.1009 ns | 2.9006 ns | 160.767 ns | 0.94 | 0.02 | 0.0801 | - | - | 168 B | 0.15 | -| Actual | Add | List | RecyclableLongList | 40 | 158.266 ns | 1.3493 ns | 1.1961 ns | 157.868 ns | 0.92 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 50 | 190.604 ns | 1.6177 ns | 1.4340 ns | 190.519 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 50 | 176.708 ns | 0.7675 ns | 0.6803 ns | 176.419 ns | 0.93 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 60 | 202.190 ns | 1.1529 ns | 1.0784 ns | 202.013 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 60 | 195.592 ns | 1.2406 ns | 1.1605 ns | 195.428 ns | 0.97 | 0.01 | 0.0803 | - | - | 168 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 70 | 307.900 ns | 2.7589 ns | 2.5806 ns | 307.326 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 70 | 225.753 ns | 4.3330 ns | 4.0531 ns | 227.051 ns | 0.73 | 0.01 | 0.0803 | - | - | 168 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 80 | 310.387 ns | 2.7944 ns | 2.6139 ns | 310.585 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 80 | 236.602 ns | 1.2262 ns | 1.1470 ns | 236.519 ns | 0.76 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 850000 | 6,072,369.318 ns | 131,841.0199 ns | 386,666.8889 ns | 5,984,771.875 ns | 1.00 | 0.00 | 429.6875 | 367.1875 | 367.1875 | 16777946 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 850000 | 1,873,637.614 ns | 4,899.0291 ns | 3,824.8396 ns | 1,874,461.719 ns | 0.31 | 0.02 | - | - | - | 2825 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 90 | 318.684 ns | 1.6344 ns | 1.4488 ns | 319.152 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 90 | 260.669 ns | 1.2020 ns | 1.0655 ns | 260.664 ns | 0.82 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 100 | 340.245 ns | 2.2885 ns | 2.0287 ns | 340.484 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 100 | 286.495 ns | 4.7764 ns | 4.4678 ns | 287.602 ns | 0.84 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 128 | 402.997 ns | 1.9360 ns | 1.7162 ns | 402.963 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 128 | 335.931 ns | 1.0648 ns | 0.9439 ns | 335.987 ns | 0.83 | 0.00 | 0.0801 | - | - | 168 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 256 | 749.888 ns | 4.1337 ns | 3.6644 ns | 750.326 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 256 | 598.397 ns | 2.7117 ns | 2.5365 ns | 597.495 ns | 0.80 | 0.01 | 0.0801 | - | - | 168 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 512 | 1,424.823 ns | 13.4170 ns | 12.5503 ns | 1,420.054 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 512 | 1,132.464 ns | 9.1077 ns | 8.5194 ns | 1,132.185 ns | 0.79 | 0.01 | 0.0801 | - | - | 168 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 1024 | 2,805.018 ns | 26.7196 ns | 24.9935 ns | 2,805.138 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.00 | -| Actual | Add | List | RecyclableLongList | 1024 | 2,168.837 ns | 16.7577 ns | 15.6752 ns | 2,165.421 ns | 0.77 | 0.01 | 0.0801 | - | - | 168 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 2048 | 5,450.196 ns | 51.7338 ns | 48.3919 ns | 5,448.576 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 2048 | 4,262.713 ns | 21.8398 ns | 20.4290 ns | 4,257.209 ns | 0.78 | 0.01 | 0.0763 | - | - | 168 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 4096 | 10,931.953 ns | 104.4226 ns | 97.6769 ns | 10,917.020 ns | 1.00 | 0.00 | 31.2500 | - | - | 65800 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 4096 | 8,432.594 ns | 46.1496 ns | 43.1684 ns | 8,411.736 ns | 0.77 | 0.01 | 0.0763 | - | - | 168 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 8192 | 21,790.080 ns | 211.6645 ns | 176.7494 ns | 21,748.680 ns | 1.00 | 0.00 | 62.5000 | - | - | 131360 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 8192 | 16,723.234 ns | 64.9072 ns | 60.7142 ns | 16,709.587 ns | 0.77 | 0.01 | 0.0610 | - | - | 168 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 16384 | 106,955.108 ns | 476.2849 ns | 445.5172 ns | 106,953.467 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262484 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 16384 | 33,326.477 ns | 108.5087 ns | 90.6097 ns | 33,307.654 ns | 0.31 | 0.00 | 0.0610 | - | - | 168 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 32768 | 253,442.934 ns | 4,982.4340 ns | 5,116.5929 ns | 253,667.578 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524705 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 32768 | 66,746.580 ns | 172.8757 ns | 161.7081 ns | 66,713.220 ns | 0.26 | 0.01 | - | - | - | 241 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 65536 | 362,559.577 ns | 2,808.7409 ns | 2,627.2980 ns | 362,701.416 ns | 1.00 | 0.00 | 291.0156 | 226.5625 | 226.5625 | 1049747 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 65536 | 134,241.703 ns | 201.6205 ns | 178.7313 ns | 134,241.565 ns | 0.37 | 0.00 | - | - | - | 362 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add | List | RecyclableLongList | 131072 | 719,800.008 ns | 8,096.2811 ns | 6,760.7614 ns | 719,142.285 ns | 1.00 | 0.00 | 488.2813 | 422.8516 | 422.8516 | 2097801 B | 1.000 | -| Actual | Add | List | RecyclableLongList | 131072 | 268,224.823 ns | 656.9567 ns | 548.5886 ns | 268,183.203 ns | 0.37 | 0.00 | - | - | - | 579 B | 0.000 | -
- -# `Add` with Pre-Initialized Capacity Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1848/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.305 - [Host] : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 -``` -
-Add to the List by 1 Item with Pre-Initialized Capacity Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |----------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | Add_WithCapacity | List | PooledList | 1 | 12.67 ns | 0.026 ns | 0.023 ns | 12.67 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 1 | 37.65 ns | 0.292 ns | 0.273 ns | 37.60 ns | 2.97 | 0.02 | 0.0268 | - | - | 56 B | 0.88 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 2 | 14.45 ns | 0.035 ns | 0.033 ns | 14.45 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 2 | 39.54 ns | 0.555 ns | 0.519 ns | 39.63 ns | 2.74 | 0.03 | 0.0268 | - | - | 56 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 3 | 16.02 ns | 0.077 ns | 0.060 ns | 16.04 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 3 | 40.50 ns | 0.524 ns | 0.490 ns | 40.47 ns | 2.53 | 0.03 | 0.0268 | - | - | 56 B | 0.70 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 4 | 17.76 ns | 0.114 ns | 0.107 ns | 17.80 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 4 | 41.85 ns | 0.338 ns | 0.316 ns | 41.84 ns | 2.36 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 5 | 19.49 ns | 0.066 ns | 0.055 ns | 19.48 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 5 | 41.90 ns | 0.592 ns | 0.554 ns | 41.96 ns | 2.15 | 0.03 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 6 | 21.47 ns | 0.127 ns | 0.113 ns | 21.43 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 6 | 42.98 ns | 0.539 ns | 0.478 ns | 43.01 ns | 2.00 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 7 | 23.45 ns | 0.033 ns | 0.031 ns | 23.44 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 7 | 44.22 ns | 0.419 ns | 0.392 ns | 44.23 ns | 1.89 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 8 | 25.30 ns | 0.064 ns | 0.060 ns | 25.30 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 8 | 45.81 ns | 0.236 ns | 0.209 ns | 45.85 ns | 1.81 | 0.01 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 9 | 27.25 ns | 0.140 ns | 0.124 ns | 27.19 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 9 | 49.55 ns | 0.451 ns | 0.422 ns | 49.50 ns | 1.82 | 0.02 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 10 | 29.59 ns | 0.254 ns | 0.225 ns | 29.46 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 10 | 48.08 ns | 0.499 ns | 0.467 ns | 48.03 ns | 1.62 | 0.02 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 11 | 31.51 ns | 0.162 ns | 0.152 ns | 31.47 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 11 | 49.47 ns | 0.590 ns | 0.552 ns | 49.33 ns | 1.57 | 0.02 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 12 | 33.37 ns | 0.054 ns | 0.042 ns | 33.37 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 12 | 50.03 ns | 0.551 ns | 0.515 ns | 50.12 ns | 1.50 | 0.02 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 13 | 35.41 ns | 0.044 ns | 0.034 ns | 35.41 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 13 | 51.51 ns | 0.224 ns | 0.198 ns | 51.43 ns | 1.45 | 0.01 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 14 | 37.66 ns | 0.403 ns | 0.377 ns | 37.69 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 14 | 52.62 ns | 0.285 ns | 0.266 ns | 52.61 ns | 1.40 | 0.02 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 15 | 39.57 ns | 0.330 ns | 0.309 ns | 39.37 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 15 | 53.29 ns | 0.229 ns | 0.203 ns | 53.33 ns | 1.35 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 16 | 41.55 ns | 0.286 ns | 0.268 ns | 41.67 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 16 | 54.97 ns | 0.209 ns | 0.195 ns | 54.93 ns | 1.32 | 0.01 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 17 | 43.49 ns | 0.227 ns | 0.212 ns | 43.38 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 17 | 56.32 ns | 0.323 ns | 0.287 ns | 56.27 ns | 1.30 | 0.01 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 18 | 45.51 ns | 0.182 ns | 0.162 ns | 45.44 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 18 | 57.42 ns | 0.204 ns | 0.191 ns | 57.42 ns | 1.26 | 0.01 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 19 | 47.61 ns | 0.064 ns | 0.060 ns | 47.60 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 19 | 58.55 ns | 0.109 ns | 0.096 ns | 58.53 ns | 1.23 | 0.00 | 0.0267 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 20 | 49.74 ns | 0.081 ns | 0.072 ns | 49.75 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 20 | 60.37 ns | 0.122 ns | 0.108 ns | 60.38 ns | 1.21 | 0.00 | 0.0267 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 30 | 68.35 ns | 0.479 ns | 0.425 ns | 68.24 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 30 | 77.23 ns | 0.073 ns | 0.065 ns | 77.22 ns | 1.13 | 0.01 | 0.0267 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 32 | 68.81 ns | 0.192 ns | 0.180 ns | 68.83 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 32 | 81.33 ns | 0.131 ns | 0.109 ns | 81.31 ns | 1.18 | 0.00 | 0.0267 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 36 | 76.04 ns | 0.461 ns | 0.385 ns | 76.06 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 36 | 87.76 ns | 0.515 ns | 0.482 ns | 87.42 ns | 1.15 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 37 | 73.83 ns | 0.411 ns | 0.343 ns | 73.95 ns | 1.00 | 0.00 | 0.1682 | - | - | 352 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 37 | 88.70 ns | 0.336 ns | 0.314 ns | 88.59 ns | 1.20 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 40 | 78.43 ns | 0.505 ns | 0.472 ns | 78.39 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Add_WithCapacity | List | PooledList | 40 | 80.36 ns | 1.215 ns | 1.137 ns | 79.94 ns | 1.02 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 40 | 93.59 ns | 0.330 ns | 0.308 ns | 93.47 ns | 1.19 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | -| Actual | Add_WithCapacity | List | PooledList | 40 | 93.78 ns | 0.230 ns | 0.215 ns | 93.69 ns | 1.20 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 50 | 110.72 ns | 0.235 ns | 0.209 ns | 110.63 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 50 | 112.70 ns | 0.769 ns | 0.719 ns | 112.81 ns | 1.02 | 0.01 | 0.0267 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 60 | 131.06 ns | 0.480 ns | 0.449 ns | 130.90 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 60 | 129.83 ns | 0.731 ns | 0.683 ns | 129.93 ns | 0.99 | 0.01 | 0.0267 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 70 | 151.98 ns | 0.697 ns | 0.652 ns | 151.85 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 70 | 146.91 ns | 0.654 ns | 0.612 ns | 146.91 ns | 0.97 | 0.00 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 80 | 171.90 ns | 0.276 ns | 0.216 ns | 171.80 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 80 | 163.55 ns | 0.797 ns | 0.707 ns | 163.70 ns | 0.95 | 0.00 | 0.0267 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 850000 | 2,824,662.89 ns | 55,813.884 ns | 121,334.790 ns | 2,814,725.00 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800089 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 850000 | 1,729,389.88 ns | 34,394.895 ns | 76,216.711 ns | 1,768,465.23 ns | 0.61 | 0.03 | - | - | - | 58 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 90 | 192.09 ns | 0.329 ns | 0.308 ns | 192.00 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 90 | 179.89 ns | 0.750 ns | 0.701 ns | 179.77 ns | 0.94 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 100 | 213.50 ns | 0.443 ns | 0.414 ns | 213.41 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 100 | 197.46 ns | 0.844 ns | 0.748 ns | 197.46 ns | 0.92 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 128 | 269.60 ns | 1.111 ns | 0.985 ns | 269.20 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 128 | 245.02 ns | 0.731 ns | 0.648 ns | 245.13 ns | 0.91 | 0.00 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 256 | 525.66 ns | 2.339 ns | 2.074 ns | 525.45 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 256 | 462.39 ns | 0.957 ns | 0.895 ns | 462.58 ns | 0.88 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 512 | 1,021.80 ns | 6.159 ns | 5.761 ns | 1,020.83 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | -| Actual | Add_WithCapacity | List | PooledList | 512 | 892.34 ns | 1.355 ns | 1.201 ns | 892.03 ns | 0.87 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 1024 | 1,995.80 ns | 3.614 ns | 3.018 ns | 1,995.45 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 1024 | 1,757.56 ns | 4.330 ns | 4.050 ns | 1,755.20 ns | 0.88 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 2048 | 3,933.57 ns | 4.570 ns | 4.051 ns | 3,932.97 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 2048 | 3,500.49 ns | 9.074 ns | 8.488 ns | 3,505.08 ns | 0.89 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 4096 | 7,829.70 ns | 24.545 ns | 20.496 ns | 7,825.35 ns | 1.00 | 0.00 | 15.6097 | - | - | 32824 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 4096 | 6,944.20 ns | 17.913 ns | 16.756 ns | 6,935.15 ns | 0.89 | 0.00 | 0.0229 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 8192 | 15,633.66 ns | 55.934 ns | 49.584 ns | 15,615.39 ns | 1.00 | 0.00 | 31.2195 | - | - | 65592 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 8192 | 13,838.48 ns | 34.360 ns | 32.140 ns | 13,817.06 ns | 0.89 | 0.00 | 0.0153 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 16384 | 74,944.83 ns | 1,484.571 ns | 1,930.362 ns | 74,679.98 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 16384 | 27,709.14 ns | 70.458 ns | 65.906 ns | 27,721.43 ns | 0.37 | 0.01 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 32768 | 151,145.93 ns | 3,015.407 ns | 3,813.524 ns | 151,471.66 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 32768 | 55,193.17 ns | 19.087 ns | 15.939 ns | 55,186.68 ns | 0.37 | 0.01 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 65536 | 223,298.15 ns | 1,275.960 ns | 1,065.484 ns | 223,143.09 ns | 1.00 | 0.00 | 137.2070 | 136.2305 | 136.2305 | 524483 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 65536 | 110,406.56 ns | 164.505 ns | 128.435 ns | 110,358.78 ns | 0.49 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | PooledList | 131072 | 483,247.10 ns | 5,993.907 ns | 5,606.704 ns | 482,216.21 ns | 1.00 | 0.00 | 213.3789 | 211.9141 | 211.9141 | 1048698 B | 1.000 | -| Actual | Add_WithCapacity | List | PooledList | 131072 | 221,421.92 ns | 611.385 ns | 477.329 ns | 221,254.47 ns | 0.46 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 1 | 12.80 ns | 0.016 ns | 0.014 ns | 12.80 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 1 | 17.43 ns | 0.030 ns | 0.025 ns | 17.42 ns | 1.36 | 0.00 | 0.0497 | - | - | 104 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 2 | 14.48 ns | 0.038 ns | 0.036 ns | 14.48 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 2 | 18.61 ns | 0.136 ns | 0.120 ns | 18.57 ns | 1.29 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 3 | 16.00 ns | 0.074 ns | 0.066 ns | 15.97 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 3 | 20.05 ns | 0.066 ns | 0.058 ns | 20.05 ns | 1.25 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 4 | 17.82 ns | 0.059 ns | 0.053 ns | 17.83 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 4 | 21.82 ns | 0.045 ns | 0.038 ns | 21.82 ns | 1.22 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 5 | 19.68 ns | 0.042 ns | 0.032 ns | 19.68 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 5 | 23.56 ns | 0.029 ns | 0.022 ns | 23.56 ns | 1.20 | 0.00 | 0.0536 | - | - | 112 B | 1.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 6 | 21.53 ns | 0.039 ns | 0.034 ns | 21.53 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 6 | 25.00 ns | 0.033 ns | 0.028 ns | 25.00 ns | 1.16 | 0.00 | 0.0574 | - | - | 120 B | 1.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 7 | 23.44 ns | 0.020 ns | 0.018 ns | 23.43 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 7 | 27.02 ns | 0.042 ns | 0.035 ns | 27.01 ns | 1.15 | 0.00 | 0.0612 | - | - | 128 B | 1.14 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 8 | 26.08 ns | 0.523 ns | 0.581 ns | 25.95 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 8 | 29.47 ns | 0.357 ns | 0.279 ns | 29.49 ns | 1.13 | 0.04 | 0.0650 | - | - | 136 B | 1.13 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 9 | 27.53 ns | 0.124 ns | 0.110 ns | 27.51 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 9 | 31.53 ns | 0.089 ns | 0.079 ns | 31.53 ns | 1.15 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 10 | 29.71 ns | 0.288 ns | 0.269 ns | 29.68 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 10 | 33.83 ns | 0.288 ns | 0.270 ns | 33.74 ns | 1.14 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 11 | 34.44 ns | 0.113 ns | 0.100 ns | 34.46 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 11 | 35.97 ns | 0.215 ns | 0.191 ns | 35.88 ns | 1.04 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 12 | 33.58 ns | 0.226 ns | 0.211 ns | 33.51 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 12 | 38.48 ns | 0.354 ns | 0.331 ns | 38.41 ns | 1.15 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 13 | 35.77 ns | 0.209 ns | 0.186 ns | 35.64 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 13 | 40.92 ns | 0.137 ns | 0.121 ns | 40.92 ns | 1.14 | 0.01 | 0.0842 | - | - | 176 B | 1.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 14 | 38.58 ns | 0.280 ns | 0.234 ns | 38.56 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 14 | 43.72 ns | 0.482 ns | 0.451 ns | 43.58 ns | 1.13 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 15 | 40.04 ns | 0.460 ns | 0.430 ns | 39.91 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 15 | 45.75 ns | 0.168 ns | 0.149 ns | 45.74 ns | 1.14 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 16 | 42.11 ns | 0.258 ns | 0.215 ns | 42.10 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 16 | 47.92 ns | 0.142 ns | 0.119 ns | 47.94 ns | 1.14 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 17 | 43.98 ns | 0.316 ns | 0.295 ns | 43.95 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 17 | 51.18 ns | 0.637 ns | 0.565 ns | 51.00 ns | 1.16 | 0.02 | 0.0994 | - | - | 208 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 18 | 45.72 ns | 0.409 ns | 0.382 ns | 45.59 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 18 | 53.26 ns | 0.498 ns | 0.466 ns | 53.05 ns | 1.17 | 0.01 | 0.1033 | - | - | 216 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 19 | 48.06 ns | 0.278 ns | 0.260 ns | 48.05 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 19 | 55.45 ns | 0.230 ns | 0.216 ns | 55.41 ns | 1.15 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 20 | 50.08 ns | 0.238 ns | 0.223 ns | 49.97 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 20 | 57.32 ns | 0.533 ns | 0.498 ns | 57.09 ns | 1.14 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 30 | 69.24 ns | 0.643 ns | 0.602 ns | 69.09 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 30 | 81.74 ns | 0.664 ns | 0.621 ns | 81.35 ns | 1.18 | 0.01 | 0.1491 | - | - | 312 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 32 | 72.81 ns | 0.378 ns | 0.316 ns | 72.81 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 32 | 87.48 ns | 0.212 ns | 0.198 ns | 87.53 ns | 1.20 | 0.01 | 0.1568 | - | - | 328 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 36 | 81.57 ns | 0.880 ns | 0.781 ns | 81.73 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 36 | 99.57 ns | 0.378 ns | 0.335 ns | 99.64 ns | 1.22 | 0.01 | 0.1721 | - | - | 360 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 37 | 89.11 ns | 1.630 ns | 1.273 ns | 89.50 ns | 1.00 | 0.00 | 0.1682 | - | - | 352 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 37 | 127.83 ns | 0.715 ns | 0.669 ns | 128.01 ns | 1.43 | 0.02 | 0.1721 | - | - | 360 B | 1.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 40 | 100.60 ns | 1.956 ns | 1.829 ns | 100.77 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Add_WithCapacity | List | RecyclableList | 40 | 96.93 ns | 1.901 ns | 1.952 ns | 97.31 ns | 0.96 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 40 | 132.87 ns | 0.305 ns | 0.270 ns | 132.88 ns | 1.32 | 0.03 | 0.1721 | - | - | 360 B | 0.96 | -| Actual | Add_WithCapacity | List | RecyclableList | 40 | 132.98 ns | 0.380 ns | 0.317 ns | 132.96 ns | 1.32 | 0.03 | 0.1721 | - | - | 360 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 50 | 122.19 ns | 0.858 ns | 0.716 ns | 122.23 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 50 | 153.66 ns | 0.269 ns | 0.239 ns | 153.67 ns | 1.26 | 0.01 | 0.1721 | - | - | 360 B | 0.79 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 60 | 142.67 ns | 0.584 ns | 0.547 ns | 142.66 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 60 | 175.78 ns | 0.770 ns | 0.721 ns | 175.90 ns | 1.23 | 0.01 | 0.1721 | - | - | 360 B | 0.67 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 70 | 169.94 ns | 3.440 ns | 4.709 ns | 170.87 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 70 | 214.05 ns | 1.535 ns | 1.436 ns | 213.30 ns | 1.26 | 0.03 | 0.0534 | - | - | 112 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 80 | 192.27 ns | 3.844 ns | 3.948 ns | 191.44 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 80 | 236.52 ns | 0.579 ns | 0.541 ns | 236.49 ns | 1.23 | 0.03 | 0.0534 | - | - | 112 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 90 | 218.31 ns | 4.248 ns | 4.546 ns | 219.57 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 90 | 257.85 ns | 1.160 ns | 0.969 ns | 257.73 ns | 1.18 | 0.03 | 0.0534 | - | - | 112 B | 0.14 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 100 | 244.71 ns | 4.644 ns | 4.344 ns | 245.77 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 100 | 280.88 ns | 0.682 ns | 0.605 ns | 280.80 ns | 1.15 | 0.02 | 0.0534 | - | - | 112 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 128 | 294.57 ns | 1.947 ns | 1.726 ns | 294.99 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 128 | 310.13 ns | 2.003 ns | 1.874 ns | 309.52 ns | 1.05 | 0.01 | 0.0381 | - | - | 80 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 256 | 565.60 ns | 8.771 ns | 7.324 ns | 562.34 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 256 | 591.69 ns | 1.404 ns | 1.244 ns | 591.34 ns | 1.05 | 0.01 | 0.0381 | - | - | 80 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 512 | 1,108.25 ns | 5.806 ns | 5.431 ns | 1,107.48 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableList | 512 | 1,154.82 ns | 2.660 ns | 2.358 ns | 1,153.35 ns | 1.04 | 0.01 | 0.0381 | - | - | 80 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 1024 | 2,152.43 ns | 20.796 ns | 18.435 ns | 2,152.17 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 1024 | 2,255.06 ns | 4.975 ns | 4.410 ns | 2,254.16 ns | 1.05 | 0.01 | 0.0381 | - | - | 80 B | 0.010 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 2048 | 4,255.57 ns | 40.950 ns | 38.305 ns | 4,250.56 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 2048 | 4,358.18 ns | 9.010 ns | 7.523 ns | 4,353.73 ns | 1.03 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 4096 | 8,524.22 ns | 37.787 ns | 33.497 ns | 8,522.63 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 4096 | 8,673.26 ns | 39.051 ns | 36.528 ns | 8,657.84 ns | 1.02 | 0.01 | 0.0305 | - | - | 80 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 8192 | 17,064.37 ns | 143.446 ns | 134.179 ns | 17,003.89 ns | 1.00 | 0.00 | 31.2195 | - | - | 65592 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 8192 | 17,284.62 ns | 34.690 ns | 32.449 ns | 17,275.01 ns | 1.01 | 0.01 | 0.0305 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 16384 | 78,157.95 ns | 1,525.105 ns | 2,462.760 ns | 78,296.25 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 16384 | 34,507.08 ns | 153.998 ns | 144.049 ns | 34,429.32 ns | 0.44 | 0.01 | - | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 32768 | 156,674.32 ns | 3,047.363 ns | 4,271.977 ns | 156,946.31 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 32768 | 68,860.84 ns | 80.362 ns | 71.239 ns | 68,855.95 ns | 0.44 | 0.02 | - | - | - | 81 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 65536 | 233,735.45 ns | 4,251.547 ns | 3,976.900 ns | 233,665.84 ns | 1.00 | 0.00 | 132.0801 | 131.1035 | 131.1035 | 524673 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 65536 | 138,055.14 ns | 369.543 ns | 345.671 ns | 137,870.92 ns | 0.59 | 0.01 | - | - | - | 82 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 131072 | 504,790.02 ns | 5,969.103 ns | 5,291.454 ns | 506,436.28 ns | 1.00 | 0.00 | 210.9375 | 209.9609 | 209.9609 | 1048765 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 131072 | 275,867.68 ns | 96.531 ns | 80.608 ns | 275,887.01 ns | 0.55 | 0.01 | - | - | - | 83 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableList | 850000 | 2,635,426.13 ns | 50,119.824 ns | 55,708.052 ns | 2,624,835.55 ns | 1.00 | 0.00 | 85.9375 | 85.9375 | 85.9375 | 6800208 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableList | 850000 | 2,401,992.30 ns | 4,520.948 ns | 4,007.703 ns | 2,401,877.54 ns | 0.91 | 0.02 | - | - | - | 139 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 1 | 14.11 ns | 0.057 ns | 0.051 ns | 14.13 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 1 | 60.51 ns | 0.522 ns | 0.488 ns | 60.63 ns | 4.29 | 0.03 | 0.0802 | - | - | 168 B | 2.62 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 2 | 15.93 ns | 0.104 ns | 0.092 ns | 15.92 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 2 | 64.19 ns | 1.320 ns | 1.296 ns | 64.39 ns | 4.02 | 0.08 | 0.0842 | - | - | 176 B | 2.44 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 3 | 17.79 ns | 0.091 ns | 0.080 ns | 17.77 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 3 | 66.86 ns | 0.498 ns | 0.416 ns | 66.86 ns | 3.76 | 0.03 | 0.0918 | - | - | 192 B | 2.40 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 4 | 19.43 ns | 0.149 ns | 0.140 ns | 19.38 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 4 | 70.85 ns | 1.004 ns | 0.939 ns | 70.82 ns | 3.65 | 0.06 | 0.0918 | - | - | 192 B | 2.18 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 5 | 21.70 ns | 0.243 ns | 0.215 ns | 21.67 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 5 | 72.39 ns | 1.181 ns | 1.105 ns | 71.87 ns | 3.34 | 0.07 | 0.1070 | - | - | 224 B | 2.33 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 6 | 23.76 ns | 0.327 ns | 0.290 ns | 23.60 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 6 | 73.96 ns | 0.906 ns | 0.757 ns | 74.01 ns | 3.11 | 0.05 | 0.1070 | - | - | 224 B | 2.15 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 7 | 25.83 ns | 0.286 ns | 0.223 ns | 25.78 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 7 | 94.74 ns | 4.565 ns | 13.460 ns | 92.68 ns | 4.08 | 0.42 | 0.1070 | - | - | 224 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 8 | 30.33 ns | 0.631 ns | 1.617 ns | 30.16 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 8 | 84.05 ns | 2.847 ns | 8.351 ns | 81.17 ns | 2.80 | 0.27 | 0.1070 | - | - | 224 B | 1.87 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 9 | 30.01 ns | 0.318 ns | 0.297 ns | 30.00 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 9 | 81.13 ns | 1.368 ns | 1.212 ns | 81.04 ns | 2.70 | 0.05 | 0.1377 | - | - | 288 B | 2.25 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 10 | 34.40 ns | 0.704 ns | 1.438 ns | 34.04 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 10 | 84.50 ns | 1.729 ns | 3.117 ns | 84.14 ns | 2.46 | 0.14 | 0.1377 | - | - | 288 B | 2.12 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 11 | 34.74 ns | 0.392 ns | 0.348 ns | 34.75 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 11 | 85.95 ns | 1.757 ns | 1.643 ns | 85.77 ns | 2.48 | 0.07 | 0.1377 | - | - | 288 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 12 | 37.67 ns | 0.264 ns | 0.247 ns | 37.73 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 12 | 86.94 ns | 1.272 ns | 1.063 ns | 86.94 ns | 2.30 | 0.03 | 0.1377 | - | - | 288 B | 1.89 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 13 | 39.38 ns | 0.519 ns | 0.460 ns | 39.22 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 13 | 90.96 ns | 1.624 ns | 2.970 ns | 90.66 ns | 2.39 | 0.07 | 0.1377 | - | - | 288 B | 1.80 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 14 | 41.30 ns | 0.222 ns | 0.197 ns | 41.32 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 14 | 93.14 ns | 1.654 ns | 1.547 ns | 93.02 ns | 2.25 | 0.04 | 0.1377 | - | - | 288 B | 1.71 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 15 | 44.04 ns | 0.230 ns | 0.204 ns | 43.96 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 15 | 88.12 ns | 0.719 ns | 0.637 ns | 88.03 ns | 2.00 | 0.02 | 0.1377 | - | - | 288 B | 1.64 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 16 | 46.40 ns | 0.577 ns | 0.511 ns | 46.40 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 16 | 96.94 ns | 1.592 ns | 1.411 ns | 97.18 ns | 2.09 | 0.04 | 0.1377 | - | - | 288 B | 1.57 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 17 | 48.27 ns | 0.370 ns | 0.346 ns | 48.35 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 17 | 103.04 ns | 1.313 ns | 1.228 ns | 102.99 ns | 2.13 | 0.03 | 0.1988 | - | - | 416 B | 2.17 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 18 | 49.75 ns | 0.383 ns | 0.339 ns | 49.73 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 18 | 105.65 ns | 1.259 ns | 1.178 ns | 106.00 ns | 2.12 | 0.03 | 0.1988 | - | - | 416 B | 2.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 19 | 53.29 ns | 0.720 ns | 0.638 ns | 53.36 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 19 | 107.52 ns | 2.117 ns | 2.678 ns | 106.73 ns | 2.01 | 0.06 | 0.1988 | - | - | 416 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 20 | 56.78 ns | 0.345 ns | 0.306 ns | 56.89 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 20 | 103.03 ns | 0.582 ns | 0.544 ns | 103.19 ns | 1.82 | 0.01 | 0.1988 | - | - | 416 B | 1.93 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 30 | 79.59 ns | 0.773 ns | 0.723 ns | 79.88 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 30 | 142.98 ns | 0.988 ns | 0.876 ns | 143.07 ns | 1.80 | 0.02 | 0.1988 | - | - | 416 B | 1.41 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 32 | 84.47 ns | 0.609 ns | 0.569 ns | 84.42 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 32 | 145.65 ns | 2.940 ns | 2.750 ns | 145.73 ns | 1.72 | 0.04 | 0.1988 | - | - | 416 B | 1.33 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 36 | 94.37 ns | 0.670 ns | 0.627 ns | 94.49 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 36 | 145.10 ns | 0.858 ns | 0.803 ns | 145.15 ns | 1.54 | 0.01 | 0.0801 | - | - | 168 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 37 | 83.50 ns | 1.135 ns | 1.006 ns | 83.23 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 37 | 144.06 ns | 0.955 ns | 0.797 ns | 143.93 ns | 1.72 | 0.02 | 0.0801 | - | - | 168 B | 0.48 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 40 | 103.07 ns | 1.236 ns | 1.096 ns | 103.18 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 40 | 86.75 ns | 0.542 ns | 0.507 ns | 86.77 ns | 0.84 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 40 | 151.75 ns | 1.716 ns | 1.605 ns | 151.45 ns | 1.47 | 0.02 | 0.0801 | - | - | 168 B | 0.45 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 40 | 150.59 ns | 1.097 ns | 0.972 ns | 150.73 ns | 1.46 | 0.02 | 0.0801 | - | - | 168 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 50 | 124.14 ns | 1.830 ns | 1.622 ns | 123.82 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 50 | 170.29 ns | 0.864 ns | 0.766 ns | 170.29 ns | 1.37 | 0.02 | 0.0801 | - | - | 168 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 60 | 141.58 ns | 0.639 ns | 0.534 ns | 141.76 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 60 | 188.44 ns | 1.495 ns | 1.399 ns | 188.76 ns | 1.33 | 0.01 | 0.0803 | - | - | 168 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 70 | 170.89 ns | 3.140 ns | 2.784 ns | 170.81 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 70 | 210.30 ns | 1.938 ns | 1.813 ns | 210.28 ns | 1.23 | 0.02 | 0.0803 | - | - | 168 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 80 | 187.99 ns | 2.402 ns | 2.247 ns | 187.38 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 80 | 230.68 ns | 1.599 ns | 1.496 ns | 230.18 ns | 1.23 | 0.02 | 0.0801 | - | - | 168 B | 0.24 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 850000 | 2,768,770.36 ns | 50,845.463 ns | 47,560.878 ns | 2,762,136.72 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800164 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 850000 | 1,857,547.84 ns | 7,617.442 ns | 6,360.909 ns | 1,854,395.90 ns | 0.67 | 0.01 | - | - | - | 433 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 90 | 213.28 ns | 3.741 ns | 3.499 ns | 213.59 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 90 | 248.04 ns | 1.525 ns | 1.427 ns | 247.73 ns | 1.16 | 0.02 | 0.0801 | - | - | 168 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 100 | 231.71 ns | 1.196 ns | 1.119 ns | 231.93 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 100 | 264.88 ns | 1.523 ns | 1.272 ns | 265.10 ns | 1.14 | 0.01 | 0.0801 | - | - | 168 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 128 | 293.05 ns | 2.043 ns | 1.911 ns | 292.89 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 128 | 331.71 ns | 0.918 ns | 0.767 ns | 331.84 ns | 1.13 | 0.01 | 0.0801 | - | - | 168 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 256 | 567.04 ns | 3.343 ns | 2.964 ns | 566.91 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 256 | 596.36 ns | 2.832 ns | 2.365 ns | 596.32 ns | 1.05 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 512 | 1,105.23 ns | 8.376 ns | 7.835 ns | 1,104.20 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 512 | 1,095.69 ns | 3.640 ns | 3.405 ns | 1,095.34 ns | 0.99 | 0.01 | 0.0801 | - | - | 168 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 1024 | 2,145.10 ns | 11.480 ns | 9.586 ns | 2,145.07 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 1024 | 2,134.32 ns | 10.210 ns | 9.550 ns | 2,134.37 ns | 0.99 | 0.00 | 0.0801 | - | - | 168 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 2048 | 4,297.47 ns | 49.331 ns | 41.193 ns | 4,304.54 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 2048 | 4,282.77 ns | 20.153 ns | 18.852 ns | 4,282.29 ns | 1.00 | 0.01 | 0.0763 | - | - | 168 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 4096 | 8,569.46 ns | 45.492 ns | 40.327 ns | 8,573.28 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 4096 | 8,464.96 ns | 39.055 ns | 34.621 ns | 8,468.77 ns | 0.99 | 0.01 | 0.0763 | - | - | 168 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 8192 | 17,100.79 ns | 116.482 ns | 108.957 ns | 17,105.83 ns | 1.00 | 0.00 | 31.2195 | - | - | 65592 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 8192 | 16,739.78 ns | 88.784 ns | 83.048 ns | 16,769.72 ns | 0.98 | 0.01 | 0.0610 | - | - | 168 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 16384 | 79,162.86 ns | 1,577.689 ns | 3,001.718 ns | 78,393.41 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 16384 | 33,674.62 ns | 169.438 ns | 158.492 ns | 33,718.31 ns | 0.43 | 0.02 | 0.1831 | - | - | 448 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 32768 | 156,195.68 ns | 3,105.935 ns | 5,833.700 ns | 155,759.62 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 32768 | 67,152.12 ns | 391.122 ns | 365.856 ns | 67,110.84 ns | 0.43 | 0.02 | 0.1221 | - | - | 449 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 65536 | 230,945.86 ns | 2,636.658 ns | 2,337.329 ns | 231,439.67 ns | 1.00 | 0.00 | 130.3711 | 129.3945 | 129.3945 | 524744 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 65536 | 135,111.60 ns | 1,308.245 ns | 1,223.733 ns | 134,920.80 ns | 0.59 | 0.01 | - | - | - | 450 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | Add_WithCapacity | List | RecyclableLongList | 131072 | 500,459.08 ns | 9,518.732 ns | 10,961.786 ns | 499,489.31 ns | 1.00 | 0.00 | 209.9609 | 208.9844 | 208.9844 | 1048772 B | 1.000 | -| Actual | Add_WithCapacity | List | RecyclableLongList | 131072 | 268,397.92 ns | 1,542.779 ns | 1,443.116 ns | 268,233.11 ns | 0.54 | 0.01 | - | - | - | 451 B | 0.000 | -
- -# `AddRange` with Pre-Initialized Capacity Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.400 - [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 -``` -
-Add Entire Collection with Pre-Initialized Capacity Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | AddRa(...)acity [21] | List | Array | 0 | 17.47 ns | 0.333 ns | 0.312 ns | 17.58 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 0 | 11.41 ns | 0.048 ns | 0.040 ns | 11.40 ns | 0.65 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 1 | 27.16 ns | 0.293 ns | 0.274 ns | 27.14 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 1 | 11.28 ns | 0.043 ns | 0.036 ns | 11.27 ns | 0.41 | 0.00 | 0.0153 | - | - | 32 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 2 | 27.83 ns | 0.394 ns | 0.369 ns | 27.74 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 2 | 11.66 ns | 0.056 ns | 0.053 ns | 11.65 ns | 0.42 | 0.01 | 0.0191 | - | - | 40 B | 0.56 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 3 | 29.26 ns | 0.479 ns | 0.425 ns | 29.18 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 3 | 11.82 ns | 0.019 ns | 0.015 ns | 11.82 ns | 0.40 | 0.01 | 0.0229 | - | - | 48 B | 0.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 4 | 28.97 ns | 0.261 ns | 0.218 ns | 29.04 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 4 | 12.31 ns | 0.219 ns | 0.205 ns | 12.24 ns | 0.43 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 5 | 29.94 ns | 0.378 ns | 0.354 ns | 29.89 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 5 | 12.61 ns | 0.061 ns | 0.057 ns | 12.60 ns | 0.42 | 0.01 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 6 | 28.28 ns | 0.201 ns | 0.178 ns | 28.25 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 6 | 12.81 ns | 0.055 ns | 0.043 ns | 12.80 ns | 0.45 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 7 | 29.81 ns | 0.107 ns | 0.095 ns | 29.81 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 7 | 13.29 ns | 0.147 ns | 0.137 ns | 13.22 ns | 0.45 | 0.01 | 0.0383 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 8 | 30.04 ns | 0.095 ns | 0.080 ns | 30.06 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 8 | 13.51 ns | 0.070 ns | 0.066 ns | 13.49 ns | 0.45 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 9 | 30.78 ns | 0.159 ns | 0.149 ns | 30.77 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 9 | 14.32 ns | 0.086 ns | 0.076 ns | 14.31 ns | 0.47 | 0.00 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 10 | 30.14 ns | 0.156 ns | 0.146 ns | 30.17 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 10 | 14.61 ns | 0.098 ns | 0.092 ns | 14.59 ns | 0.48 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 11 | 33.60 ns | 0.273 ns | 0.255 ns | 33.67 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 11 | 15.30 ns | 0.124 ns | 0.116 ns | 15.28 ns | 0.46 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 12 | 33.88 ns | 0.557 ns | 0.521 ns | 33.99 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 12 | 15.36 ns | 0.049 ns | 0.044 ns | 15.35 ns | 0.45 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 13 | 32.11 ns | 0.073 ns | 0.064 ns | 32.11 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 13 | 15.68 ns | 0.034 ns | 0.028 ns | 15.68 ns | 0.49 | 0.00 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 14 | 34.02 ns | 0.402 ns | 0.356 ns | 34.10 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 14 | 17.04 ns | 0.333 ns | 0.696 ns | 16.81 ns | 0.51 | 0.03 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 15 | 34.87 ns | 0.623 ns | 0.583 ns | 34.69 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 15 | 16.66 ns | 0.150 ns | 0.126 ns | 16.60 ns | 0.48 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 16 | 32.45 ns | 0.316 ns | 0.247 ns | 32.47 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 16 | 16.75 ns | 0.244 ns | 0.228 ns | 16.60 ns | 0.52 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 17 | 34.00 ns | 0.373 ns | 0.349 ns | 34.09 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 17 | 16.95 ns | 0.127 ns | 0.118 ns | 16.94 ns | 0.50 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 18 | 32.89 ns | 0.141 ns | 0.117 ns | 32.90 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 18 | 17.15 ns | 0.058 ns | 0.052 ns | 17.14 ns | 0.52 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 19 | 35.44 ns | 0.486 ns | 0.406 ns | 35.39 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 19 | 18.01 ns | 0.092 ns | 0.086 ns | 17.98 ns | 0.51 | 0.01 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 20 | 35.71 ns | 0.502 ns | 0.470 ns | 35.67 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 20 | 18.10 ns | 0.121 ns | 0.107 ns | 18.08 ns | 0.51 | 0.01 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 30 | 39.75 ns | 0.658 ns | 0.615 ns | 39.76 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 30 | 24.30 ns | 0.210 ns | 0.176 ns | 24.35 ns | 0.61 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 32 | 38.25 ns | 0.173 ns | 0.162 ns | 38.21 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 32 | 24.43 ns | 0.114 ns | 0.095 ns | 24.41 ns | 0.64 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 36 | 43.72 ns | 0.491 ns | 0.460 ns | 43.89 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 36 | 26.19 ns | 0.154 ns | 0.137 ns | 26.11 ns | 0.60 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 37 | 41.45 ns | 0.366 ns | 0.342 ns | 41.51 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 37 | 26.87 ns | 0.459 ns | 0.407 ns | 26.72 ns | 0.65 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 40 | 43.02 ns | 0.831 ns | 0.853 ns | 42.87 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | Array | 40 | 42.85 ns | 0.567 ns | 0.503 ns | 42.85 ns | 0.99 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.75 ns | 0.222 ns | 0.208 ns | 27.74 ns | 0.64 | 0.01 | 0.1645 | - | - | 344 B | 0.91 | -| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.35 ns | 0.219 ns | 0.205 ns | 27.25 ns | 0.64 | 0.01 | 0.1645 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 50 | 45.48 ns | 0.473 ns | 0.419 ns | 45.25 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 50 | 28.94 ns | 0.121 ns | 0.101 ns | 28.91 ns | 0.64 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 60 | 50.41 ns | 0.319 ns | 0.266 ns | 50.47 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 60 | 31.90 ns | 0.056 ns | 0.043 ns | 31.90 ns | 0.63 | 0.00 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 70 | 52.00 ns | 0.845 ns | 0.749 ns | 51.69 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 70 | 35.43 ns | 0.565 ns | 0.501 ns | 35.30 ns | 0.68 | 0.02 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 80 | 56.55 ns | 0.787 ns | 0.697 ns | 56.50 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 80 | 38.12 ns | 0.413 ns | 0.387 ns | 38.06 ns | 0.67 | 0.01 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 90 | 60.15 ns | 0.562 ns | 0.439 ns | 60.22 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 90 | 41.78 ns | 0.556 ns | 0.493 ns | 41.78 ns | 0.70 | 0.01 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 100 | 62.85 ns | 0.705 ns | 0.625 ns | 62.82 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 100 | 45.85 ns | 0.696 ns | 0.651 ns | 45.93 ns | 0.73 | 0.01 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 128 | 70.13 ns | 1.003 ns | 0.939 ns | 69.62 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 128 | 56.16 ns | 0.522 ns | 0.463 ns | 56.07 ns | 0.80 | 0.01 | 0.5010 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 256 | 115.82 ns | 0.644 ns | 0.538 ns | 115.72 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 256 | 102.02 ns | 0.299 ns | 0.265 ns | 101.97 ns | 0.88 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 512 | 206.04 ns | 1.092 ns | 0.968 ns | 205.57 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 512 | 179.93 ns | 0.294 ns | 0.261 ns | 179.90 ns | 0.87 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 1024 | 395.72 ns | 3.167 ns | 2.807 ns | 394.48 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 1024 | 350.98 ns | 4.600 ns | 4.078 ns | 349.02 ns | 0.89 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 2048 | 770.85 ns | 1.157 ns | 0.966 ns | 770.79 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 2048 | 685.18 ns | 9.571 ns | 8.953 ns | 680.08 ns | 0.89 | 0.01 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 4096 | 1,517.98 ns | 2.673 ns | 2.370 ns | 1,517.27 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 4096 | 1,465.87 ns | 3.699 ns | 3.279 ns | 1,465.55 ns | 0.97 | 0.00 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 8192 | 2,894.74 ns | 24.007 ns | 20.047 ns | 2,903.41 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 8192 | 2,843.05 ns | 7.940 ns | 7.038 ns | 2,843.14 ns | 0.98 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 16384 | 56,139.80 ns | 1,120.107 ns | 2,262.672 ns | 56,889.25 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 16384 | 56,250.19 ns | 1,108.909 ns | 2,290.090 ns | 57,251.32 ns | 1.00 | 0.06 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 32768 | 110,936.01 ns | 2,209.007 ns | 4,462.302 ns | 111,651.43 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 32768 | 113,828.41 ns | 1,997.108 ns | 1,770.384 ns | 114,270.10 ns | 1.02 | 0.05 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 65536 | 102,988.93 ns | 1,198.265 ns | 1,062.231 ns | 103,174.19 ns | 1.00 | 0.00 | 127.0752 | 125.9766 | 125.9766 | 524847 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 65536 | 107,630.06 ns | 1,165.349 ns | 1,090.068 ns | 107,104.48 ns | 1.04 | 0.02 | 112.0605 | 111.6943 | 111.6943 | 524343 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 131072 | 259,445.94 ns | 4,882.214 ns | 4,794.987 ns | 261,099.60 ns | 1.00 | 0.00 | 203.8574 | 202.3926 | 202.3926 | 1048869 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 131072 | 270,584.39 ns | 5,391.656 ns | 10,126.836 ns | 273,353.64 ns | 1.03 | 0.04 | 185.0586 | 184.5703 | 184.5703 | 1048657 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | Array | 850000 | 1,815,423.41 ns | 15,451.426 ns | 14,453.273 ns | 1,818,378.12 ns | 1.00 | 0.00 | 152.3438 | 152.3438 | 152.3438 | 6800107 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 850000 | 1,821,703.10 ns | 14,720.500 ns | 13,769.565 ns | 1,820,762.70 ns | 1.00 | 0.01 | 152.3438 | 152.3438 | 152.3438 | 6800075 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 0 | 16.97 ns | 0.091 ns | 0.085 ns | 16.96 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 0 | 18.73 ns | 0.149 ns | 0.139 ns | 18.69 ns | 1.10 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 1 | 28.36 ns | 0.352 ns | 0.312 ns | 28.26 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 1 | 46.39 ns | 0.830 ns | 0.776 ns | 46.48 ns | 1.64 | 0.03 | 0.0268 | - | - | 56 B | 0.88 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 2 | 28.19 ns | 0.185 ns | 0.155 ns | 28.19 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 2 | 45.49 ns | 0.938 ns | 0.963 ns | 45.67 ns | 1.62 | 0.04 | 0.0268 | - | - | 56 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 3 | 28.68 ns | 0.267 ns | 0.237 ns | 28.67 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 3 | 46.49 ns | 0.856 ns | 0.800 ns | 46.71 ns | 1.62 | 0.03 | 0.0268 | - | - | 56 B | 0.70 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 4 | 28.99 ns | 0.221 ns | 0.196 ns | 28.99 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 4 | 46.55 ns | 0.349 ns | 0.292 ns | 46.64 ns | 1.61 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 5 | 28.41 ns | 0.208 ns | 0.194 ns | 28.40 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 5 | 46.85 ns | 0.752 ns | 0.704 ns | 47.04 ns | 1.65 | 0.02 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 6 | 30.33 ns | 0.630 ns | 0.589 ns | 30.13 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 6 | 46.93 ns | 0.730 ns | 0.683 ns | 47.19 ns | 1.55 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 7 | 30.25 ns | 0.223 ns | 0.198 ns | 30.16 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 7 | 45.36 ns | 0.778 ns | 0.728 ns | 45.49 ns | 1.50 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 8 | 30.75 ns | 0.236 ns | 0.221 ns | 30.78 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 8 | 45.55 ns | 0.914 ns | 0.978 ns | 45.92 ns | 1.49 | 0.04 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 9 | 32.17 ns | 0.371 ns | 0.347 ns | 32.14 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 9 | 46.65 ns | 0.937 ns | 0.876 ns | 46.83 ns | 1.45 | 0.03 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 10 | 32.24 ns | 0.334 ns | 0.312 ns | 32.30 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 10 | 47.17 ns | 0.810 ns | 0.718 ns | 47.26 ns | 1.46 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 11 | 35.68 ns | 0.746 ns | 1.093 ns | 35.89 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 11 | 48.46 ns | 0.707 ns | 0.662 ns | 48.56 ns | 1.35 | 0.05 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 12 | 35.80 ns | 0.723 ns | 1.013 ns | 35.44 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 12 | 49.32 ns | 0.538 ns | 0.503 ns | 49.62 ns | 1.37 | 0.04 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 13 | 35.29 ns | 0.477 ns | 0.447 ns | 35.30 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 13 | 49.48 ns | 0.843 ns | 0.788 ns | 49.45 ns | 1.40 | 0.02 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 14 | 35.72 ns | 0.670 ns | 0.797 ns | 35.71 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 14 | 48.77 ns | 0.894 ns | 0.792 ns | 48.96 ns | 1.37 | 0.04 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 15 | 36.19 ns | 0.444 ns | 0.415 ns | 36.15 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 15 | 48.57 ns | 0.964 ns | 0.902 ns | 48.88 ns | 1.34 | 0.03 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 16 | 34.74 ns | 0.497 ns | 0.441 ns | 34.83 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 16 | 48.91 ns | 0.715 ns | 0.669 ns | 49.00 ns | 1.41 | 0.03 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 17 | 34.88 ns | 0.461 ns | 0.432 ns | 35.03 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 17 | 49.03 ns | 0.986 ns | 0.922 ns | 48.95 ns | 1.41 | 0.03 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 18 | 33.58 ns | 0.342 ns | 0.320 ns | 33.67 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 18 | 48.84 ns | 0.593 ns | 0.555 ns | 48.91 ns | 1.45 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 19 | 35.99 ns | 0.741 ns | 1.176 ns | 35.87 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 19 | 50.89 ns | 1.017 ns | 0.999 ns | 50.97 ns | 1.41 | 0.05 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 20 | 38.49 ns | 0.760 ns | 0.635 ns | 38.70 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 20 | 49.49 ns | 0.983 ns | 1.092 ns | 49.55 ns | 1.29 | 0.04 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 30 | 40.20 ns | 0.654 ns | 0.580 ns | 39.96 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 30 | 50.19 ns | 1.018 ns | 1.089 ns | 50.35 ns | 1.25 | 0.03 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 32 | 40.25 ns | 0.458 ns | 0.429 ns | 40.21 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 32 | 49.90 ns | 0.936 ns | 1.281 ns | 49.53 ns | 1.24 | 0.04 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 36 | 44.36 ns | 0.828 ns | 0.775 ns | 44.32 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 36 | 51.52 ns | 0.818 ns | 0.765 ns | 51.56 ns | 1.16 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 37 | 45.10 ns | 0.903 ns | 1.075 ns | 44.70 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 37 | 50.92 ns | 0.633 ns | 0.592 ns | 50.96 ns | 1.13 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 41.96 ns | 0.395 ns | 0.370 ns | 41.95 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 42.10 ns | 0.579 ns | 0.513 ns | 41.99 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 50.83 ns | 0.847 ns | 0.792 ns | 51.14 ns | 1.21 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 48.82 ns | 0.975 ns | 0.958 ns | 48.97 ns | 1.16 | 0.03 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 50 | 44.73 ns | 0.194 ns | 0.172 ns | 44.72 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 50 | 51.85 ns | 0.577 ns | 0.540 ns | 51.77 ns | 1.16 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 60 | 50.00 ns | 0.799 ns | 0.747 ns | 49.92 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 60 | 52.46 ns | 1.063 ns | 0.995 ns | 52.66 ns | 1.05 | 0.03 | 0.0268 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 70 | 53.58 ns | 0.465 ns | 0.435 ns | 53.64 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 70 | 53.86 ns | 0.772 ns | 0.722 ns | 53.87 ns | 1.01 | 0.01 | 0.0268 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 80 | 55.85 ns | 0.385 ns | 0.360 ns | 55.71 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 80 | 51.50 ns | 1.059 ns | 1.449 ns | 51.70 ns | 0.93 | 0.02 | 0.0268 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 850000 | 2,250,645.82 ns | 44,040.987 ns | 81,632.793 ns | 2,252,766.41 ns | 1.00 | 0.00 | 97.6563 | 97.6563 | 97.6563 | 6800090 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 850000 | 767,171.84 ns | 12,585.756 ns | 11,772.724 ns | 771,397.17 ns | 0.34 | 0.01 | - | - | - | 57 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 90 | 59.30 ns | 0.281 ns | 0.234 ns | 59.26 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 90 | 53.80 ns | 0.828 ns | 0.775 ns | 54.17 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 100 | 65.07 ns | 0.397 ns | 0.371 ns | 65.06 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 100 | 54.17 ns | 0.944 ns | 0.969 ns | 54.35 ns | 0.83 | 0.02 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 128 | 69.83 ns | 0.224 ns | 0.175 ns | 69.79 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 128 | 56.93 ns | 1.088 ns | 1.018 ns | 57.30 ns | 0.82 | 0.02 | 0.0268 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 256 | 115.77 ns | 0.376 ns | 0.334 ns | 115.65 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 256 | 58.29 ns | 0.592 ns | 0.525 ns | 58.15 ns | 0.50 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 512 | 207.08 ns | 1.322 ns | 1.237 ns | 206.64 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 512 | 85.60 ns | 0.732 ns | 0.684 ns | 85.98 ns | 0.41 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 1024 | 399.39 ns | 0.902 ns | 0.799 ns | 399.21 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 1024 | 118.41 ns | 0.536 ns | 0.502 ns | 118.31 ns | 0.30 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 2048 | 781.56 ns | 7.964 ns | 7.449 ns | 777.82 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 2048 | 269.41 ns | 0.987 ns | 0.875 ns | 269.24 ns | 0.34 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 4096 | 1,531.02 ns | 7.857 ns | 6.135 ns | 1,531.64 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 4096 | 598.77 ns | 1.315 ns | 1.098 ns | 598.35 ns | 0.39 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 8192 | 2,825.05 ns | 5.936 ns | 5.262 ns | 2,824.78 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 8192 | 1,129.73 ns | 3.459 ns | 3.066 ns | 1,128.38 ns | 0.40 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 16384 | 57,730.42 ns | 1,145.775 ns | 1,319.476 ns | 58,057.66 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 16384 | 2,478.27 ns | 13.160 ns | 12.309 ns | 2,472.38 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 32768 | 113,033.51 ns | 2,195.740 ns | 3,218.487 ns | 114,504.60 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 32768 | 5,365.09 ns | 35.512 ns | 31.480 ns | 5,357.99 ns | 0.05 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 65536 | 102,429.88 ns | 1,646.786 ns | 1,540.404 ns | 102,706.71 ns | 1.00 | 0.00 | 123.6572 | 122.5586 | 122.5586 | 524925 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 65536 | 11,573.79 ns | 25.570 ns | 21.352 ns | 11,569.69 ns | 0.11 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 131072 | 310,167.86 ns | 6,143.482 ns | 16,184.390 ns | 309,573.83 ns | 1.00 | 0.00 | 129.8828 | 128.9063 | 128.9063 | 1049061 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 131072 | 22,926.90 ns | 105.295 ns | 98.493 ns | 22,921.88 ns | 0.07 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 0 | 17.83 ns | 0.210 ns | 0.196 ns | 17.88 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 0 | 22.97 ns | 0.113 ns | 0.100 ns | 22.97 ns | 1.29 | 0.02 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1 | 27.04 ns | 0.151 ns | 0.126 ns | 27.01 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 1 | 23.37 ns | 0.172 ns | 0.160 ns | 23.35 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2 | 28.67 ns | 0.217 ns | 0.203 ns | 28.63 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 2 | 23.30 ns | 0.128 ns | 0.119 ns | 23.28 ns | 0.81 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 3 | 29.08 ns | 0.274 ns | 0.256 ns | 29.05 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 3 | 23.69 ns | 0.367 ns | 0.286 ns | 23.69 ns | 0.81 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4 | 28.39 ns | 0.222 ns | 0.185 ns | 28.35 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 4 | 23.23 ns | 0.230 ns | 0.203 ns | 23.20 ns | 0.82 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 5 | 29.92 ns | 0.373 ns | 0.348 ns | 29.83 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 5 | 23.63 ns | 0.208 ns | 0.194 ns | 23.58 ns | 0.79 | 0.01 | 0.0536 | - | - | 112 B | 1.17 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 6 | 29.65 ns | 0.284 ns | 0.251 ns | 29.57 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 6 | 23.56 ns | 0.204 ns | 0.191 ns | 23.55 ns | 0.79 | 0.01 | 0.0574 | - | - | 120 B | 1.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 7 | 30.09 ns | 0.173 ns | 0.162 ns | 30.08 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 7 | 24.11 ns | 0.251 ns | 0.222 ns | 24.06 ns | 0.80 | 0.01 | 0.0612 | - | - | 128 B | 1.14 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8 | 30.35 ns | 0.304 ns | 0.269 ns | 30.27 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 8 | 24.37 ns | 0.142 ns | 0.126 ns | 24.33 ns | 0.80 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 9 | 31.25 ns | 0.097 ns | 0.076 ns | 31.25 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 9 | 25.24 ns | 0.387 ns | 0.343 ns | 25.19 ns | 0.81 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 10 | 30.77 ns | 0.419 ns | 0.392 ns | 30.56 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 10 | 26.18 ns | 0.470 ns | 0.440 ns | 26.25 ns | 0.85 | 0.02 | 0.0727 | - | - | 152 B | 1.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 11 | 31.44 ns | 0.091 ns | 0.076 ns | 31.41 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 11 | 25.83 ns | 0.236 ns | 0.209 ns | 25.76 ns | 0.82 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 12 | 31.71 ns | 0.378 ns | 0.353 ns | 31.58 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 12 | 26.36 ns | 0.214 ns | 0.190 ns | 26.36 ns | 0.83 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 13 | 33.58 ns | 0.535 ns | 0.500 ns | 33.33 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 13 | 26.56 ns | 0.377 ns | 0.334 ns | 26.53 ns | 0.79 | 0.02 | 0.0842 | - | - | 176 B | 1.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 14 | 33.64 ns | 0.355 ns | 0.332 ns | 33.78 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 14 | 26.76 ns | 0.319 ns | 0.299 ns | 26.79 ns | 0.80 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 15 | 32.06 ns | 0.129 ns | 0.115 ns | 32.08 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 15 | 26.79 ns | 0.311 ns | 0.275 ns | 26.76 ns | 0.84 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16 | 34.07 ns | 0.265 ns | 0.247 ns | 33.98 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 16 | 28.54 ns | 0.231 ns | 0.193 ns | 28.57 ns | 0.84 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 17 | 34.40 ns | 0.295 ns | 0.276 ns | 34.31 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 17 | 28.32 ns | 0.159 ns | 0.141 ns | 28.36 ns | 0.82 | 0.01 | 0.0994 | - | - | 208 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 18 | 34.36 ns | 0.138 ns | 0.129 ns | 34.31 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 18 | 28.55 ns | 0.180 ns | 0.160 ns | 28.59 ns | 0.83 | 0.01 | 0.1033 | - | - | 216 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 19 | 35.91 ns | 0.319 ns | 0.299 ns | 35.83 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 19 | 29.00 ns | 0.268 ns | 0.223 ns | 28.97 ns | 0.81 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 20 | 34.45 ns | 0.347 ns | 0.325 ns | 34.34 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 20 | 29.58 ns | 0.208 ns | 0.162 ns | 29.52 ns | 0.86 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 30 | 40.09 ns | 0.629 ns | 0.588 ns | 39.86 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 30 | 32.58 ns | 0.384 ns | 0.360 ns | 32.65 ns | 0.81 | 0.02 | 0.1492 | - | - | 312 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32 | 40.19 ns | 0.715 ns | 0.669 ns | 39.87 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 32 | 32.04 ns | 0.477 ns | 0.446 ns | 31.98 ns | 0.80 | 0.01 | 0.1568 | - | - | 328 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 36 | 40.58 ns | 0.419 ns | 0.392 ns | 40.39 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 36 | 34.05 ns | 0.524 ns | 0.490 ns | 33.97 ns | 0.84 | 0.02 | 0.1721 | - | - | 360 B | 1.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 37 | 49.74 ns | 0.477 ns | 0.398 ns | 49.67 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 37 | 40.70 ns | 0.723 ns | 0.677 ns | 40.77 ns | 0.82 | 0.01 | 0.0382 | - | - | 80 B | 0.23 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 49.81 ns | 0.517 ns | 0.484 ns | 49.75 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 52.08 ns | 0.939 ns | 0.878 ns | 52.32 ns | 1.05 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 39.35 ns | 0.409 ns | 0.383 ns | 39.29 ns | 0.79 | 0.01 | 0.0382 | - | - | 80 B | 0.21 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 39.09 ns | 0.290 ns | 0.242 ns | 39.05 ns | 0.78 | 0.01 | 0.0382 | - | - | 80 B | 0.21 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 50 | 54.07 ns | 1.105 ns | 1.315 ns | 53.74 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 50 | 39.59 ns | 0.225 ns | 0.176 ns | 39.59 ns | 0.73 | 0.02 | 0.0382 | - | - | 80 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 60 | 59.75 ns | 0.694 ns | 0.615 ns | 59.68 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 60 | 39.27 ns | 0.395 ns | 0.369 ns | 39.17 ns | 0.66 | 0.01 | 0.0382 | - | - | 80 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 70 | 62.51 ns | 1.074 ns | 0.952 ns | 62.54 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 70 | 42.73 ns | 0.567 ns | 0.473 ns | 42.68 ns | 0.68 | 0.01 | 0.0382 | - | - | 80 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 80 | 69.90 ns | 0.640 ns | 0.567 ns | 69.84 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 80 | 41.26 ns | 0.321 ns | 0.301 ns | 41.18 ns | 0.59 | 0.01 | 0.0382 | - | - | 80 B | 0.11 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 90 | 75.08 ns | 0.725 ns | 0.678 ns | 75.01 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 90 | 44.30 ns | 0.885 ns | 1.053 ns | 43.91 ns | 0.59 | 0.01 | 0.0382 | - | - | 80 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 100 | 80.72 ns | 1.560 ns | 1.797 ns | 80.43 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 100 | 44.82 ns | 0.668 ns | 0.624 ns | 44.87 ns | 0.56 | 0.02 | 0.0382 | - | - | 80 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 128 | 95.32 ns | 1.581 ns | 1.479 ns | 95.06 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 128 | 44.00 ns | 0.080 ns | 0.067 ns | 44.00 ns | 0.46 | 0.01 | 0.0382 | - | - | 80 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 256 | 157.62 ns | 2.887 ns | 2.700 ns | 158.03 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 256 | 54.53 ns | 1.059 ns | 1.133 ns | 54.56 ns | 0.35 | 0.01 | 0.0381 | - | - | 80 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 512 | 285.02 ns | 5.731 ns | 5.361 ns | 285.71 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 512 | 74.42 ns | 0.656 ns | 0.614 ns | 74.24 ns | 0.26 | 0.00 | 0.0381 | - | - | 80 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1024 | 573.97 ns | 11.070 ns | 11.844 ns | 570.64 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 1024 | 107.65 ns | 1.021 ns | 0.955 ns | 107.28 ns | 0.19 | 0.00 | 0.0381 | - | - | 80 B | 0.010 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2048 | 1,100.59 ns | 21.785 ns | 25.087 ns | 1,100.00 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 2048 | 258.92 ns | 0.553 ns | 0.517 ns | 259.14 ns | 0.23 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4096 | 2,158.50 ns | 43.128 ns | 49.666 ns | 2,152.95 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 4096 | 573.07 ns | 1.056 ns | 0.882 ns | 572.72 ns | 0.27 | 0.01 | 0.0381 | - | - | 80 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8192 | 4,209.13 ns | 78.520 ns | 77.117 ns | 4,203.19 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 8192 | 1,176.87 ns | 3.637 ns | 3.402 ns | 1,175.27 ns | 0.28 | 0.01 | 0.0381 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16384 | 59,377.65 ns | 1,169.439 ns | 1,251.287 ns | 59,336.36 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 16384 | 2,446.97 ns | 5.342 ns | 4.997 ns | 2,446.45 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32768 | 121,530.46 ns | 1,092.093 ns | 968.112 ns | 121,635.47 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 32768 | 5,369.72 ns | 27.395 ns | 25.625 ns | 5,358.22 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 65536 | 109,162.95 ns | 1,785.643 ns | 1,833.724 ns | 108,922.86 ns | 1.00 | 0.00 | 115.3564 | 114.2578 | 114.2578 | 525006 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 65536 | 11,399.72 ns | 7.312 ns | 5.709 ns | 11,399.52 ns | 0.10 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 131072 | 323,491.82 ns | 10,223.323 ns | 30,143.699 ns | 320,071.29 ns | 1.00 | 0.00 | 143.5547 | 142.5781 | 142.5781 | 1049100 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 131072 | 23,083.70 ns | 64.841 ns | 57.480 ns | 23,065.26 ns | 0.07 | 0.01 | 0.0305 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 850000 | 2,235,065.56 ns | 44,500.332 ns | 90,902.387 ns | 2,221,848.24 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 850000 | 771,934.11 ns | 6,876.389 ns | 5,368.632 ns | 773,185.45 ns | 0.34 | 0.02 | - | - | - | 93 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 17.79 ns | 0.113 ns | 0.100 ns | 17.77 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 19.75 ns | 0.104 ns | 0.092 ns | 19.73 ns | 1.11 | 0.01 | 0.0382 | - | - | 80 B | 2.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 28.96 ns | 0.190 ns | 0.178 ns | 29.00 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 63.22 ns | 1.229 ns | 1.315 ns | 63.21 ns | 2.18 | 0.04 | 0.0688 | - | - | 144 B | 2.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 27.24 ns | 0.362 ns | 0.321 ns | 27.22 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 62.76 ns | 1.167 ns | 1.092 ns | 63.05 ns | 2.30 | 0.04 | 0.0726 | - | - | 152 B | 2.11 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 29.27 ns | 0.292 ns | 0.274 ns | 29.36 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 67.54 ns | 1.064 ns | 0.995 ns | 67.69 ns | 2.31 | 0.04 | 0.0802 | - | - | 168 B | 2.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 29.88 ns | 0.409 ns | 0.363 ns | 29.86 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 61.32 ns | 0.588 ns | 0.550 ns | 61.40 ns | 2.05 | 0.03 | 0.0802 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 30.30 ns | 0.505 ns | 0.472 ns | 30.00 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 70.50 ns | 1.101 ns | 1.030 ns | 70.46 ns | 2.33 | 0.06 | 0.0956 | - | - | 200 B | 2.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 28.41 ns | 0.273 ns | 0.256 ns | 28.32 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 69.63 ns | 0.604 ns | 0.535 ns | 69.56 ns | 2.45 | 0.03 | 0.0956 | - | - | 200 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 29.05 ns | 0.312 ns | 0.292 ns | 28.95 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 68.21 ns | 1.276 ns | 1.194 ns | 68.16 ns | 2.35 | 0.04 | 0.0956 | - | - | 200 B | 1.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 29.10 ns | 0.084 ns | 0.066 ns | 29.08 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 61.73 ns | 0.821 ns | 0.728 ns | 61.55 ns | 2.12 | 0.02 | 0.0956 | - | - | 200 B | 1.67 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 30.56 ns | 0.263 ns | 0.246 ns | 30.58 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 73.09 ns | 1.487 ns | 1.770 ns | 73.14 ns | 2.39 | 0.07 | 0.1262 | - | - | 264 B | 2.06 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 33.47 ns | 0.480 ns | 0.426 ns | 33.54 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 73.77 ns | 1.411 ns | 1.385 ns | 73.67 ns | 2.21 | 0.06 | 0.1262 | - | - | 264 B | 1.94 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 31.23 ns | 0.436 ns | 0.364 ns | 31.13 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 75.22 ns | 1.109 ns | 1.037 ns | 75.30 ns | 2.41 | 0.04 | 0.1262 | - | - | 264 B | 1.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 33.76 ns | 0.282 ns | 0.264 ns | 33.78 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 73.59 ns | 1.137 ns | 1.063 ns | 73.43 ns | 2.18 | 0.04 | 0.1262 | - | - | 264 B | 1.74 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 31.65 ns | 0.297 ns | 0.248 ns | 31.58 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 73.81 ns | 1.156 ns | 1.081 ns | 73.93 ns | 2.33 | 0.03 | 0.1262 | - | - | 264 B | 1.65 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 32.36 ns | 0.373 ns | 0.311 ns | 32.35 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 74.67 ns | 1.482 ns | 1.314 ns | 74.60 ns | 2.30 | 0.05 | 0.1262 | - | - | 264 B | 1.57 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 32.22 ns | 0.490 ns | 0.459 ns | 31.99 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 76.58 ns | 1.552 ns | 1.451 ns | 76.28 ns | 2.38 | 0.06 | 0.1262 | - | - | 264 B | 1.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 32.34 ns | 0.511 ns | 0.453 ns | 32.15 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 67.38 ns | 1.334 ns | 1.247 ns | 67.15 ns | 2.09 | 0.06 | 0.1262 | - | - | 264 B | 1.43 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 34.79 ns | 0.599 ns | 0.531 ns | 34.60 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 78.84 ns | 1.156 ns | 1.081 ns | 78.93 ns | 2.27 | 0.04 | 0.1874 | - | - | 392 B | 2.04 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 35.21 ns | 0.489 ns | 0.458 ns | 35.11 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 78.97 ns | 1.603 ns | 1.500 ns | 78.86 ns | 2.24 | 0.05 | 0.1874 | - | - | 392 B | 1.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 36.88 ns | 0.607 ns | 0.538 ns | 36.71 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 80.61 ns | 1.571 ns | 2.352 ns | 80.11 ns | 2.18 | 0.05 | 0.1874 | - | - | 392 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 34.37 ns | 0.177 ns | 0.148 ns | 34.35 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 80.30 ns | 1.567 ns | 1.466 ns | 80.14 ns | 2.34 | 0.03 | 0.1874 | - | - | 392 B | 1.81 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 40.35 ns | 0.602 ns | 0.534 ns | 40.30 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 79.78 ns | 1.080 ns | 1.010 ns | 80.23 ns | 1.98 | 0.04 | 0.1874 | - | - | 392 B | 1.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 57.83 ns | 0.249 ns | 0.233 ns | 57.77 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 71.00 ns | 0.291 ns | 0.243 ns | 71.02 ns | 1.23 | 0.01 | 0.1874 | - | - | 392 B | 1.26 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 49.00 ns | 0.370 ns | 0.346 ns | 49.06 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 87.38 ns | 1.271 ns | 1.127 ns | 87.10 ns | 1.78 | 0.03 | 0.0688 | - | - | 144 B | 0.42 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 51.51 ns | 0.383 ns | 0.320 ns | 51.62 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 95.17 ns | 0.805 ns | 0.714 ns | 95.14 ns | 1.85 | 0.02 | 0.0688 | - | - | 144 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 51.09 ns | 0.490 ns | 0.459 ns | 50.97 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 50.67 ns | 0.382 ns | 0.357 ns | 50.72 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 94.34 ns | 0.529 ns | 0.494 ns | 94.42 ns | 1.85 | 0.02 | 0.0688 | - | - | 144 B | 0.38 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 92.29 ns | 0.735 ns | 0.688 ns | 92.28 ns | 1.81 | 0.03 | 0.0688 | - | - | 144 B | 0.38 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 54.53 ns | 0.672 ns | 0.629 ns | 54.44 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 86.75 ns | 0.621 ns | 0.519 ns | 86.75 ns | 1.59 | 0.01 | 0.0688 | - | - | 144 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 58.38 ns | 0.196 ns | 0.164 ns | 58.38 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 95.20 ns | 0.808 ns | 0.675 ns | 95.15 ns | 1.63 | 0.01 | 0.0688 | - | - | 144 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 64.74 ns | 0.550 ns | 0.460 ns | 64.77 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 96.66 ns | 0.657 ns | 0.582 ns | 96.57 ns | 1.49 | 0.01 | 0.0688 | - | - | 144 B | 0.23 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 71.68 ns | 1.478 ns | 1.642 ns | 71.31 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 103.54 ns | 2.057 ns | 2.020 ns | 102.75 ns | 1.45 | 0.04 | 0.0688 | - | - | 144 B | 0.21 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 2,230,599.91 ns | 44,380.632 ns | 114,560.583 ns | 2,222,113.09 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 1,155,742.01 ns | 4,080.497 ns | 3,185.784 ns | 1,154,853.91 ns | 0.50 | 0.03 | - | - | - | 437 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 72.88 ns | 0.808 ns | 0.716 ns | 72.71 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 96.04 ns | 0.836 ns | 0.782 ns | 95.80 ns | 1.32 | 0.02 | 0.0688 | - | - | 144 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 89.61 ns | 1.360 ns | 1.272 ns | 89.64 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 101.07 ns | 1.215 ns | 1.137 ns | 100.94 ns | 1.13 | 0.02 | 0.0688 | - | - | 144 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 104.85 ns | 2.030 ns | 2.639 ns | 105.60 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 104.80 ns | 2.118 ns | 1.877 ns | 105.04 ns | 1.01 | 0.03 | 0.0688 | - | - | 144 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 179.97 ns | 3.625 ns | 9.421 ns | 181.43 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 128.77 ns | 2.629 ns | 5.189 ns | 129.94 ns | 0.72 | 0.04 | 0.0687 | - | - | 144 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 334.51 ns | 6.695 ns | 13.214 ns | 336.01 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 144.37 ns | 2.385 ns | 2.114 ns | 144.58 ns | 0.43 | 0.02 | 0.0687 | - | - | 144 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 657.29 ns | 13.023 ns | 14.997 ns | 652.88 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 183.48 ns | 2.584 ns | 2.417 ns | 182.64 ns | 0.28 | 0.01 | 0.0687 | - | - | 144 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 1,090.14 ns | 21.036 ns | 52.387 ns | 1,081.91 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 331.87 ns | 4.616 ns | 4.317 ns | 331.39 ns | 0.29 | 0.01 | 0.0687 | - | - | 144 B | 0.009 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 2,145.31 ns | 33.489 ns | 31.325 ns | 2,151.36 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 636.06 ns | 4.107 ns | 3.640 ns | 634.39 ns | 0.30 | 0.00 | 0.0687 | - | - | 144 B | 0.004 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 4,230.61 ns | 83.669 ns | 102.753 ns | 4,229.90 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 1,207.70 ns | 5.585 ns | 4.664 ns | 1,208.68 ns | 0.29 | 0.01 | 0.0687 | - | - | 144 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 60,726.29 ns | 421.969 ns | 374.065 ns | 60,803.53 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 2,523.02 ns | 11.024 ns | 10.311 ns | 2,522.34 ns | 0.04 | 0.00 | 0.2022 | - | - | 424 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 115,717.23 ns | 2,245.857 ns | 3,562.167 ns | 115,670.65 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262253 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 5,158.65 ns | 16.619 ns | 14.732 ns | 5,159.40 ns | 0.04 | 0.00 | 0.1984 | - | - | 424 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 108,583.75 ns | 613.559 ns | 573.924 ns | 108,597.95 ns | 1.00 | 0.00 | 112.3047 | 111.2061 | 111.2061 | 525069 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 11,203.73 ns | 50.533 ns | 42.197 ns | 11,190.20 ns | 0.10 | 0.00 | 0.1984 | - | - | 424 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 365,941.87 ns | 7,298.546 ns | 18,577.129 ns | 365,174.68 ns | 1.00 | 0.00 | 127.9297 | 126.9531 | 126.9531 | 1049115 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 22,439.59 ns | 291.491 ns | 272.661 ns | 22,280.94 ns | 0.06 | 0.00 | 0.1831 | - | - | 424 B | 0.000 | -
- -# `AddRange` with Pre-Initialized Capacity when Source is Array Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.400 - [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 -``` -
-Add Entire Collection with Pre-Initialized Capacity Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | AddRa(...)acity [21] | List | Array | 0 | 18.91 ns | 0.399 ns | 0.504 ns | 18.94 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 0 | 11.92 ns | 0.266 ns | 0.273 ns | 11.95 ns | 0.63 | 0.03 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 1 | 32.37 ns | 0.663 ns | 0.972 ns | 32.43 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 1 | 11.73 ns | 0.162 ns | 0.143 ns | 11.74 ns | 0.37 | 0.01 | 0.0153 | - | - | 32 B | 0.50 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 2 | 32.43 ns | 0.532 ns | 0.472 ns | 32.48 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 2 | 11.83 ns | 0.157 ns | 0.147 ns | 11.81 ns | 0.36 | 0.01 | 0.0191 | - | - | 40 B | 0.56 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 3 | 28.97 ns | 0.466 ns | 0.436 ns | 28.97 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 3 | 12.08 ns | 0.147 ns | 0.137 ns | 12.05 ns | 0.42 | 0.01 | 0.0229 | - | - | 48 B | 0.60 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 4 | 30.66 ns | 0.610 ns | 0.571 ns | 30.71 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 4 | 12.73 ns | 0.135 ns | 0.126 ns | 12.66 ns | 0.42 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 5 | 32.46 ns | 0.396 ns | 0.351 ns | 32.45 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 5 | 12.59 ns | 0.027 ns | 0.021 ns | 12.59 ns | 0.39 | 0.00 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 6 | 31.34 ns | 0.568 ns | 0.531 ns | 31.12 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 6 | 13.00 ns | 0.101 ns | 0.084 ns | 12.98 ns | 0.42 | 0.01 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 7 | 31.63 ns | 0.578 ns | 0.541 ns | 31.68 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 7 | 13.37 ns | 0.164 ns | 0.137 ns | 13.35 ns | 0.42 | 0.01 | 0.0383 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 8 | 29.16 ns | 0.177 ns | 0.165 ns | 29.15 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 8 | 13.61 ns | 0.107 ns | 0.100 ns | 13.56 ns | 0.47 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 9 | 33.82 ns | 0.522 ns | 0.488 ns | 33.86 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 9 | 14.31 ns | 0.099 ns | 0.092 ns | 14.29 ns | 0.42 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 10 | 33.45 ns | 0.406 ns | 0.380 ns | 33.48 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 10 | 14.67 ns | 0.138 ns | 0.130 ns | 14.70 ns | 0.44 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 11 | 36.25 ns | 0.417 ns | 0.369 ns | 36.23 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 11 | 15.23 ns | 0.073 ns | 0.069 ns | 15.20 ns | 0.42 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 12 | 32.13 ns | 0.274 ns | 0.229 ns | 32.16 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 12 | 15.46 ns | 0.158 ns | 0.147 ns | 15.40 ns | 0.48 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 13 | 32.25 ns | 0.346 ns | 0.307 ns | 32.16 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 13 | 15.81 ns | 0.140 ns | 0.131 ns | 15.76 ns | 0.49 | 0.01 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 14 | 35.85 ns | 0.332 ns | 0.311 ns | 35.89 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 14 | 16.09 ns | 0.076 ns | 0.064 ns | 16.07 ns | 0.45 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 15 | 37.66 ns | 0.229 ns | 0.192 ns | 37.69 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 15 | 16.45 ns | 0.159 ns | 0.149 ns | 16.40 ns | 0.44 | 0.00 | 0.0688 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 16 | 32.29 ns | 0.354 ns | 0.331 ns | 32.18 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 16 | 16.70 ns | 0.207 ns | 0.184 ns | 16.63 ns | 0.52 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 17 | 37.59 ns | 0.256 ns | 0.239 ns | 37.54 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 17 | 16.87 ns | 0.071 ns | 0.063 ns | 16.85 ns | 0.45 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 18 | 32.75 ns | 0.392 ns | 0.366 ns | 32.64 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 18 | 17.15 ns | 0.063 ns | 0.059 ns | 17.13 ns | 0.52 | 0.01 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 19 | 39.10 ns | 0.741 ns | 0.693 ns | 38.87 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 19 | 17.87 ns | 0.127 ns | 0.118 ns | 17.81 ns | 0.46 | 0.01 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 20 | 37.71 ns | 0.776 ns | 0.797 ns | 37.79 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 20 | 17.94 ns | 0.125 ns | 0.117 ns | 17.90 ns | 0.48 | 0.01 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 30 | 40.95 ns | 0.779 ns | 0.765 ns | 41.03 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 30 | 24.05 ns | 0.082 ns | 0.077 ns | 24.05 ns | 0.59 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 32 | 37.90 ns | 0.270 ns | 0.240 ns | 37.88 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 32 | 24.45 ns | 0.124 ns | 0.110 ns | 24.45 ns | 0.65 | 0.01 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 36 | 40.32 ns | 0.534 ns | 0.499 ns | 40.22 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 36 | 25.79 ns | 0.199 ns | 0.177 ns | 25.71 ns | 0.64 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 37 | 40.31 ns | 0.401 ns | 0.355 ns | 40.34 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 37 | 26.49 ns | 0.301 ns | 0.282 ns | 26.38 ns | 0.66 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 40 | 42.33 ns | 0.173 ns | 0.145 ns | 42.31 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | Array | 40 | 45.48 ns | 0.171 ns | 0.160 ns | 45.45 ns | 1.08 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.09 ns | 0.052 ns | 0.041 ns | 27.09 ns | 0.64 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.53 ns | 0.146 ns | 0.122 ns | 27.53 ns | 0.65 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 50 | 74.16 ns | 0.145 ns | 0.128 ns | 74.18 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 50 | 35.09 ns | 0.130 ns | 0.122 ns | 35.07 ns | 0.47 | 0.00 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 60 | 57.71 ns | 1.176 ns | 1.258 ns | 57.31 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 60 | 32.94 ns | 0.620 ns | 0.909 ns | 32.55 ns | 0.58 | 0.03 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 70 | 58.09 ns | 1.189 ns | 1.054 ns | 58.12 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 70 | 60.20 ns | 1.220 ns | 1.141 ns | 60.07 ns | 1.04 | 0.02 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 80 | 55.03 ns | 0.337 ns | 0.299 ns | 55.01 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 80 | 38.42 ns | 0.784 ns | 0.871 ns | 38.04 ns | 0.70 | 0.02 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 90 | 63.62 ns | 1.282 ns | 1.879 ns | 63.34 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 90 | 43.73 ns | 0.959 ns | 2.659 ns | 43.02 ns | 0.67 | 0.04 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 100 | 64.68 ns | 1.308 ns | 1.454 ns | 64.23 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 100 | 45.14 ns | 0.804 ns | 0.713 ns | 45.14 ns | 0.69 | 0.02 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 128 | 72.13 ns | 1.034 ns | 0.864 ns | 71.90 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 128 | 57.82 ns | 0.941 ns | 0.786 ns | 58.03 ns | 0.80 | 0.01 | 0.5010 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 256 | 115.77 ns | 0.300 ns | 0.266 ns | 115.70 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 256 | 100.64 ns | 0.753 ns | 0.704 ns | 100.33 ns | 0.87 | 0.01 | 0.9900 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 512 | 204.95 ns | 0.706 ns | 0.660 ns | 204.69 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 512 | 181.88 ns | 2.521 ns | 2.235 ns | 181.50 ns | 0.89 | 0.01 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 1024 | 413.04 ns | 8.276 ns | 7.742 ns | 411.99 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 1024 | 355.04 ns | 1.979 ns | 1.754 ns | 355.42 ns | 0.86 | 0.02 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 2048 | 769.05 ns | 3.644 ns | 3.409 ns | 767.84 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 2048 | 674.33 ns | 3.062 ns | 2.864 ns | 673.75 ns | 0.88 | 0.01 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 4096 | 1,498.75 ns | 4.783 ns | 4.240 ns | 1,498.61 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 4096 | 1,512.26 ns | 29.929 ns | 41.956 ns | 1,505.24 ns | 1.02 | 0.03 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 8192 | 2,895.90 ns | 25.059 ns | 20.925 ns | 2,888.80 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 8192 | 2,806.63 ns | 31.901 ns | 28.280 ns | 2,793.55 ns | 0.97 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 16384 | 55,418.13 ns | 606.035 ns | 506.066 ns | 55,441.53 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 16384 | 55,540.70 ns | 1,079.305 ns | 1,108.367 ns | 55,499.65 ns | 1.01 | 0.03 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 32768 | 107,023.05 ns | 1,955.576 ns | 1,632.995 ns | 107,432.47 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 32768 | 111,818.01 ns | 2,210.254 ns | 3,812.579 ns | 112,191.56 ns | 1.02 | 0.02 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 65536 | 109,886.70 ns | 2,176.182 ns | 4,140.413 ns | 109,143.95 ns | 1.00 | 0.00 | 126.4648 | 125.3662 | 125.3662 | 524919 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 65536 | 112,801.38 ns | 2,158.013 ns | 3,094.957 ns | 112,238.62 ns | 1.03 | 0.04 | 109.4971 | 109.1309 | 109.1309 | 524343 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 131072 | 274,437.13 ns | 5,029.541 ns | 4,199.894 ns | 275,704.49 ns | 1.00 | 0.00 | 200.1953 | 198.7305 | 198.7305 | 1048888 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 131072 | 287,164.24 ns | 5,738.454 ns | 9,428.445 ns | 287,049.51 ns | 1.04 | 0.04 | 177.2461 | 176.7578 | 176.7578 | 1048654 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | Array | 850000 | 2,032,854.05 ns | 19,094.099 ns | 17,860.632 ns | 2,036,572.85 ns | 1.00 | 0.00 | 156.2500 | 156.2500 | 156.2500 | 6800109 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | Array | 850000 | 2,017,756.75 ns | 13,677.577 ns | 12,124.816 ns | 2,015,650.00 ns | 0.99 | 0.01 | 156.2500 | 156.2500 | 156.2500 | 6800077 B | 1.00 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 0 | 15.55 ns | 0.078 ns | 0.073 ns | 15.58 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 0 | 18.54 ns | 0.032 ns | 0.027 ns | 18.55 ns | 1.19 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 1 | 28.58 ns | 0.112 ns | 0.099 ns | 28.55 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 1 | 46.67 ns | 0.948 ns | 1.265 ns | 46.35 ns | 1.66 | 0.04 | 0.0268 | - | - | 56 B | 0.88 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 2 | 28.80 ns | 0.406 ns | 0.380 ns | 28.73 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 2 | 44.98 ns | 0.863 ns | 0.887 ns | 45.14 ns | 1.56 | 0.04 | 0.0268 | - | - | 56 B | 0.78 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 3 | 27.27 ns | 0.284 ns | 0.252 ns | 27.16 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 3 | 46.40 ns | 0.387 ns | 0.302 ns | 46.43 ns | 1.70 | 0.02 | 0.0268 | - | - | 56 B | 0.70 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 4 | 30.15 ns | 0.603 ns | 0.670 ns | 30.01 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 4 | 47.04 ns | 0.949 ns | 1.331 ns | 46.56 ns | 1.57 | 0.05 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 5 | 33.80 ns | 0.756 ns | 2.194 ns | 33.25 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 5 | 48.09 ns | 0.959 ns | 1.628 ns | 47.97 ns | 1.43 | 0.10 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 6 | 29.98 ns | 0.293 ns | 0.288 ns | 29.94 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 6 | 46.45 ns | 0.368 ns | 0.326 ns | 46.44 ns | 1.55 | 0.02 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 7 | 32.02 ns | 0.670 ns | 1.443 ns | 31.36 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 7 | 45.45 ns | 0.860 ns | 0.804 ns | 45.18 ns | 1.37 | 0.07 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 8 | 29.12 ns | 0.180 ns | 0.150 ns | 29.05 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 8 | 45.89 ns | 0.916 ns | 0.981 ns | 45.89 ns | 1.58 | 0.04 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 9 | 33.17 ns | 0.652 ns | 0.610 ns | 32.90 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 9 | 46.97 ns | 0.821 ns | 0.768 ns | 46.86 ns | 1.42 | 0.04 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 10 | 31.31 ns | 0.293 ns | 0.244 ns | 31.34 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 10 | 46.76 ns | 0.866 ns | 0.810 ns | 47.00 ns | 1.49 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 11 | 34.66 ns | 0.711 ns | 0.665 ns | 34.40 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 11 | 48.13 ns | 0.980 ns | 1.554 ns | 48.27 ns | 1.41 | 0.06 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 12 | 33.95 ns | 0.638 ns | 0.596 ns | 33.98 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 12 | 48.45 ns | 0.764 ns | 0.715 ns | 48.42 ns | 1.43 | 0.03 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 13 | 33.50 ns | 0.699 ns | 0.957 ns | 33.36 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 13 | 47.38 ns | 0.782 ns | 0.653 ns | 47.45 ns | 1.44 | 0.04 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 14 | 37.06 ns | 0.588 ns | 0.550 ns | 37.14 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 14 | 48.24 ns | 0.625 ns | 0.554 ns | 48.34 ns | 1.30 | 0.03 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 15 | 34.47 ns | 0.657 ns | 0.614 ns | 34.33 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 15 | 47.74 ns | 0.927 ns | 0.952 ns | 48.00 ns | 1.38 | 0.03 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 16 | 34.73 ns | 0.286 ns | 0.253 ns | 34.70 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 16 | 48.29 ns | 0.810 ns | 0.758 ns | 48.59 ns | 1.39 | 0.02 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 17 | 33.42 ns | 0.223 ns | 0.198 ns | 33.47 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 17 | 48.79 ns | 0.631 ns | 0.590 ns | 48.88 ns | 1.46 | 0.02 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 18 | 33.17 ns | 0.180 ns | 0.159 ns | 33.15 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 18 | 48.85 ns | 0.592 ns | 0.554 ns | 48.86 ns | 1.47 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 19 | 39.00 ns | 0.555 ns | 0.519 ns | 38.90 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 19 | 49.31 ns | 0.977 ns | 0.959 ns | 49.48 ns | 1.26 | 0.02 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 20 | 39.24 ns | 0.214 ns | 0.200 ns | 39.14 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 20 | 49.03 ns | 0.767 ns | 0.717 ns | 49.27 ns | 1.25 | 0.02 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 30 | 40.53 ns | 0.834 ns | 0.820 ns | 40.48 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 30 | 48.85 ns | 0.993 ns | 1.456 ns | 49.13 ns | 1.21 | 0.05 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 32 | 40.98 ns | 0.349 ns | 0.326 ns | 40.93 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 32 | 48.91 ns | 0.759 ns | 0.673 ns | 49.28 ns | 1.19 | 0.02 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 36 | 44.67 ns | 0.833 ns | 0.738 ns | 44.70 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 36 | 49.90 ns | 0.987 ns | 0.969 ns | 50.18 ns | 1.12 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 37 | 42.42 ns | 0.758 ns | 0.709 ns | 42.46 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 37 | 49.95 ns | 0.825 ns | 0.772 ns | 50.03 ns | 1.18 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 42.72 ns | 0.424 ns | 0.376 ns | 42.66 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 42.27 ns | 0.245 ns | 0.230 ns | 42.21 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 50.49 ns | 0.999 ns | 0.934 ns | 50.45 ns | 1.18 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 49.97 ns | 1.018 ns | 1.089 ns | 50.21 ns | 1.17 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 50 | 47.08 ns | 0.397 ns | 0.352 ns | 47.04 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 50 | 49.28 ns | 0.961 ns | 1.144 ns | 49.57 ns | 1.04 | 0.02 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 60 | 52.93 ns | 0.828 ns | 0.734 ns | 52.77 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 60 | 52.14 ns | 1.055 ns | 1.408 ns | 52.76 ns | 0.99 | 0.03 | 0.0268 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 70 | 52.34 ns | 0.302 ns | 0.268 ns | 52.24 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 70 | 52.49 ns | 0.884 ns | 0.827 ns | 52.60 ns | 1.00 | 0.02 | 0.0268 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 80 | 57.17 ns | 0.108 ns | 0.085 ns | 57.17 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 80 | 52.28 ns | 0.648 ns | 0.606 ns | 52.33 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 850000 | 2,355,574.11 ns | 47,032.123 ns | 92,836.823 ns | 2,364,393.55 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800088 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 850000 | 846,457.91 ns | 1,260.633 ns | 984.220 ns | 846,589.16 ns | 0.36 | 0.01 | - | - | - | 57 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 90 | 58.14 ns | 0.278 ns | 0.232 ns | 58.05 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 90 | 53.04 ns | 0.777 ns | 0.727 ns | 53.10 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 100 | 64.08 ns | 0.595 ns | 0.556 ns | 63.99 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 100 | 52.72 ns | 0.812 ns | 0.720 ns | 52.80 ns | 0.82 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 128 | 68.22 ns | 0.171 ns | 0.143 ns | 68.21 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 128 | 54.59 ns | 0.914 ns | 0.810 ns | 54.75 ns | 0.80 | 0.01 | 0.0268 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 256 | 117.40 ns | 0.796 ns | 0.745 ns | 117.13 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 256 | 57.89 ns | 0.689 ns | 0.645 ns | 57.72 ns | 0.49 | 0.01 | 0.0268 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 512 | 207.89 ns | 0.625 ns | 0.522 ns | 208.02 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | PooledList | 512 | 84.94 ns | 0.527 ns | 0.492 ns | 84.96 ns | 0.41 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 1024 | 405.68 ns | 2.542 ns | 2.378 ns | 405.36 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 1024 | 116.67 ns | 0.737 ns | 0.690 ns | 116.91 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 2048 | 770.26 ns | 4.806 ns | 4.496 ns | 769.32 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 2048 | 267.28 ns | 1.941 ns | 1.816 ns | 267.30 ns | 0.35 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 4096 | 1,490.88 ns | 5.273 ns | 4.403 ns | 1,489.42 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 4096 | 594.77 ns | 2.004 ns | 1.777 ns | 595.25 ns | 0.40 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 8192 | 2,817.93 ns | 10.356 ns | 8.648 ns | 2,816.59 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 8192 | 1,138.80 ns | 2.153 ns | 2.014 ns | 1,138.70 ns | 0.40 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 16384 | 53,457.46 ns | 295.500 ns | 276.411 ns | 53,489.79 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 16384 | 2,447.92 ns | 10.297 ns | 9.128 ns | 2,443.87 ns | 0.05 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 32768 | 109,372.22 ns | 826.120 ns | 772.754 ns | 109,576.67 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 32768 | 5,365.50 ns | 16.390 ns | 15.331 ns | 5,358.87 ns | 0.05 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 65536 | 101,411.80 ns | 1,544.178 ns | 1,516.589 ns | 101,647.15 ns | 1.00 | 0.00 | 123.9014 | 122.8027 | 122.8027 | 524955 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 65536 | 11,930.79 ns | 49.003 ns | 45.838 ns | 11,919.91 ns | 0.12 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | PooledList | 131072 | 318,837.17 ns | 6,314.559 ns | 16,745.315 ns | 317,902.47 ns | 1.00 | 0.00 | 176.2695 | 175.2930 | 175.2930 | 1048822 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | PooledList | 131072 | 25,195.34 ns | 85.188 ns | 79.684 ns | 25,158.76 ns | 0.08 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 0 | 18.78 ns | 0.081 ns | 0.076 ns | 18.74 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 0 | 22.83 ns | 0.113 ns | 0.101 ns | 22.81 ns | 1.22 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1 | 27.76 ns | 0.101 ns | 0.090 ns | 27.79 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 1 | 23.07 ns | 0.134 ns | 0.125 ns | 23.06 ns | 0.83 | 0.00 | 0.0497 | - | - | 104 B | 1.62 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2 | 28.19 ns | 0.107 ns | 0.089 ns | 28.20 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 2 | 23.01 ns | 0.086 ns | 0.077 ns | 23.03 ns | 0.82 | 0.00 | 0.0497 | - | - | 104 B | 1.44 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 3 | 28.77 ns | 0.148 ns | 0.138 ns | 28.79 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 3 | 23.09 ns | 0.141 ns | 0.132 ns | 23.08 ns | 0.80 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4 | 30.73 ns | 0.115 ns | 0.102 ns | 30.71 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 4 | 22.92 ns | 0.136 ns | 0.127 ns | 22.91 ns | 0.75 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 5 | 28.38 ns | 0.208 ns | 0.195 ns | 28.36 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 5 | 23.08 ns | 0.117 ns | 0.104 ns | 23.07 ns | 0.81 | 0.01 | 0.0536 | - | - | 112 B | 1.17 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 6 | 28.50 ns | 0.102 ns | 0.090 ns | 28.49 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 6 | 23.35 ns | 0.165 ns | 0.155 ns | 23.30 ns | 0.82 | 0.01 | 0.0574 | - | - | 120 B | 1.15 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 7 | 28.79 ns | 0.084 ns | 0.075 ns | 28.79 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 7 | 23.74 ns | 0.128 ns | 0.120 ns | 23.78 ns | 0.83 | 0.00 | 0.0612 | - | - | 128 B | 1.14 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8 | 31.87 ns | 0.166 ns | 0.155 ns | 31.89 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 8 | 24.09 ns | 0.172 ns | 0.153 ns | 24.05 ns | 0.76 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 9 | 32.47 ns | 0.184 ns | 0.172 ns | 32.48 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 9 | 24.57 ns | 0.134 ns | 0.119 ns | 24.57 ns | 0.76 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 10 | 31.27 ns | 0.175 ns | 0.163 ns | 31.27 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 10 | 24.74 ns | 0.132 ns | 0.117 ns | 24.73 ns | 0.79 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 11 | 33.73 ns | 0.128 ns | 0.113 ns | 33.73 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 11 | 25.56 ns | 0.172 ns | 0.161 ns | 25.58 ns | 0.76 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 12 | 34.17 ns | 0.210 ns | 0.186 ns | 34.18 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 12 | 25.81 ns | 0.248 ns | 0.232 ns | 25.76 ns | 0.75 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 13 | 31.23 ns | 0.077 ns | 0.060 ns | 31.24 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 13 | 26.18 ns | 0.162 ns | 0.152 ns | 26.18 ns | 0.84 | 0.01 | 0.0842 | - | - | 176 B | 1.10 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 14 | 34.78 ns | 0.295 ns | 0.276 ns | 34.78 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 14 | 26.91 ns | 0.093 ns | 0.087 ns | 26.92 ns | 0.77 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 15 | 34.67 ns | 0.265 ns | 0.222 ns | 34.59 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 15 | 26.32 ns | 0.072 ns | 0.064 ns | 26.33 ns | 0.76 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16 | 33.90 ns | 0.193 ns | 0.181 ns | 33.91 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 16 | 27.40 ns | 0.215 ns | 0.202 ns | 27.41 ns | 0.81 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 17 | 32.66 ns | 0.196 ns | 0.184 ns | 32.60 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 17 | 27.83 ns | 0.222 ns | 0.207 ns | 27.90 ns | 0.85 | 0.01 | 0.0995 | - | - | 208 B | 1.08 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 18 | 34.49 ns | 0.195 ns | 0.183 ns | 34.45 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 18 | 28.61 ns | 0.070 ns | 0.062 ns | 28.63 ns | 0.83 | 0.00 | 0.1033 | - | - | 216 B | 1.08 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 19 | 36.97 ns | 0.388 ns | 0.363 ns | 37.01 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 19 | 28.67 ns | 0.145 ns | 0.135 ns | 28.65 ns | 0.78 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 20 | 37.25 ns | 0.324 ns | 0.287 ns | 37.24 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 20 | 28.83 ns | 0.195 ns | 0.172 ns | 28.78 ns | 0.77 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 30 | 39.18 ns | 0.162 ns | 0.135 ns | 39.17 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 30 | 31.90 ns | 0.261 ns | 0.244 ns | 31.95 ns | 0.81 | 0.01 | 0.1492 | - | - | 312 B | 1.05 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32 | 41.21 ns | 0.179 ns | 0.168 ns | 41.17 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 32 | 31.55 ns | 0.186 ns | 0.155 ns | 31.54 ns | 0.77 | 0.00 | 0.1568 | - | - | 328 B | 1.05 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 36 | 45.17 ns | 0.927 ns | 1.416 ns | 45.23 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 36 | 34.75 ns | 0.187 ns | 0.156 ns | 34.72 ns | 0.78 | 0.03 | 0.1721 | - | - | 360 B | 1.05 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 37 | 50.93 ns | 0.542 ns | 0.480 ns | 50.81 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 37 | 40.49 ns | 0.288 ns | 0.241 ns | 40.53 ns | 0.80 | 0.01 | 0.0382 | - | - | 80 B | 0.23 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 53.62 ns | 1.075 ns | 1.238 ns | 53.53 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 49.33 ns | 0.525 ns | 0.491 ns | 49.28 ns | 0.91 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 38.44 ns | 0.254 ns | 0.237 ns | 38.53 ns | 0.71 | 0.02 | 0.0382 | - | - | 80 B | 0.21 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 43.63 ns | 0.672 ns | 0.628 ns | 43.76 ns | 0.81 | 0.03 | 0.0382 | - | - | 80 B | 0.21 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 50 | 54.49 ns | 0.839 ns | 0.785 ns | 54.54 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 50 | 39.84 ns | 0.585 ns | 0.548 ns | 39.81 ns | 0.73 | 0.02 | 0.0382 | - | - | 80 B | 0.18 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 60 | 57.38 ns | 0.662 ns | 0.587 ns | 57.30 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 60 | 40.35 ns | 0.519 ns | 0.460 ns | 40.21 ns | 0.70 | 0.01 | 0.0382 | - | - | 80 B | 0.15 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 70 | 63.51 ns | 0.799 ns | 0.747 ns | 63.38 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 70 | 44.74 ns | 0.516 ns | 0.483 ns | 44.69 ns | 0.70 | 0.01 | 0.0382 | - | - | 80 B | 0.13 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 80 | 67.41 ns | 1.119 ns | 1.047 ns | 67.50 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 80 | 40.79 ns | 0.330 ns | 0.308 ns | 40.78 ns | 0.61 | 0.01 | 0.0382 | - | - | 80 B | 0.11 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 90 | 77.65 ns | 0.928 ns | 0.868 ns | 77.47 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 90 | 41.66 ns | 0.558 ns | 0.522 ns | 41.56 ns | 0.54 | 0.01 | 0.0382 | - | - | 80 B | 0.10 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 100 | 78.83 ns | 1.072 ns | 1.003 ns | 78.90 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 100 | 42.03 ns | 0.403 ns | 0.336 ns | 42.03 ns | 0.53 | 0.01 | 0.0382 | - | - | 80 B | 0.09 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 128 | 89.78 ns | 1.477 ns | 1.309 ns | 89.83 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 128 | 43.92 ns | 0.144 ns | 0.128 ns | 43.86 ns | 0.49 | 0.01 | 0.0382 | - | - | 80 B | 0.07 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 256 | 154.98 ns | 2.287 ns | 2.139 ns | 154.98 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 256 | 60.20 ns | 0.181 ns | 0.170 ns | 60.19 ns | 0.39 | 0.01 | 0.0381 | - | - | 80 B | 0.04 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 512 | 278.40 ns | 4.896 ns | 4.579 ns | 279.41 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 512 | 71.55 ns | 0.173 ns | 0.162 ns | 71.57 ns | 0.26 | 0.00 | 0.0381 | - | - | 80 B | 0.02 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1024 | 568.38 ns | 10.864 ns | 12.933 ns | 566.75 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 1024 | 104.60 ns | 0.457 ns | 0.405 ns | 104.76 ns | 0.18 | 0.00 | 0.0381 | - | - | 80 B | 0.010 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2048 | 1,069.01 ns | 21.411 ns | 25.488 ns | 1,068.13 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 2048 | 257.18 ns | 0.858 ns | 0.803 ns | 256.92 ns | 0.24 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4096 | 2,156.33 ns | 42.366 ns | 57.991 ns | 2,149.23 ns | 1.00 | 0.00 | 15.6212 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 4096 | 683.96 ns | 2.865 ns | 2.680 ns | 683.76 ns | 0.32 | 0.01 | 0.0381 | - | - | 80 B | 0.002 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8192 | 4,173.65 ns | 82.880 ns | 95.445 ns | 4,138.99 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 8192 | 1,093.55 ns | 8.433 ns | 7.889 ns | 1,093.31 ns | 0.26 | 0.01 | 0.0381 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16384 | 57,440.78 ns | 913.185 ns | 854.194 ns | 57,447.98 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 16384 | 2,424.05 ns | 11.689 ns | 10.934 ns | 2,419.78 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32768 | 112,548.01 ns | 2,096.348 ns | 2,058.894 ns | 112,964.50 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 32768 | 5,225.45 ns | 18.780 ns | 17.567 ns | 5,223.90 ns | 0.05 | 0.00 | 0.0381 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 65536 | 114,803.07 ns | 1,028.345 ns | 911.601 ns | 114,939.65 ns | 1.00 | 0.00 | 118.8965 | 117.7979 | 117.7979 | 524931 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 65536 | 11,959.33 ns | 39.257 ns | 34.800 ns | 11,946.93 ns | 0.10 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 131072 | 512,310.62 ns | 62,622.519 ns | 184,643.909 ns | 375,182.47 ns | 1.00 | 0.00 | 175.7813 | 174.8047 | 174.8047 | 1048975 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 131072 | 24,956.13 ns | 24.065 ns | 18.788 ns | 24,952.89 ns | 0.04 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableList | 850000 | 2,204,685.51 ns | 42,710.796 ns | 70,175.063 ns | 2,215,875.00 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableList | 850000 | 901,679.04 ns | 10,601.461 ns | 9,397.919 ns | 901,813.43 ns | 0.41 | 0.01 | - | - | - | 93 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 16.15 ns | 0.129 ns | 0.107 ns | 16.15 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 19.55 ns | 0.106 ns | 0.088 ns | 19.50 ns | 1.21 | 0.01 | 0.0382 | - | - | 80 B | 2.50 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 26.94 ns | 0.144 ns | 0.128 ns | 26.96 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 64.65 ns | 0.452 ns | 0.401 ns | 64.76 ns | 2.40 | 0.02 | 0.0688 | - | - | 144 B | 2.25 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 27.40 ns | 0.187 ns | 0.175 ns | 27.37 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 64.75 ns | 0.618 ns | 0.578 ns | 64.97 ns | 2.36 | 0.03 | 0.0726 | - | - | 152 B | 2.11 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 27.36 ns | 0.167 ns | 0.156 ns | 27.38 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 67.23 ns | 0.765 ns | 0.716 ns | 67.07 ns | 2.46 | 0.03 | 0.0802 | - | - | 168 B | 2.10 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 27.39 ns | 0.132 ns | 0.117 ns | 27.38 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 65.31 ns | 0.463 ns | 0.433 ns | 65.36 ns | 2.38 | 0.02 | 0.0802 | - | - | 168 B | 1.91 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 30.29 ns | 0.302 ns | 0.283 ns | 30.16 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 69.04 ns | 0.658 ns | 0.615 ns | 68.91 ns | 2.28 | 0.03 | 0.0956 | - | - | 200 B | 2.08 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 28.48 ns | 0.120 ns | 0.112 ns | 28.46 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 68.18 ns | 0.850 ns | 0.795 ns | 68.24 ns | 2.39 | 0.03 | 0.0956 | - | - | 200 B | 1.92 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 28.65 ns | 0.184 ns | 0.172 ns | 28.59 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 67.51 ns | 0.753 ns | 0.705 ns | 67.49 ns | 2.36 | 0.02 | 0.0956 | - | - | 200 B | 1.79 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 28.81 ns | 0.044 ns | 0.039 ns | 28.81 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 65.51 ns | 0.165 ns | 0.154 ns | 65.49 ns | 2.27 | 0.01 | 0.0956 | - | - | 200 B | 1.67 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 29.98 ns | 0.219 ns | 0.205 ns | 29.96 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 73.00 ns | 1.014 ns | 0.948 ns | 73.27 ns | 2.43 | 0.04 | 0.1262 | - | - | 264 B | 2.06 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 30.51 ns | 0.107 ns | 0.095 ns | 30.50 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 71.92 ns | 1.254 ns | 1.173 ns | 71.99 ns | 2.36 | 0.04 | 0.1262 | - | - | 264 B | 1.94 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 31.95 ns | 0.386 ns | 0.361 ns | 31.83 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 72.62 ns | 1.129 ns | 1.001 ns | 72.65 ns | 2.27 | 0.04 | 0.1262 | - | - | 264 B | 1.83 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 32.02 ns | 0.244 ns | 0.228 ns | 32.07 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 71.77 ns | 0.894 ns | 0.792 ns | 71.78 ns | 2.24 | 0.03 | 0.1262 | - | - | 264 B | 1.74 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 32.18 ns | 0.343 ns | 0.321 ns | 32.24 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 72.51 ns | 1.111 ns | 1.039 ns | 72.64 ns | 2.25 | 0.03 | 0.1262 | - | - | 264 B | 1.65 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 35.83 ns | 0.355 ns | 0.315 ns | 35.84 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 72.25 ns | 0.425 ns | 0.355 ns | 72.29 ns | 2.02 | 0.02 | 0.1262 | - | - | 264 B | 1.57 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 32.54 ns | 0.287 ns | 0.240 ns | 32.52 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 72.71 ns | 1.153 ns | 1.078 ns | 72.94 ns | 2.23 | 0.04 | 0.1262 | - | - | 264 B | 1.50 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 33.60 ns | 0.237 ns | 0.222 ns | 33.65 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 71.03 ns | 0.535 ns | 0.500 ns | 71.00 ns | 2.11 | 0.02 | 0.1262 | - | - | 264 B | 1.43 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 32.70 ns | 0.090 ns | 0.075 ns | 32.71 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 78.68 ns | 0.945 ns | 0.884 ns | 78.61 ns | 2.41 | 0.03 | 0.1874 | - | - | 392 B | 2.04 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 33.25 ns | 0.612 ns | 0.573 ns | 33.19 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 79.40 ns | 0.847 ns | 0.793 ns | 79.35 ns | 2.39 | 0.05 | 0.1874 | - | - | 392 B | 1.96 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 34.90 ns | 0.554 ns | 0.518 ns | 35.01 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 76.82 ns | 0.637 ns | 0.596 ns | 76.89 ns | 2.20 | 0.03 | 0.1874 | - | - | 392 B | 1.88 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 34.39 ns | 0.178 ns | 0.158 ns | 34.41 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 78.95 ns | 1.359 ns | 1.205 ns | 79.26 ns | 2.30 | 0.03 | 0.1874 | - | - | 392 B | 1.81 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 37.88 ns | 0.429 ns | 0.402 ns | 37.89 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 78.01 ns | 0.550 ns | 0.459 ns | 78.00 ns | 2.06 | 0.03 | 0.1874 | - | - | 392 B | 1.32 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 37.81 ns | 0.166 ns | 0.148 ns | 37.74 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 76.46 ns | 0.325 ns | 0.271 ns | 76.50 ns | 2.02 | 0.01 | 0.1874 | - | - | 392 B | 1.26 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 49.50 ns | 0.339 ns | 0.301 ns | 49.46 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 88.51 ns | 0.661 ns | 0.586 ns | 88.52 ns | 1.79 | 0.01 | 0.0688 | - | - | 144 B | 0.42 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 50.63 ns | 0.784 ns | 0.695 ns | 50.56 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 88.84 ns | 0.954 ns | 0.892 ns | 88.78 ns | 1.76 | 0.04 | 0.0688 | - | - | 144 B | 0.41 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 49.03 ns | 0.417 ns | 0.370 ns | 49.05 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 48.71 ns | 0.835 ns | 0.928 ns | 48.83 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 87.31 ns | 1.110 ns | 1.039 ns | 87.56 ns | 1.78 | 0.02 | 0.0688 | - | - | 144 B | 0.38 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 88.00 ns | 0.569 ns | 0.533 ns | 88.13 ns | 1.80 | 0.02 | 0.0688 | - | - | 144 B | 0.38 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 54.78 ns | 0.675 ns | 0.632 ns | 54.90 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 87.02 ns | 0.442 ns | 0.414 ns | 86.97 ns | 1.59 | 0.02 | 0.0688 | - | - | 144 B | 0.32 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 57.35 ns | 0.331 ns | 0.310 ns | 57.46 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 91.01 ns | 1.260 ns | 1.179 ns | 90.92 ns | 1.59 | 0.02 | 0.0688 | - | - | 144 B | 0.27 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 64.76 ns | 0.729 ns | 0.682 ns | 64.68 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 91.62 ns | 1.225 ns | 1.023 ns | 91.68 ns | 1.42 | 0.02 | 0.0688 | - | - | 144 B | 0.23 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 68.58 ns | 0.913 ns | 0.854 ns | 68.68 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 88.22 ns | 0.721 ns | 0.674 ns | 88.25 ns | 1.29 | 0.02 | 0.0688 | - | - | 144 B | 0.21 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 2,538,596.09 ns | 50,251.943 ns | 132,383.717 ns | 2,544,541.80 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800141 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 1,319,091.86 ns | 9,842.465 ns | 9,206.648 ns | 1,322,115.04 ns | 0.53 | 0.04 | - | - | - | 449 B | 0.000 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 74.95 ns | 1.377 ns | 1.288 ns | 75.04 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 88.78 ns | 1.157 ns | 1.082 ns | 88.77 ns | 1.18 | 0.03 | 0.0688 | - | - | 144 B | 0.19 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 78.49 ns | 1.377 ns | 1.221 ns | 78.36 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 92.89 ns | 0.439 ns | 0.367 ns | 92.91 ns | 1.18 | 0.02 | 0.0688 | - | - | 144 B | 0.17 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 92.57 ns | 1.884 ns | 2.314 ns | 93.06 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 90.26 ns | 0.707 ns | 0.662 ns | 90.29 ns | 0.96 | 0.02 | 0.0688 | - | - | 144 B | 0.13 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 157.87 ns | 1.926 ns | 1.802 ns | 157.59 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 100.98 ns | 0.383 ns | 0.339 ns | 101.04 ns | 0.64 | 0.01 | 0.0688 | - | - | 144 B | 0.07 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 280.42 ns | 5.429 ns | 6.034 ns | 280.08 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 118.82 ns | 1.031 ns | 0.964 ns | 118.84 ns | 0.42 | 0.01 | 0.0687 | - | - | 144 B | 0.03 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 550.41 ns | 10.930 ns | 14.213 ns | 549.32 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 151.50 ns | 0.866 ns | 0.810 ns | 151.47 ns | 0.27 | 0.01 | 0.0687 | - | - | 144 B | 0.02 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 1,107.60 ns | 21.354 ns | 22.848 ns | 1,101.33 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 316.43 ns | 1.933 ns | 1.809 ns | 316.65 ns | 0.28 | 0.01 | 0.0687 | - | - | 144 B | 0.009 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 2,138.24 ns | 39.016 ns | 36.496 ns | 2,147.29 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 603.51 ns | 3.039 ns | 2.843 ns | 602.59 ns | 0.28 | 0.00 | 0.0687 | - | - | 144 B | 0.004 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 4,121.10 ns | 81.886 ns | 91.016 ns | 4,115.91 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 1,176.01 ns | 4.800 ns | 4.489 ns | 1,174.98 ns | 0.29 | 0.01 | 0.0687 | - | - | 144 B | 0.002 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 57,390.39 ns | 456.832 ns | 404.970 ns | 57,432.85 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 2,463.79 ns | 4.976 ns | 4.155 ns | 2,465.25 ns | 0.04 | 0.00 | 0.2022 | - | - | 424 B | 0.003 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 115,071.34 ns | 1,360.885 ns | 1,272.972 ns | 115,122.85 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262253 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 5,018.02 ns | 17.996 ns | 16.834 ns | 5,012.70 ns | 0.04 | 0.00 | 0.1984 | - | - | 424 B | 0.002 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 116,796.34 ns | 1,458.231 ns | 1,292.683 ns | 117,262.53 ns | 1.00 | 0.00 | 118.2861 | 117.3096 | 117.3096 | 524949 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 11,412.82 ns | 56.376 ns | 49.976 ns | 11,414.94 ns | 0.10 | 0.00 | 0.1984 | - | - | 424 B | 0.001 | -| | | | | | | | | | | | | | -| | | -| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 531,504.27 ns | 71,962.404 ns | 212,182.771 ns | 376,339.89 ns | 1.00 | 0.00 | 143.5547 | 142.5781 | 142.5781 | 1049107 B | 1.000 | -| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 22,820.28 ns | 104.330 ns | 87.120 ns | 22,830.46 ns | 0.03 | 0.00 | 0.1831 | - | - | 424 B | 0.000 | -
- -# `AddRange` when Source is Array Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2134/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.400 - [Host] : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2 -``` -
-Add Entire Collection Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | AddRa(...)Array [25] | List | Array | 0 | 13.98 ns | 0.162 ns | 0.135 ns | 13.93 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 0 | 11.45 ns | 0.063 ns | 0.056 ns | 11.47 ns | 0.82 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 1 | 30.06 ns | 0.307 ns | 0.272 ns | 30.14 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 1 | 12.77 ns | 0.271 ns | 0.322 ns | 12.83 ns | 0.42 | 0.01 | 0.0153 | - | - | 32 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 2 | 30.44 ns | 0.288 ns | 0.256 ns | 30.40 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 2 | 12.96 ns | 0.289 ns | 0.355 ns | 13.05 ns | 0.42 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 3 | 30.37 ns | 0.414 ns | 0.387 ns | 30.42 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 3 | 13.15 ns | 0.049 ns | 0.044 ns | 13.15 ns | 0.43 | 0.01 | 0.0229 | - | - | 48 B | 0.55 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 4 | 30.92 ns | 0.607 ns | 0.538 ns | 31.03 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 4 | 13.44 ns | 0.059 ns | 0.052 ns | 13.43 ns | 0.43 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 5 | 30.81 ns | 0.257 ns | 0.240 ns | 30.78 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 5 | 13.42 ns | 0.295 ns | 0.476 ns | 13.61 ns | 0.44 | 0.02 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 6 | 30.68 ns | 0.058 ns | 0.054 ns | 30.67 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 6 | 13.82 ns | 0.107 ns | 0.089 ns | 13.82 ns | 0.45 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 7 | 31.12 ns | 0.066 ns | 0.051 ns | 31.12 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 7 | 13.82 ns | 0.025 ns | 0.022 ns | 13.82 ns | 0.44 | 0.00 | 0.0382 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 8 | 31.30 ns | 0.221 ns | 0.196 ns | 31.22 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 8 | 14.16 ns | 0.025 ns | 0.021 ns | 14.16 ns | 0.45 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 9 | 32.32 ns | 0.263 ns | 0.246 ns | 32.27 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 9 | 15.22 ns | 0.055 ns | 0.048 ns | 15.22 ns | 0.47 | 0.00 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 10 | 32.57 ns | 0.249 ns | 0.233 ns | 32.46 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 10 | 15.29 ns | 0.172 ns | 0.153 ns | 15.34 ns | 0.47 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 11 | 33.47 ns | 0.197 ns | 0.184 ns | 33.56 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 11 | 15.76 ns | 0.344 ns | 0.602 ns | 16.14 ns | 0.47 | 0.02 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 12 | 33.79 ns | 0.200 ns | 0.167 ns | 33.82 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 12 | 16.36 ns | 0.325 ns | 0.304 ns | 16.43 ns | 0.49 | 0.00 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 13 | 34.16 ns | 0.330 ns | 0.309 ns | 34.11 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 13 | 16.63 ns | 0.343 ns | 0.337 ns | 16.69 ns | 0.49 | 0.01 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 14 | 34.45 ns | 0.323 ns | 0.303 ns | 34.32 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 14 | 17.02 ns | 0.202 ns | 0.189 ns | 17.06 ns | 0.49 | 0.01 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 15 | 34.64 ns | 0.324 ns | 0.303 ns | 34.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 15 | 17.06 ns | 0.150 ns | 0.140 ns | 17.06 ns | 0.49 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 16 | 34.98 ns | 0.237 ns | 0.222 ns | 35.00 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 16 | 17.31 ns | 0.099 ns | 0.088 ns | 17.33 ns | 0.50 | 0.00 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 17 | 34.86 ns | 0.111 ns | 0.104 ns | 34.85 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 17 | 17.42 ns | 0.100 ns | 0.094 ns | 17.36 ns | 0.50 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 18 | 35.07 ns | 0.105 ns | 0.093 ns | 35.04 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 18 | 17.74 ns | 0.072 ns | 0.064 ns | 17.73 ns | 0.51 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 19 | 36.09 ns | 0.162 ns | 0.152 ns | 36.06 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 19 | 18.39 ns | 0.034 ns | 0.030 ns | 18.38 ns | 0.51 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 20 | 36.82 ns | 0.255 ns | 0.238 ns | 36.80 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 20 | 18.66 ns | 0.044 ns | 0.039 ns | 18.65 ns | 0.51 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 30 | 39.90 ns | 0.302 ns | 0.268 ns | 39.89 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 30 | 21.63 ns | 0.054 ns | 0.048 ns | 21.64 ns | 0.54 | 0.00 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 32 | 40.53 ns | 0.181 ns | 0.160 ns | 40.52 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 32 | 22.29 ns | 0.274 ns | 0.256 ns | 22.30 ns | 0.55 | 0.01 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 36 | 42.89 ns | 0.405 ns | 0.359 ns | 42.84 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 36 | 23.88 ns | 0.247 ns | 0.219 ns | 23.86 ns | 0.56 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 37 | 42.77 ns | 0.373 ns | 0.331 ns | 42.78 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 37 | 24.20 ns | 0.309 ns | 0.289 ns | 24.12 ns | 0.57 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 40 | 43.43 ns | 0.210 ns | 0.176 ns | 43.42 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)Array [25] | List | Array | 40 | 43.50 ns | 0.249 ns | 0.233 ns | 43.45 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 40 | 24.72 ns | 0.193 ns | 0.180 ns | 24.68 ns | 0.57 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| Actual | AddRa(...)Array [25] | List | Array | 40 | 24.65 ns | 0.166 ns | 0.138 ns | 24.66 ns | 0.57 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 50 | 46.74 ns | 0.512 ns | 0.454 ns | 46.63 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 50 | 27.95 ns | 0.268 ns | 0.251 ns | 27.94 ns | 0.60 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 60 | 50.94 ns | 0.515 ns | 0.482 ns | 50.82 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 60 | 31.60 ns | 0.047 ns | 0.042 ns | 31.61 ns | 0.62 | 0.01 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 70 | 53.40 ns | 0.137 ns | 0.129 ns | 53.39 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 70 | 34.79 ns | 0.111 ns | 0.093 ns | 34.79 ns | 0.65 | 0.00 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 80 | 57.21 ns | 0.506 ns | 0.422 ns | 57.28 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 80 | 38.56 ns | 0.244 ns | 0.228 ns | 38.59 ns | 0.67 | 0.01 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 90 | 60.42 ns | 0.529 ns | 0.469 ns | 60.49 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 90 | 40.87 ns | 0.061 ns | 0.054 ns | 40.86 ns | 0.68 | 0.01 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 100 | 62.97 ns | 0.104 ns | 0.087 ns | 62.99 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 100 | 44.66 ns | 0.049 ns | 0.041 ns | 44.67 ns | 0.71 | 0.00 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 128 | 70.57 ns | 0.369 ns | 0.345 ns | 70.58 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 128 | 51.80 ns | 0.122 ns | 0.109 ns | 51.82 ns | 0.73 | 0.00 | 0.5010 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 256 | 115.74 ns | 0.227 ns | 0.201 ns | 115.79 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 256 | 95.45 ns | 0.480 ns | 0.449 ns | 95.62 ns | 0.82 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 512 | 204.61 ns | 0.373 ns | 0.331 ns | 204.58 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 512 | 178.08 ns | 0.413 ns | 0.386 ns | 177.90 ns | 0.87 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 1024 | 393.97 ns | 1.994 ns | 1.865 ns | 393.10 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 1024 | 354.46 ns | 1.437 ns | 1.344 ns | 354.34 ns | 0.90 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 2048 | 767.88 ns | 3.372 ns | 3.154 ns | 767.33 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 2048 | 667.53 ns | 1.488 ns | 1.161 ns | 667.64 ns | 0.87 | 0.00 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 4096 | 1,490.30 ns | 5.362 ns | 5.016 ns | 1,492.34 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 4096 | 1,431.82 ns | 9.223 ns | 8.176 ns | 1,433.39 ns | 0.96 | 0.01 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 8192 | 2,858.99 ns | 24.459 ns | 20.424 ns | 2,862.66 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 8192 | 2,777.49 ns | 17.188 ns | 15.237 ns | 2,781.76 ns | 0.97 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 16384 | 59,270.04 ns | 1,166.561 ns | 1,949.061 ns | 60,135.94 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 16384 | 59,154.98 ns | 1,172.502 ns | 1,926.455 ns | 59,461.32 ns | 1.00 | 0.06 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 32768 | 117,641.57 ns | 2,338.419 ns | 3,970.812 ns | 119,190.45 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 32768 | 119,230.33 ns | 2,375.250 ns | 6,131.280 ns | 120,742.92 ns | 1.01 | 0.04 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 65536 | 110,019.82 ns | 2,057.050 ns | 1,924.166 ns | 110,404.49 ns | 1.00 | 0.00 | 124.8779 | 123.7793 | 123.7793 | 524937 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 65536 | 111,280.13 ns | 1,431.940 ns | 1,339.438 ns | 111,105.99 ns | 1.01 | 0.02 | 112.4268 | 112.0605 | 112.0605 | 524344 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 131072 | 274,605.45 ns | 5,370.968 ns | 8,673.112 ns | 273,466.65 ns | 1.00 | 0.00 | 197.2656 | 195.8008 | 195.8008 | 1048985 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 131072 | 286,187.36 ns | 5,383.804 ns | 10,875.549 ns | 285,147.56 ns | 1.04 | 0.05 | 183.5938 | 183.1055 | 183.1055 | 1048656 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | Array | 850000 | 2,102,348.70 ns | 41,324.471 ns | 49,193.844 ns | 2,113,536.72 ns | 1.00 | 0.00 | 156.2500 | 156.2500 | 156.2500 | 6800109 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | Array | 850000 | 2,106,699.34 ns | 41,567.453 ns | 51,048.565 ns | 2,116,926.56 ns | 1.00 | 0.02 | 156.2500 | 156.2500 | 156.2500 | 6800077 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 0 | 15.66 ns | 0.169 ns | 0.158 ns | 15.67 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 0 | 15.66 ns | 0.052 ns | 0.043 ns | 15.66 ns | 1.00 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 1 | 30.08 ns | 0.079 ns | 0.070 ns | 30.09 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 1 | 40.19 ns | 0.182 ns | 0.161 ns | 40.12 ns | 1.34 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 2 | 30.23 ns | 0.172 ns | 0.161 ns | 30.23 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 2 | 40.42 ns | 0.316 ns | 0.295 ns | 40.50 ns | 1.34 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 3 | 30.72 ns | 0.176 ns | 0.147 ns | 30.74 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 3 | 40.83 ns | 0.496 ns | 0.464 ns | 40.59 ns | 1.33 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 4 | 30.62 ns | 0.202 ns | 0.189 ns | 30.69 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 4 | 40.52 ns | 0.293 ns | 0.245 ns | 40.60 ns | 1.32 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 5 | 31.07 ns | 0.235 ns | 0.208 ns | 31.08 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 5 | 40.11 ns | 0.090 ns | 0.084 ns | 40.10 ns | 1.29 | 0.01 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 6 | 30.88 ns | 0.077 ns | 0.069 ns | 30.87 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 6 | 40.10 ns | 0.129 ns | 0.108 ns | 40.09 ns | 1.30 | 0.00 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 7 | 31.30 ns | 0.080 ns | 0.075 ns | 31.29 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 7 | 40.50 ns | 0.068 ns | 0.061 ns | 40.51 ns | 1.29 | 0.00 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 8 | 31.74 ns | 0.062 ns | 0.052 ns | 31.74 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 8 | 40.42 ns | 0.063 ns | 0.056 ns | 40.40 ns | 1.27 | 0.00 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 9 | 32.22 ns | 0.054 ns | 0.051 ns | 32.22 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 9 | 40.58 ns | 0.062 ns | 0.055 ns | 40.59 ns | 1.26 | 0.00 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 10 | 32.30 ns | 0.136 ns | 0.114 ns | 32.27 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 10 | 41.08 ns | 0.336 ns | 0.314 ns | 40.93 ns | 1.27 | 0.01 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 11 | 33.74 ns | 0.299 ns | 0.279 ns | 33.72 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 11 | 41.88 ns | 0.269 ns | 0.251 ns | 41.97 ns | 1.24 | 0.01 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 12 | 33.88 ns | 0.245 ns | 0.217 ns | 33.83 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 12 | 41.29 ns | 0.180 ns | 0.150 ns | 41.33 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 13 | 34.76 ns | 0.333 ns | 0.312 ns | 34.84 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 13 | 41.67 ns | 0.174 ns | 0.145 ns | 41.63 ns | 1.20 | 0.01 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 14 | 34.60 ns | 0.256 ns | 0.239 ns | 34.60 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 14 | 41.70 ns | 0.373 ns | 0.331 ns | 41.75 ns | 1.21 | 0.01 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 15 | 34.72 ns | 0.294 ns | 0.260 ns | 34.71 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 15 | 41.57 ns | 0.141 ns | 0.118 ns | 41.54 ns | 1.20 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 16 | 35.18 ns | 0.165 ns | 0.154 ns | 35.13 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 16 | 41.64 ns | 0.348 ns | 0.325 ns | 41.57 ns | 1.18 | 0.01 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 17 | 35.42 ns | 0.165 ns | 0.138 ns | 35.36 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 17 | 41.65 ns | 0.415 ns | 0.388 ns | 41.53 ns | 1.18 | 0.01 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 18 | 35.68 ns | 0.215 ns | 0.201 ns | 35.60 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 18 | 41.90 ns | 0.359 ns | 0.335 ns | 41.71 ns | 1.17 | 0.01 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 19 | 35.90 ns | 0.100 ns | 0.088 ns | 35.89 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 19 | 42.17 ns | 0.189 ns | 0.177 ns | 42.21 ns | 1.17 | 0.01 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 20 | 36.41 ns | 0.114 ns | 0.095 ns | 36.37 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 20 | 41.77 ns | 0.074 ns | 0.058 ns | 41.77 ns | 1.15 | 0.00 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 30 | 39.65 ns | 0.107 ns | 0.089 ns | 39.62 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 30 | 42.80 ns | 0.309 ns | 0.274 ns | 42.71 ns | 1.08 | 0.01 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 32 | 40.27 ns | 0.057 ns | 0.051 ns | 40.27 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 32 | 42.49 ns | 0.039 ns | 0.032 ns | 42.48 ns | 1.05 | 0.00 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 36 | 42.01 ns | 0.219 ns | 0.205 ns | 41.92 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 36 | 43.18 ns | 0.135 ns | 0.120 ns | 43.15 ns | 1.03 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 37 | 42.11 ns | 0.069 ns | 0.061 ns | 42.11 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 37 | 43.53 ns | 0.310 ns | 0.290 ns | 43.46 ns | 1.03 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 40 | 43.01 ns | 0.157 ns | 0.139 ns | 42.98 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)Array [25] | List | PooledList | 40 | 43.23 ns | 0.228 ns | 0.213 ns | 43.23 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 40 | 43.66 ns | 0.225 ns | 0.176 ns | 43.74 ns | 1.02 | 0.00 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | AddRa(...)Array [25] | List | PooledList | 40 | 43.28 ns | 0.050 ns | 0.044 ns | 43.27 ns | 1.01 | 0.00 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 50 | 46.84 ns | 0.718 ns | 0.672 ns | 46.50 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 50 | 44.73 ns | 0.639 ns | 0.567 ns | 44.56 ns | 0.95 | 0.02 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 60 | 50.29 ns | 0.278 ns | 0.246 ns | 50.32 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 60 | 45.71 ns | 0.374 ns | 0.350 ns | 45.61 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 70 | 53.36 ns | 0.300 ns | 0.266 ns | 53.31 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 70 | 47.91 ns | 0.199 ns | 0.155 ns | 47.93 ns | 0.90 | 0.01 | 0.0268 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 80 | 56.98 ns | 0.673 ns | 0.630 ns | 56.86 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 80 | 50.07 ns | 0.301 ns | 0.281 ns | 50.06 ns | 0.88 | 0.01 | 0.0268 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 850000 | 2,574,081.51 ns | 50,017.309 ns | 101,037.432 ns | 2,549,021.68 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800089 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 850000 | 895,974.44 ns | 5,112.691 ns | 4,269.328 ns | 894,426.66 ns | 0.35 | 0.01 | - | - | - | 57 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 90 | 59.29 ns | 0.569 ns | 0.532 ns | 59.15 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 90 | 50.60 ns | 0.357 ns | 0.334 ns | 50.54 ns | 0.85 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 100 | 62.47 ns | 0.570 ns | 0.505 ns | 62.59 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 100 | 50.59 ns | 0.329 ns | 0.292 ns | 50.61 ns | 0.81 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 128 | 70.12 ns | 0.084 ns | 0.065 ns | 70.13 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 128 | 51.71 ns | 0.102 ns | 0.091 ns | 51.69 ns | 0.74 | 0.00 | 0.0268 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 256 | 115.90 ns | 0.227 ns | 0.189 ns | 115.86 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 256 | 55.98 ns | 0.096 ns | 0.090 ns | 55.95 ns | 0.48 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 512 | 203.03 ns | 0.423 ns | 0.375 ns | 203.01 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | PooledList | 512 | 79.93 ns | 0.242 ns | 0.215 ns | 79.92 ns | 0.39 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 1024 | 395.70 ns | 0.525 ns | 0.438 ns | 395.65 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 1024 | 111.92 ns | 0.250 ns | 0.195 ns | 111.95 ns | 0.28 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 2048 | 758.36 ns | 1.280 ns | 1.134 ns | 758.20 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 2048 | 220.80 ns | 0.496 ns | 0.414 ns | 220.65 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 4096 | 1,503.28 ns | 5.860 ns | 5.195 ns | 1,502.49 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 4096 | 574.33 ns | 2.332 ns | 2.181 ns | 573.75 ns | 0.38 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 8192 | 2,856.51 ns | 24.510 ns | 21.728 ns | 2,863.33 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 8192 | 1,075.40 ns | 3.170 ns | 2.647 ns | 1,074.52 ns | 0.38 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 16384 | 60,136.87 ns | 1,201.610 ns | 2,992.425 ns | 60,447.64 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 16384 | 2,456.35 ns | 6.699 ns | 5.938 ns | 2,458.04 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 32768 | 117,201.05 ns | 2,326.277 ns | 4,855.807 ns | 117,823.02 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 32768 | 5,363.92 ns | 17.940 ns | 16.781 ns | 5,354.21 ns | 0.05 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 65536 | 110,920.38 ns | 1,352.140 ns | 1,264.793 ns | 110,981.04 ns | 1.00 | 0.00 | 126.2207 | 125.1221 | 125.1221 | 524883 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 65536 | 11,961.43 ns | 27.339 ns | 24.235 ns | 11,950.54 ns | 0.11 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | PooledList | 131072 | 381,840.88 ns | 8,956.746 ns | 26,268.585 ns | 384,509.74 ns | 1.00 | 0.00 | 134.7656 | 133.7891 | 133.7891 | 1049020 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | PooledList | 131072 | 22,994.42 ns | 200.079 ns | 187.154 ns | 23,072.79 ns | 0.07 | 0.01 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 0 | 16.15 ns | 0.241 ns | 0.214 ns | 16.23 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 0 | 17.85 ns | 0.072 ns | 0.060 ns | 17.83 ns | 1.11 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 1 | 32.28 ns | 0.676 ns | 1.566 ns | 32.07 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 1 | 20.10 ns | 0.073 ns | 0.057 ns | 20.10 ns | 0.63 | 0.04 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 2 | 31.86 ns | 0.655 ns | 0.851 ns | 32.21 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 2 | 20.23 ns | 0.308 ns | 0.257 ns | 20.10 ns | 0.63 | 0.02 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 3 | 31.76 ns | 0.647 ns | 0.907 ns | 32.17 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 3 | 20.23 ns | 0.150 ns | 0.140 ns | 20.16 ns | 0.63 | 0.02 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 4 | 31.26 ns | 0.648 ns | 1.232 ns | 30.78 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 4 | 19.69 ns | 0.044 ns | 0.041 ns | 19.69 ns | 0.62 | 0.03 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 5 | 32.23 ns | 0.240 ns | 0.225 ns | 32.23 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 5 | 32.98 ns | 0.370 ns | 0.328 ns | 32.86 ns | 1.02 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 6 | 32.48 ns | 0.276 ns | 0.244 ns | 32.35 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 6 | 33.48 ns | 0.297 ns | 0.263 ns | 33.47 ns | 1.03 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 7 | 32.66 ns | 0.205 ns | 0.182 ns | 32.70 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 7 | 32.58 ns | 0.484 ns | 0.452 ns | 32.47 ns | 1.00 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 8 | 32.63 ns | 0.437 ns | 0.387 ns | 32.63 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 8 | 32.34 ns | 0.444 ns | 0.415 ns | 32.20 ns | 0.99 | 0.02 | 0.0918 | - | - | 192 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 9 | 34.15 ns | 0.555 ns | 0.492 ns | 34.27 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 9 | 36.06 ns | 0.580 ns | 0.515 ns | 36.07 ns | 1.06 | 0.02 | 0.1224 | - | - | 256 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 10 | 34.33 ns | 0.342 ns | 0.320 ns | 34.32 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 10 | 35.74 ns | 0.297 ns | 0.278 ns | 35.76 ns | 1.04 | 0.02 | 0.1224 | - | - | 256 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 11 | 35.57 ns | 0.482 ns | 0.451 ns | 35.72 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 11 | 36.92 ns | 0.292 ns | 0.259 ns | 36.96 ns | 1.04 | 0.01 | 0.1224 | - | - | 256 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 12 | 35.80 ns | 0.237 ns | 0.198 ns | 35.82 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 12 | 36.97 ns | 0.168 ns | 0.157 ns | 36.99 ns | 1.03 | 0.01 | 0.1224 | - | - | 256 B | 1.68 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 13 | 36.23 ns | 0.533 ns | 0.445 ns | 36.05 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 13 | 37.27 ns | 0.284 ns | 0.265 ns | 37.28 ns | 1.03 | 0.01 | 0.1224 | - | - | 256 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 14 | 36.29 ns | 0.325 ns | 0.288 ns | 36.38 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 14 | 36.89 ns | 0.174 ns | 0.145 ns | 36.89 ns | 1.02 | 0.01 | 0.1224 | - | - | 256 B | 1.52 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 15 | 36.19 ns | 0.197 ns | 0.184 ns | 36.25 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 15 | 36.12 ns | 0.225 ns | 0.200 ns | 36.10 ns | 1.00 | 0.01 | 0.1224 | - | - | 256 B | 1.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 16 | 35.66 ns | 0.740 ns | 0.792 ns | 35.78 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 16 | 36.26 ns | 0.441 ns | 0.413 ns | 36.34 ns | 1.02 | 0.02 | 0.1224 | - | - | 256 B | 1.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 17 | 36.37 ns | 0.401 ns | 0.375 ns | 36.47 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 17 | 40.32 ns | 0.616 ns | 0.576 ns | 40.42 ns | 1.11 | 0.02 | 0.1836 | - | - | 384 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 18 | 34.98 ns | 0.344 ns | 0.322 ns | 35.11 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 18 | 40.10 ns | 0.477 ns | 0.446 ns | 40.18 ns | 1.15 | 0.01 | 0.1836 | - | - | 384 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 19 | 36.02 ns | 0.487 ns | 0.456 ns | 35.81 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 19 | 41.91 ns | 0.557 ns | 0.521 ns | 41.99 ns | 1.16 | 0.02 | 0.1836 | - | - | 384 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 20 | 38.37 ns | 0.339 ns | 0.317 ns | 38.40 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 20 | 42.52 ns | 0.780 ns | 0.730 ns | 42.63 ns | 1.11 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 30 | 40.30 ns | 0.766 ns | 0.716 ns | 40.30 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 30 | 41.79 ns | 0.604 ns | 0.565 ns | 41.78 ns | 1.04 | 0.02 | 0.1836 | - | - | 384 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 32 | 40.02 ns | 0.213 ns | 0.178 ns | 40.05 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 32 | 41.69 ns | 0.761 ns | 0.675 ns | 41.58 ns | 1.04 | 0.02 | 0.1836 | - | - | 384 B | 1.23 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 36 | 43.42 ns | 0.843 ns | 0.902 ns | 43.43 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 36 | 49.71 ns | 0.484 ns | 0.429 ns | 49.81 ns | 1.15 | 0.02 | 0.0650 | - | - | 136 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 37 | 48.79 ns | 0.472 ns | 0.441 ns | 48.85 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 37 | 50.34 ns | 0.990 ns | 0.972 ns | 50.19 ns | 1.03 | 0.02 | 0.0650 | - | - | 136 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 40 | 50.84 ns | 0.681 ns | 0.604 ns | 50.92 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 40 | 50.89 ns | 0.373 ns | 0.349 ns | 50.96 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 40 | 49.28 ns | 0.562 ns | 0.525 ns | 49.32 ns | 0.97 | 0.02 | 0.0650 | - | - | 136 B | 0.36 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 40 | 50.86 ns | 0.744 ns | 0.696 ns | 50.83 ns | 1.00 | 0.01 | 0.0650 | - | - | 136 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 50 | 54.57 ns | 1.060 ns | 0.991 ns | 54.44 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 50 | 50.32 ns | 0.826 ns | 0.733 ns | 50.39 ns | 0.92 | 0.02 | 0.0650 | - | - | 136 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 60 | 58.36 ns | 0.146 ns | 0.130 ns | 58.37 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 60 | 52.72 ns | 0.390 ns | 0.345 ns | 52.75 ns | 0.90 | 0.01 | 0.0650 | - | - | 136 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 70 | 62.18 ns | 0.863 ns | 0.848 ns | 62.11 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 70 | 50.45 ns | 0.357 ns | 0.298 ns | 50.59 ns | 0.81 | 0.01 | 0.0650 | - | - | 136 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 80 | 67.97 ns | 1.210 ns | 1.132 ns | 67.72 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 80 | 52.77 ns | 0.408 ns | 0.381 ns | 52.84 ns | 0.78 | 0.02 | 0.0650 | - | - | 136 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 90 | 72.24 ns | 0.947 ns | 0.886 ns | 72.15 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 90 | 52.63 ns | 0.478 ns | 0.447 ns | 52.76 ns | 0.73 | 0.01 | 0.0650 | - | - | 136 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 100 | 78.17 ns | 1.094 ns | 1.023 ns | 78.33 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 100 | 56.02 ns | 0.297 ns | 0.263 ns | 55.99 ns | 0.72 | 0.01 | 0.0650 | - | - | 136 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 128 | 92.24 ns | 1.023 ns | 0.957 ns | 92.23 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 128 | 57.56 ns | 0.409 ns | 0.383 ns | 57.56 ns | 0.62 | 0.01 | 0.0650 | - | - | 136 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 256 | 155.31 ns | 2.475 ns | 2.315 ns | 155.45 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 256 | 61.60 ns | 0.607 ns | 0.567 ns | 61.44 ns | 0.40 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 512 | 280.95 ns | 5.048 ns | 4.722 ns | 281.53 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 512 | 79.05 ns | 0.225 ns | 0.188 ns | 79.09 ns | 0.28 | 0.00 | 0.0650 | - | - | 136 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 1024 | 545.69 ns | 10.277 ns | 11.423 ns | 543.53 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 1024 | 117.54 ns | 1.284 ns | 1.201 ns | 116.91 ns | 0.22 | 0.00 | 0.0650 | - | - | 136 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 2048 | 1,076.71 ns | 20.812 ns | 23.967 ns | 1,073.89 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 2048 | 326.44 ns | 1.506 ns | 1.409 ns | 327.01 ns | 0.30 | 0.01 | 0.0648 | - | - | 136 B | 0.008 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 4096 | 2,140.71 ns | 42.356 ns | 56.544 ns | 2,154.15 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 4096 | 650.10 ns | 0.685 ns | 0.607 ns | 650.09 ns | 0.30 | 0.01 | 0.0648 | - | - | 136 B | 0.004 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 8192 | 3,876.78 ns | 25.089 ns | 19.588 ns | 3,878.57 ns | 1.00 | 0.00 | 31.2424 | 0.0076 | - | 65592 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 8192 | 1,103.68 ns | 1.994 ns | 1.768 ns | 1,103.59 ns | 0.28 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 16384 | 63,112.03 ns | 1,251.601 ns | 2,056.416 ns | 63,375.92 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 16384 | 2,451.24 ns | 7.439 ns | 6.958 ns | 2,452.84 ns | 0.04 | 0.00 | 0.0648 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 32768 | 124,751.37 ns | 2,460.834 ns | 5,082.048 ns | 126,176.40 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 32768 | 5,244.02 ns | 3.741 ns | 3.317 ns | 5,244.88 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 65536 | 118,639.17 ns | 1,672.047 ns | 1,564.034 ns | 118,777.62 ns | 1.00 | 0.00 | 118.7744 | 117.6758 | 117.6758 | 525009 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 65536 | 11,438.70 ns | 21.349 ns | 19.970 ns | 11,439.21 ns | 0.10 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 131072 | 353,726.80 ns | 12,759.761 ns | 34,058.385 ns | 350,392.29 ns | 1.00 | 0.00 | 162.1094 | 161.1328 | 161.1328 | 1049021 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 131072 | 25,212.62 ns | 70.204 ns | 65.669 ns | 25,192.50 ns | 0.07 | 0.01 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableList | 850000 | 2,599,598.26 ns | 51,725.617 ns | 111,344.847 ns | 2,615,473.63 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableList | 850000 | 925,293.44 ns | 18,110.282 ns | 18,597.927 ns | 930,489.50 ns | 0.35 | 0.02 | - | - | - | 149 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 0 | 14.85 ns | 0.147 ns | 0.138 ns | 14.90 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 0 | 18.41 ns | 0.129 ns | 0.121 ns | 18.40 ns | 1.24 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 1 | 30.43 ns | 0.239 ns | 0.212 ns | 30.38 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 1 | 69.64 ns | 0.495 ns | 0.439 ns | 69.64 ns | 2.29 | 0.02 | 0.0726 | - | - | 152 B | 1.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 2 | 30.37 ns | 0.271 ns | 0.253 ns | 30.26 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 2 | 68.70 ns | 0.485 ns | 0.430 ns | 68.71 ns | 2.26 | 0.02 | 0.0764 | - | - | 160 B | 1.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 3 | 30.08 ns | 0.071 ns | 0.066 ns | 30.07 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 3 | 66.28 ns | 0.665 ns | 0.622 ns | 66.52 ns | 2.20 | 0.02 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 4 | 30.32 ns | 0.102 ns | 0.091 ns | 30.28 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 4 | 69.72 ns | 0.464 ns | 0.434 ns | 69.81 ns | 2.30 | 0.02 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 5 | 30.68 ns | 0.153 ns | 0.128 ns | 30.70 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 5 | 67.78 ns | 0.353 ns | 0.275 ns | 67.80 ns | 2.21 | 0.01 | 0.0994 | - | - | 208 B | 2.17 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 6 | 31.04 ns | 0.076 ns | 0.059 ns | 31.05 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 6 | 67.41 ns | 1.157 ns | 1.083 ns | 67.63 ns | 2.17 | 0.04 | 0.0994 | - | - | 208 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 7 | 31.52 ns | 0.087 ns | 0.068 ns | 31.55 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 7 | 66.71 ns | 1.132 ns | 1.004 ns | 67.06 ns | 2.12 | 0.03 | 0.0994 | - | - | 208 B | 1.86 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 8 | 31.88 ns | 0.185 ns | 0.173 ns | 31.82 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 8 | 70.41 ns | 0.588 ns | 0.550 ns | 70.45 ns | 2.21 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 9 | 32.10 ns | 0.069 ns | 0.057 ns | 32.11 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 9 | 70.91 ns | 0.656 ns | 0.614 ns | 71.10 ns | 2.21 | 0.02 | 0.1301 | - | - | 272 B | 2.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 10 | 32.46 ns | 0.094 ns | 0.084 ns | 32.43 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 10 | 71.09 ns | 1.003 ns | 0.938 ns | 71.24 ns | 2.19 | 0.03 | 0.1301 | - | - | 272 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 11 | 33.48 ns | 0.087 ns | 0.073 ns | 33.46 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 11 | 70.84 ns | 0.726 ns | 0.679 ns | 70.93 ns | 2.12 | 0.02 | 0.1301 | - | - | 272 B | 1.89 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 12 | 33.62 ns | 0.043 ns | 0.038 ns | 33.63 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 12 | 70.68 ns | 1.056 ns | 0.988 ns | 70.58 ns | 2.10 | 0.03 | 0.1301 | - | - | 272 B | 1.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 13 | 34.18 ns | 0.315 ns | 0.295 ns | 34.03 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 13 | 71.71 ns | 1.133 ns | 1.060 ns | 71.75 ns | 2.10 | 0.04 | 0.1301 | - | - | 272 B | 1.70 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 14 | 34.21 ns | 0.068 ns | 0.057 ns | 34.20 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 14 | 71.65 ns | 0.601 ns | 0.562 ns | 71.85 ns | 2.10 | 0.02 | 0.1301 | - | - | 272 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 15 | 34.60 ns | 0.090 ns | 0.079 ns | 34.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 15 | 71.54 ns | 0.630 ns | 0.559 ns | 71.50 ns | 2.07 | 0.02 | 0.1301 | - | - | 272 B | 1.55 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 16 | 34.85 ns | 0.183 ns | 0.153 ns | 34.90 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 16 | 83.97 ns | 1.698 ns | 3.352 ns | 84.15 ns | 2.45 | 0.13 | 0.1301 | - | - | 272 B | 1.48 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 17 | 37.29 ns | 0.482 ns | 0.428 ns | 37.15 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 17 | 80.01 ns | 1.003 ns | 0.938 ns | 79.98 ns | 2.15 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 18 | 37.23 ns | 0.416 ns | 0.369 ns | 37.05 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 18 | 80.20 ns | 0.913 ns | 0.809 ns | 79.96 ns | 2.15 | 0.03 | 0.1912 | - | - | 400 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 19 | 37.07 ns | 0.752 ns | 0.923 ns | 36.44 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 19 | 79.43 ns | 1.586 ns | 1.697 ns | 78.90 ns | 2.14 | 0.08 | 0.1912 | - | - | 400 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 20 | 37.81 ns | 0.223 ns | 0.197 ns | 37.74 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 20 | 75.96 ns | 0.455 ns | 0.425 ns | 76.07 ns | 2.01 | 0.01 | 0.1912 | - | - | 400 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 30 | 39.59 ns | 0.038 ns | 0.032 ns | 39.59 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 30 | 76.50 ns | 0.461 ns | 0.431 ns | 76.52 ns | 1.93 | 0.01 | 0.1912 | - | - | 400 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 32 | 40.73 ns | 0.212 ns | 0.188 ns | 40.70 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 32 | 80.46 ns | 1.553 ns | 1.453 ns | 79.88 ns | 1.98 | 0.04 | 0.1912 | - | - | 400 B | 1.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 36 | 48.24 ns | 0.427 ns | 0.379 ns | 48.21 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 36 | 92.22 ns | 0.603 ns | 0.535 ns | 92.26 ns | 1.91 | 0.02 | 0.0726 | - | - | 152 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 37 | 48.88 ns | 0.511 ns | 0.478 ns | 48.72 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 37 | 91.57 ns | 1.342 ns | 1.255 ns | 91.84 ns | 1.87 | 0.03 | 0.0726 | - | - | 152 B | 0.43 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 50.61 ns | 0.450 ns | 0.421 ns | 50.55 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 50.27 ns | 0.666 ns | 0.623 ns | 50.42 ns | 0.99 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 89.80 ns | 0.940 ns | 0.834 ns | 89.91 ns | 1.77 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 90.59 ns | 0.678 ns | 0.634 ns | 90.50 ns | 1.79 | 0.01 | 0.0726 | - | - | 152 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 50 | 55.61 ns | 0.625 ns | 0.584 ns | 55.57 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 50 | 92.89 ns | 0.605 ns | 0.536 ns | 92.75 ns | 1.67 | 0.02 | 0.0726 | - | - | 152 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 60 | 59.59 ns | 0.908 ns | 0.849 ns | 59.53 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 60 | 94.27 ns | 1.429 ns | 1.337 ns | 94.09 ns | 1.58 | 0.03 | 0.0726 | - | - | 152 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 70 | 65.62 ns | 0.840 ns | 0.786 ns | 65.53 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 70 | 94.55 ns | 1.144 ns | 1.070 ns | 94.47 ns | 1.44 | 0.03 | 0.0726 | - | - | 152 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 80 | 72.59 ns | 1.420 ns | 1.578 ns | 72.16 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 80 | 96.92 ns | 1.129 ns | 1.056 ns | 96.92 ns | 1.33 | 0.03 | 0.0726 | - | - | 152 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 850000 | 2,690,855.45 ns | 53,766.571 ns | 89,831.862 ns | 2,707,524.80 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 850000 | 1,295,325.44 ns | 11,277.756 ns | 10,549.220 ns | 1,290,476.56 ns | 0.48 | 0.02 | - | - | - | 445 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 90 | 75.37 ns | 1.171 ns | 1.038 ns | 75.32 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 90 | 94.47 ns | 0.968 ns | 0.858 ns | 94.07 ns | 1.25 | 0.02 | 0.0726 | - | - | 152 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 100 | 81.25 ns | 1.056 ns | 0.988 ns | 81.46 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 100 | 95.71 ns | 1.422 ns | 1.330 ns | 96.29 ns | 1.18 | 0.02 | 0.0726 | - | - | 152 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 128 | 94.13 ns | 1.498 ns | 1.401 ns | 94.16 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 128 | 98.42 ns | 1.035 ns | 0.968 ns | 98.19 ns | 1.05 | 0.02 | 0.0726 | - | - | 152 B | 0.14 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 256 | 173.02 ns | 2.780 ns | 2.601 ns | 172.70 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 256 | 107.78 ns | 1.789 ns | 1.673 ns | 108.34 ns | 0.62 | 0.01 | 0.0726 | - | - | 152 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 512 | 291.12 ns | 5.589 ns | 5.489 ns | 290.53 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 512 | 119.91 ns | 1.360 ns | 1.273 ns | 119.55 ns | 0.41 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 1024 | 553.09 ns | 10.563 ns | 9.881 ns | 550.62 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 1024 | 152.24 ns | 0.910 ns | 0.806 ns | 152.48 ns | 0.28 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 2048 | 1,099.63 ns | 20.792 ns | 21.352 ns | 1,104.02 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 2048 | 264.14 ns | 2.546 ns | 2.381 ns | 262.97 ns | 0.24 | 0.00 | 0.0725 | - | - | 152 B | 0.009 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 4096 | 2,210.89 ns | 43.313 ns | 69.943 ns | 2,203.66 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 4096 | 657.39 ns | 1.623 ns | 1.355 ns | 657.71 ns | 0.29 | 0.01 | 0.0725 | - | - | 152 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 8192 | 4,222.80 ns | 83.294 ns | 102.293 ns | 4,181.61 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 8192 | 1,121.18 ns | 6.697 ns | 6.265 ns | 1,120.59 ns | 0.26 | 0.01 | 0.0725 | - | - | 152 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 16384 | 62,475.55 ns | 1,217.739 ns | 1,895.873 ns | 62,726.50 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 16384 | 2,489.20 ns | 19.175 ns | 17.936 ns | 2,479.10 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 32768 | 124,615.51 ns | 2,458.956 ns | 4,796.005 ns | 125,940.44 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 32768 | 5,015.98 ns | 13.517 ns | 12.644 ns | 5,019.64 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 65536 | 118,984.88 ns | 2,258.508 ns | 2,218.157 ns | 119,398.51 ns | 1.00 | 0.00 | 113.2813 | 112.1826 | 112.1826 | 524943 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 65536 | 11,137.89 ns | 15.355 ns | 12.822 ns | 11,134.98 ns | 0.09 | 0.00 | 0.1984 | - | - | 432 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 131072 | 359,919.53 ns | 12,722.538 ns | 37,313.001 ns | 352,663.09 ns | 1.00 | 0.00 | 161.1328 | 161.1328 | 161.1328 | 1048915 B | 1.000 | -| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 131072 | 22,125.65 ns | 109.853 ns | 85.766 ns | 22,117.43 ns | 0.06 | 0.01 | 0.1831 | - | - | 432 B | 0.000 | -
- -# `AddRange` when Source is IEnumerable Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.306 - [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 -``` -
-Add Entire Collection Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|---------------:|-----------------:|---------:|--------:|---------:|---------:|---------:|-----------:|------------:| -| Baseline | AddRa(...)rable [31] | List | Array | 0 | 25.78 ns | 0.196 ns | 0.184 ns | 25.74 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 0 | 17.48 ns | 0.136 ns | 0.127 ns | 17.46 ns | 0.68 | 0.01 | 0.0344 | - | - | 72 B | 0.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 1 | 38.12 ns | 0.349 ns | 0.291 ns | 38.13 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 1 | 24.81 ns | 0.521 ns | 0.659 ns | 24.97 ns | 0.65 | 0.02 | 0.0382 | - | - | 80 B | 0.59 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 2 | 47.49 ns | 0.612 ns | 0.511 ns | 47.43 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 2 | 29.58 ns | 0.108 ns | 0.084 ns | 29.59 ns | 0.62 | 0.01 | 0.0421 | - | - | 88 B | 0.65 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 3 | 56.13 ns | 0.974 ns | 1.042 ns | 55.89 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 3 | 36.85 ns | 0.745 ns | 0.969 ns | 36.63 ns | 0.66 | 0.02 | 0.0459 | - | - | 96 B | 0.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 4 | 61.79 ns | 0.925 ns | 0.865 ns | 61.74 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 4 | 42.51 ns | 0.282 ns | 0.250 ns | 42.49 ns | 0.69 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 5 | 86.55 ns | 1.156 ns | 1.025 ns | 86.76 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 5 | 48.37 ns | 0.288 ns | 0.255 ns | 48.32 ns | 0.56 | 0.01 | 0.0535 | - | - | 112 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 6 | 94.53 ns | 1.186 ns | 1.109 ns | 94.90 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 6 | 54.81 ns | 1.033 ns | 0.966 ns | 55.03 ns | 0.58 | 0.01 | 0.0573 | - | - | 120 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 7 | 99.98 ns | 0.530 ns | 0.414 ns | 100.14 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 7 | 59.97 ns | 0.803 ns | 0.712 ns | 60.19 ns | 0.60 | 0.01 | 0.0612 | - | - | 128 B | 0.57 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 8 | 106.01 ns | 0.746 ns | 0.661 ns | 106.04 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 8 | 64.79 ns | 1.301 ns | 1.217 ns | 65.19 ns | 0.61 | 0.01 | 0.0650 | - | - | 136 B | 0.61 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 9 | 126.55 ns | 2.519 ns | 2.474 ns | 125.55 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 9 | 70.74 ns | 0.618 ns | 0.548 ns | 70.85 ns | 0.56 | 0.01 | 0.0688 | - | - | 144 B | 0.38 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 10 | 133.51 ns | 0.671 ns | 0.595 ns | 133.47 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 10 | 82.73 ns | 1.655 ns | 2.265 ns | 83.34 ns | 0.62 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 11 | 138.47 ns | 0.879 ns | 0.822 ns | 138.30 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 11 | 87.00 ns | 1.704 ns | 2.093 ns | 86.12 ns | 0.63 | 0.02 | 0.0764 | - | - | 160 B | 0.43 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 12 | 145.65 ns | 0.885 ns | 0.739 ns | 145.48 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 12 | 93.81 ns | 1.888 ns | 3.048 ns | 93.70 ns | 0.64 | 0.02 | 0.0802 | - | - | 168 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 13 | 155.25 ns | 2.429 ns | 2.272 ns | 154.63 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 13 | 102.14 ns | 2.033 ns | 3.507 ns | 102.83 ns | 0.66 | 0.03 | 0.0842 | - | - | 176 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 14 | 163.47 ns | 1.738 ns | 1.540 ns | 162.92 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 14 | 107.18 ns | 2.104 ns | 2.423 ns | 107.03 ns | 0.66 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 15 | 171.24 ns | 0.837 ns | 0.742 ns | 171.10 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 15 | 112.40 ns | 2.293 ns | 3.214 ns | 113.21 ns | 0.66 | 0.02 | 0.0918 | - | - | 192 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 16 | 185.53 ns | 0.638 ns | 0.596 ns | 185.57 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 16 | 116.55 ns | 2.308 ns | 2.747 ns | 116.08 ns | 0.63 | 0.02 | 0.0956 | - | - | 200 B | 0.53 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 17 | 214.81 ns | 1.026 ns | 0.909 ns | 214.59 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 17 | 123.02 ns | 2.434 ns | 3.250 ns | 122.88 ns | 0.57 | 0.01 | 0.0994 | - | - | 208 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 18 | 222.01 ns | 1.300 ns | 1.015 ns | 221.91 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 18 | 128.66 ns | 2.550 ns | 3.404 ns | 128.47 ns | 0.57 | 0.02 | 0.1032 | - | - | 216 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 19 | 230.06 ns | 3.628 ns | 3.394 ns | 228.33 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 19 | 133.58 ns | 2.620 ns | 3.407 ns | 132.90 ns | 0.58 | 0.02 | 0.1070 | - | - | 224 B | 0.34 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 20 | 233.44 ns | 0.959 ns | 0.749 ns | 233.33 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 20 | 140.14 ns | 2.803 ns | 4.683 ns | 137.40 ns | 0.60 | 0.02 | 0.1109 | - | - | 232 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 30 | 318.50 ns | 1.697 ns | 1.417 ns | 318.70 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 30 | 190.96 ns | 3.710 ns | 3.471 ns | 188.70 ns | 0.60 | 0.01 | 0.1490 | - | - | 312 B | 0.48 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 32 | 331.76 ns | 2.712 ns | 2.537 ns | 331.16 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 32 | 207.69 ns | 4.152 ns | 7.051 ns | 206.97 ns | 0.62 | 0.02 | 0.1566 | - | - | 328 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 36 | 396.82 ns | 1.849 ns | 1.639 ns | 396.32 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 36 | 232.85 ns | 4.653 ns | 9.610 ns | 229.59 ns | 0.59 | 0.03 | 0.1721 | - | - | 360 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 37 | 406.18 ns | 4.040 ns | 3.779 ns | 404.47 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 37 | 235.24 ns | 4.679 ns | 7.689 ns | 232.85 ns | 0.58 | 0.02 | 0.1760 | - | - | 368 B | 0.31 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 40 | 436.81 ns | 3.098 ns | 2.418 ns | 436.58 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Baseline | AddRa(...)rable [31] | List | Array | 40 | 439.83 ns | 3.243 ns | 2.532 ns | 439.09 ns | 1.01 | 0.01 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 40 | 256.53 ns | 5.154 ns | 10.173 ns | 254.67 ns | 0.58 | 0.02 | 0.1874 | - | - | 392 B | 0.33 | -| Actual | AddRa(...)rable [31] | List | Array | 40 | 262.50 ns | 5.254 ns | 11.083 ns | 260.79 ns | 0.61 | 0.03 | 0.1874 | - | - | 392 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 50 | 524.34 ns | 8.310 ns | 7.773 ns | 527.23 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 50 | 299.45 ns | 1.778 ns | 1.388 ns | 299.34 ns | 0.57 | 0.01 | 0.2255 | - | - | 472 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 60 | 593.14 ns | 9.693 ns | 8.593 ns | 592.38 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 60 | 359.32 ns | 4.618 ns | 4.094 ns | 358.81 ns | 0.61 | 0.01 | 0.2637 | - | - | 552 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 70 | 734.98 ns | 11.308 ns | 10.024 ns | 733.24 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 70 | 423.04 ns | 8.270 ns | 14.044 ns | 419.54 ns | 0.57 | 0.02 | 0.3018 | - | - | 632 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 80 | 811.19 ns | 6.062 ns | 5.062 ns | 810.43 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 80 | 468.13 ns | 2.251 ns | 1.757 ns | 468.50 ns | 0.58 | 0.00 | 0.3405 | - | - | 712 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 90 | 885.58 ns | 12.728 ns | 11.283 ns | 879.70 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 90 | 535.74 ns | 9.655 ns | 12.555 ns | 529.98 ns | 0.61 | 0.02 | 0.3786 | - | - | 792 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 100 | 959.25 ns | 3.028 ns | 2.364 ns | 959.30 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 100 | 596.28 ns | 11.864 ns | 19.822 ns | 585.59 ns | 0.63 | 0.02 | 0.4168 | - | - | 872 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 128 | 1,162.04 ns | 10.489 ns | 9.298 ns | 1,162.35 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 128 | 775.89 ns | 15.377 ns | 35.022 ns | 770.03 ns | 0.70 | 0.02 | 0.5236 | - | - | 1096 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 256 | 2,256.64 ns | 12.465 ns | 11.050 ns | 2,253.95 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 256 | 1,498.60 ns | 29.755 ns | 46.325 ns | 1,482.43 ns | 0.66 | 0.02 | 1.0128 | - | - | 2120 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 512 | 4,358.50 ns | 9.234 ns | 8.186 ns | 4,359.13 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 512 | 2,969.92 ns | 59.027 ns | 93.623 ns | 2,962.38 ns | 0.68 | 0.02 | 1.9913 | - | - | 4168 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 1024 | 8,694.16 ns | 136.576 ns | 127.753 ns | 8,646.62 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 1024 | 5,914.41 ns | 116.704 ns | 155.796 ns | 5,902.23 ns | 0.68 | 0.02 | 3.9520 | - | - | 8264 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 2048 | 17,407.51 ns | 336.986 ns | 360.571 ns | 17,456.07 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 2048 | 11,558.97 ns | 225.751 ns | 241.551 ns | 11,517.43 ns | 0.66 | 0.02 | 7.8125 | - | - | 16456 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 4096 | 33,624.38 ns | 136.060 ns | 106.227 ns | 33,605.55 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 4096 | 23,179.55 ns | 457.688 ns | 670.873 ns | 22,820.25 ns | 0.69 | 0.02 | 15.5945 | - | - | 32840 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 8192 | 67,822.71 ns | 599.387 ns | 531.341 ns | 67,775.43 ns | 1.00 | 0.00 | 62.3779 | - | - | 131408 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 8192 | 47,454.62 ns | 944.141 ns | 1,628.597 ns | 47,098.79 ns | 0.69 | 0.02 | 31.1890 | - | - | 65608 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 16384 | 200,073.30 ns | 717.363 ns | 671.022 ns | 200,232.50 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262518 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 16384 | 134,030.79 ns | 2,261.644 ns | 2,513.811 ns | 133,581.35 ns | 0.67 | 0.01 | 41.5039 | 41.5039 | 41.5039 | 131158 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 32768 | 442,082.44 ns | 1,871.537 ns | 1,562.818 ns | 442,208.79 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524714 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 32768 | 265,042.58 ns | 4,573.977 ns | 4,278.501 ns | 265,496.68 ns | 0.60 | 0.01 | 83.0078 | 83.0078 | 83.0078 | 262244 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 65536 | 732,121.80 ns | 8,507.681 ns | 7,958.090 ns | 731,070.51 ns | 1.00 | 0.00 | 313.4766 | 249.0234 | 249.0234 | 1049062 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 65536 | 479,625.85 ns | 5,911.688 ns | 5,529.796 ns | 480,425.10 ns | 0.66 | 0.01 | 137.6953 | 136.7188 | 136.7188 | 524403 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 131072 | 1,511,039.33 ns | 22,986.416 ns | 20,376.859 ns | 1,503,391.89 ns | 1.00 | 0.00 | 562.5000 | 498.0469 | 496.0938 | 2097834 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 131072 | 968,246.56 ns | 12,624.990 ns | 11,191.725 ns | 968,908.69 ns | 0.64 | 0.01 | 219.7266 | 218.7500 | 218.7500 | 1048717 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | Array | 850000 | 10,320,673.85 ns | 78,151.711 ns | 73,103.159 ns | 10,298,073.44 ns | 1.00 | 0.00 | 406.2500 | 343.7500 | 343.7500 | 16777841 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | Array | 850000 | 5,935,812.81 ns | 54,384.422 ns | 50,871.222 ns | 5,947,553.91 ns | 0.58 | 0.01 | 140.6250 | 140.6250 | 140.6250 | 6800122 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 0 | 22.13 ns | 0.468 ns | 0.500 ns | 21.91 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 0 | 26.39 ns | 0.397 ns | 0.352 ns | 26.23 ns | 1.19 | 0.03 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 1 | 38.27 ns | 0.562 ns | 0.526 ns | 38.29 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 1 | 68.60 ns | 0.339 ns | 0.283 ns | 68.51 ns | 1.79 | 0.03 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 2 | 48.29 ns | 0.585 ns | 0.518 ns | 48.23 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 2 | 78.95 ns | 1.267 ns | 1.123 ns | 78.87 ns | 1.64 | 0.04 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 3 | 55.91 ns | 0.694 ns | 0.615 ns | 55.83 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 3 | 86.25 ns | 0.704 ns | 0.658 ns | 86.18 ns | 1.54 | 0.02 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 4 | 63.95 ns | 0.533 ns | 0.473 ns | 63.72 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 4 | 93.92 ns | 0.283 ns | 0.251 ns | 93.92 ns | 1.47 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 5 | 83.76 ns | 0.904 ns | 0.846 ns | 83.63 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 5 | 101.50 ns | 1.040 ns | 0.973 ns | 101.03 ns | 1.21 | 0.01 | 0.0497 | - | - | 104 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 6 | 90.04 ns | 1.748 ns | 1.635 ns | 90.32 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 6 | 108.32 ns | 0.234 ns | 0.183 ns | 108.30 ns | 1.20 | 0.02 | 0.0497 | - | - | 104 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 7 | 97.88 ns | 0.718 ns | 0.561 ns | 97.95 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 7 | 117.47 ns | 0.226 ns | 0.189 ns | 117.41 ns | 1.20 | 0.01 | 0.0496 | - | - | 104 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 8 | 105.44 ns | 0.899 ns | 0.797 ns | 105.60 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 8 | 134.12 ns | 1.176 ns | 0.982 ns | 133.95 ns | 1.27 | 0.01 | 0.0496 | - | - | 104 B | 0.46 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 9 | 125.47 ns | 2.052 ns | 1.920 ns | 124.64 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 9 | 143.63 ns | 2.001 ns | 1.872 ns | 142.54 ns | 1.14 | 0.02 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 10 | 131.83 ns | 1.060 ns | 0.885 ns | 132.02 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 10 | 150.29 ns | 0.252 ns | 0.211 ns | 150.33 ns | 1.14 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 11 | 139.68 ns | 0.733 ns | 0.650 ns | 139.44 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 11 | 158.71 ns | 0.987 ns | 0.824 ns | 158.61 ns | 1.14 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 12 | 148.03 ns | 2.537 ns | 2.373 ns | 147.21 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 12 | 165.30 ns | 0.671 ns | 0.595 ns | 165.30 ns | 1.12 | 0.02 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 13 | 156.37 ns | 2.689 ns | 2.516 ns | 156.10 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 13 | 173.10 ns | 0.579 ns | 0.513 ns | 173.10 ns | 1.11 | 0.02 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 14 | 160.24 ns | 0.885 ns | 0.739 ns | 160.26 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 14 | 180.99 ns | 0.616 ns | 0.481 ns | 181.03 ns | 1.13 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 15 | 166.65 ns | 2.013 ns | 1.883 ns | 165.98 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 15 | 187.29 ns | 0.791 ns | 0.702 ns | 187.08 ns | 1.12 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 16 | 182.99 ns | 0.578 ns | 0.451 ns | 182.80 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 16 | 195.45 ns | 0.525 ns | 0.410 ns | 195.58 ns | 1.07 | 0.00 | 0.0496 | - | - | 104 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 17 | 212.53 ns | 0.710 ns | 0.555 ns | 212.47 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 17 | 237.68 ns | 2.633 ns | 2.198 ns | 237.28 ns | 1.12 | 0.01 | 0.0496 | - | - | 104 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 18 | 231.13 ns | 2.722 ns | 2.413 ns | 230.55 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 18 | 243.49 ns | 2.684 ns | 2.380 ns | 242.35 ns | 1.05 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 19 | 239.03 ns | 3.811 ns | 3.565 ns | 239.00 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 19 | 255.19 ns | 2.924 ns | 2.592 ns | 255.21 ns | 1.07 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 20 | 245.17 ns | 3.168 ns | 2.808 ns | 244.56 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 20 | 261.34 ns | 3.499 ns | 3.273 ns | 261.39 ns | 1.07 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 30 | 328.00 ns | 6.292 ns | 7.246 ns | 327.58 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 30 | 336.90 ns | 3.981 ns | 3.724 ns | 335.71 ns | 1.02 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 32 | 333.81 ns | 3.597 ns | 3.003 ns | 334.32 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 32 | 354.19 ns | 2.893 ns | 2.259 ns | 353.79 ns | 1.06 | 0.01 | 0.0496 | - | - | 104 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 36 | 409.27 ns | 6.592 ns | 5.843 ns | 408.47 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 36 | 419.60 ns | 8.023 ns | 7.505 ns | 415.52 ns | 1.03 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 37 | 408.60 ns | 1.655 ns | 1.292 ns | 408.40 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 37 | 436.01 ns | 8.149 ns | 7.623 ns | 434.52 ns | 1.07 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 40 | 450.09 ns | 9.015 ns | 8.854 ns | 449.08 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Baseline | AddRa(...)rable [31] | List | PooledList | 40 | 438.16 ns | 3.354 ns | 2.973 ns | 437.01 ns | 0.97 | 0.02 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 40 | 449.47 ns | 4.785 ns | 4.476 ns | 447.83 ns | 1.00 | 0.03 | 0.0496 | - | - | 104 B | 0.09 | -| Actual | AddRa(...)rable [31] | List | PooledList | 40 | 456.59 ns | 7.051 ns | 6.595 ns | 453.36 ns | 1.02 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 50 | 511.15 ns | 2.439 ns | 2.036 ns | 510.38 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 50 | 523.99 ns | 8.585 ns | 7.611 ns | 521.45 ns | 1.03 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 60 | 585.25 ns | 3.570 ns | 3.165 ns | 584.66 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 60 | 593.64 ns | 5.560 ns | 5.201 ns | 591.69 ns | 1.02 | 0.01 | 0.0496 | - | - | 104 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 70 | 754.51 ns | 14.994 ns | 28.888 ns | 744.46 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 70 | 739.33 ns | 9.107 ns | 8.073 ns | 741.52 ns | 0.95 | 0.04 | 0.0496 | - | - | 104 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 80 | 800.61 ns | 6.079 ns | 5.687 ns | 798.07 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 80 | 786.55 ns | 5.322 ns | 4.979 ns | 784.31 ns | 0.98 | 0.01 | 0.0496 | - | - | 104 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 850000 | 10,880,248.44 ns | 207,548.169 ns | 269,871.245 ns | 10,855,839.84 ns | 1.00 | 0.00 | 515.6250 | 453.1250 | 453.1250 | 16777870 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 850000 | 7,411,663.28 ns | 66,913.436 ns | 59,317.019 ns | 7,386,128.12 ns | 0.68 | 0.02 | - | - | - | 111 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 90 | 887.43 ns | 9.837 ns | 8.720 ns | 885.56 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 90 | 878.82 ns | 17.381 ns | 18.597 ns | 872.73 ns | 0.99 | 0.03 | 0.0496 | - | - | 104 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 100 | 959.47 ns | 7.667 ns | 5.986 ns | 958.28 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 100 | 941.29 ns | 12.834 ns | 12.005 ns | 934.22 ns | 0.98 | 0.01 | 0.0496 | - | - | 104 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 128 | 1,184.03 ns | 15.693 ns | 13.911 ns | 1,178.43 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 128 | 1,160.77 ns | 22.821 ns | 21.347 ns | 1,158.93 ns | 0.98 | 0.02 | 0.0496 | - | - | 104 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 256 | 2,344.06 ns | 46.566 ns | 96.168 ns | 2,300.84 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 256 | 2,166.78 ns | 33.918 ns | 30.067 ns | 2,156.83 ns | 0.88 | 0.03 | 0.0496 | - | - | 104 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 512 | 4,413.86 ns | 77.967 ns | 72.930 ns | 4,384.82 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | PooledList | 512 | 4,084.52 ns | 78.821 ns | 69.873 ns | 4,053.80 ns | 0.92 | 0.02 | 0.0458 | - | - | 104 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 1024 | 9,586.15 ns | 189.269 ns | 449.817 ns | 9,654.34 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 1024 | 8,559.76 ns | 168.505 ns | 257.325 ns | 8,612.04 ns | 0.92 | 0.06 | 0.0458 | - | - | 104 B | 0.006 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 2048 | 17,335.83 ns | 329.401 ns | 308.122 ns | 17,127.51 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 2048 | 15,795.48 ns | 306.597 ns | 301.119 ns | 15,749.75 ns | 0.91 | 0.02 | 0.0305 | - | - | 104 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 4096 | 34,530.69 ns | 686.120 ns | 790.137 ns | 34,024.08 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 4096 | 31,110.49 ns | 599.677 ns | 560.938 ns | 30,929.75 ns | 0.90 | 0.02 | - | - | - | 104 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 8192 | 70,399.60 ns | 1,387.534 ns | 2,896.300 ns | 69,156.54 ns | 1.00 | 0.00 | 62.3779 | - | - | 131408 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 8192 | 60,685.22 ns | 895.972 ns | 838.093 ns | 60,283.63 ns | 0.84 | 0.05 | - | - | - | 104 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 16384 | 198,986.52 ns | 2,150.720 ns | 2,011.785 ns | 198,382.28 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262518 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 16384 | 120,307.15 ns | 1,263.434 ns | 1,120.001 ns | 119,916.37 ns | 0.60 | 0.01 | - | - | - | 104 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 32768 | 439,823.29 ns | 4,250.889 ns | 3,976.284 ns | 439,076.12 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524714 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 32768 | 256,719.65 ns | 838.695 ns | 654.798 ns | 256,754.74 ns | 0.58 | 0.01 | - | - | - | 104 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 65536 | 734,694.88 ns | 7,150.954 ns | 6,689.007 ns | 735,449.80 ns | 1.00 | 0.00 | 313.4766 | 249.0234 | 249.0234 | 1049062 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 65536 | 522,905.61 ns | 8,238.839 ns | 7,706.615 ns | 524,219.43 ns | 0.71 | 0.01 | - | - | - | 105 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | PooledList | 131072 | 1,543,131.47 ns | 29,825.765 ns | 39,816.540 ns | 1,530,327.73 ns | 1.00 | 0.00 | 552.7344 | 488.2813 | 486.3281 | 2097866 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | PooledList | 131072 | 1,035,092.20 ns | 9,494.284 ns | 8,880.960 ns | 1,031,517.58 ns | 0.66 | 0.02 | - | - | - | 106 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 0 | 21.90 ns | 0.415 ns | 0.388 ns | 21.86 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 0 | 55.07 ns | 0.785 ns | 0.656 ns | 55.06 ns | 2.51 | 0.05 | 0.0727 | - | - | 152 B | 1.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 1 | 35.50 ns | 0.340 ns | 0.301 ns | 35.36 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 1 | 87.84 ns | 1.096 ns | 0.972 ns | 87.44 ns | 2.47 | 0.02 | 0.0880 | - | - | 184 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 2 | 42.12 ns | 0.095 ns | 0.074 ns | 42.15 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 2 | 98.72 ns | 1.277 ns | 1.132 ns | 98.39 ns | 2.34 | 0.02 | 0.0880 | - | - | 184 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 3 | 49.53 ns | 0.276 ns | 0.244 ns | 49.45 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 3 | 103.72 ns | 0.683 ns | 0.570 ns | 103.84 ns | 2.09 | 0.02 | 0.0880 | - | - | 184 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 4 | 57.02 ns | 0.557 ns | 0.521 ns | 56.67 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 4 | 110.06 ns | 1.329 ns | 1.243 ns | 110.40 ns | 1.93 | 0.03 | 0.0880 | - | - | 184 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 5 | 83.75 ns | 0.579 ns | 0.484 ns | 83.87 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 5 | 114.73 ns | 1.613 ns | 1.508 ns | 114.37 ns | 1.37 | 0.02 | 0.0880 | - | - | 184 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 6 | 90.43 ns | 1.172 ns | 1.097 ns | 90.46 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 6 | 122.22 ns | 2.169 ns | 2.029 ns | 121.69 ns | 1.35 | 0.03 | 0.0880 | - | - | 184 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 7 | 100.04 ns | 0.882 ns | 0.825 ns | 100.29 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 7 | 127.21 ns | 1.125 ns | 1.053 ns | 126.82 ns | 1.27 | 0.01 | 0.0880 | - | - | 184 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 8 | 106.77 ns | 1.207 ns | 1.129 ns | 106.58 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 8 | 136.30 ns | 1.177 ns | 1.044 ns | 136.27 ns | 1.28 | 0.02 | 0.0880 | - | - | 184 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 9 | 129.93 ns | 1.997 ns | 1.868 ns | 129.06 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 9 | 143.39 ns | 1.061 ns | 0.886 ns | 143.22 ns | 1.10 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 10 | 135.18 ns | 0.565 ns | 0.501 ns | 135.08 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 10 | 151.48 ns | 1.556 ns | 1.455 ns | 151.30 ns | 1.12 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 11 | 142.75 ns | 0.637 ns | 0.564 ns | 142.71 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 11 | 158.07 ns | 2.836 ns | 2.514 ns | 156.94 ns | 1.11 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 12 | 149.21 ns | 1.017 ns | 0.901 ns | 148.88 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 12 | 163.10 ns | 1.944 ns | 1.818 ns | 162.86 ns | 1.09 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 13 | 156.64 ns | 1.298 ns | 1.150 ns | 156.25 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 13 | 168.96 ns | 1.992 ns | 1.663 ns | 169.45 ns | 1.08 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 14 | 166.04 ns | 1.523 ns | 1.272 ns | 165.93 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 14 | 177.96 ns | 2.072 ns | 1.938 ns | 178.36 ns | 1.07 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 15 | 173.24 ns | 0.707 ns | 0.627 ns | 173.30 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 15 | 185.99 ns | 1.904 ns | 1.688 ns | 185.60 ns | 1.07 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 16 | 192.52 ns | 2.282 ns | 2.135 ns | 191.69 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 16 | 185.35 ns | 1.169 ns | 1.093 ns | 185.18 ns | 0.96 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 17 | 218.49 ns | 4.210 ns | 3.938 ns | 216.26 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 17 | 196.95 ns | 2.942 ns | 2.752 ns | 195.69 ns | 0.90 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 18 | 225.27 ns | 0.959 ns | 0.850 ns | 225.21 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 18 | 196.42 ns | 2.686 ns | 2.512 ns | 196.49 ns | 0.87 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 19 | 234.68 ns | 2.296 ns | 2.148 ns | 234.06 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 19 | 206.14 ns | 2.101 ns | 1.965 ns | 206.01 ns | 0.88 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 20 | 242.55 ns | 2.033 ns | 1.802 ns | 242.21 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 20 | 237.51 ns | 3.461 ns | 3.238 ns | 236.82 ns | 0.98 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 30 | 321.77 ns | 2.484 ns | 2.202 ns | 321.57 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 30 | 263.23 ns | 3.135 ns | 2.448 ns | 262.31 ns | 0.82 | 0.01 | 0.0877 | - | - | 184 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 32 | 341.53 ns | 4.935 ns | 4.121 ns | 340.91 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 32 | 295.66 ns | 5.933 ns | 12.384 ns | 291.02 ns | 0.87 | 0.03 | 0.0877 | - | - | 184 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 36 | 407.63 ns | 0.882 ns | 0.688 ns | 407.45 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 36 | 329.36 ns | 6.596 ns | 16.908 ns | 328.51 ns | 0.84 | 0.04 | 0.0877 | - | - | 184 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 37 | 449.41 ns | 7.363 ns | 6.887 ns | 449.20 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 37 | 307.73 ns | 1.815 ns | 1.609 ns | 307.34 ns | 0.69 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 40 | 463.89 ns | 4.803 ns | 4.492 ns | 464.07 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 40 | 464.93 ns | 3.704 ns | 3.465 ns | 464.10 ns | 1.00 | 0.01 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 40 | 322.52 ns | 2.145 ns | 1.901 ns | 322.67 ns | 0.69 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 40 | 343.96 ns | 6.690 ns | 5.586 ns | 341.43 ns | 0.74 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 50 | 545.24 ns | 6.773 ns | 6.335 ns | 543.80 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 50 | 405.50 ns | 7.173 ns | 6.710 ns | 402.56 ns | 0.74 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 60 | 611.51 ns | 3.438 ns | 3.048 ns | 611.17 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 60 | 436.62 ns | 2.170 ns | 2.030 ns | 436.04 ns | 0.71 | 0.00 | 0.0877 | - | - | 184 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 70 | 811.47 ns | 12.280 ns | 11.487 ns | 815.18 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 70 | 603.49 ns | 11.842 ns | 11.077 ns | 599.45 ns | 0.74 | 0.02 | 0.1030 | - | - | 216 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 80 | 859.66 ns | 12.058 ns | 11.279 ns | 856.73 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 80 | 664.50 ns | 1.110 ns | 0.867 ns | 664.82 ns | 0.77 | 0.01 | 0.1030 | - | - | 216 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 90 | 991.43 ns | 18.358 ns | 16.274 ns | 997.32 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 90 | 682.24 ns | 2.378 ns | 1.986 ns | 681.82 ns | 0.69 | 0.01 | 0.1030 | - | - | 216 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 100 | 997.85 ns | 4.630 ns | 3.615 ns | 998.54 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 100 | 754.16 ns | 8.127 ns | 7.204 ns | 754.60 ns | 0.75 | 0.01 | 0.1030 | - | - | 216 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 128 | 1,208.34 ns | 8.081 ns | 7.164 ns | 1,209.08 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 128 | 976.30 ns | 5.620 ns | 5.257 ns | 973.53 ns | 0.81 | 0.00 | 0.1030 | - | - | 216 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 256 | 2,314.62 ns | 15.935 ns | 14.906 ns | 2,312.83 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 256 | 1,705.99 ns | 10.982 ns | 9.736 ns | 1,707.46 ns | 0.74 | 0.01 | 0.1183 | - | - | 248 B | 0.06 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 512 | 4,482.16 ns | 23.324 ns | 21.817 ns | 4,483.14 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 512 | 3,443.71 ns | 31.391 ns | 29.363 ns | 3,434.95 ns | 0.77 | 0.01 | 0.1335 | - | - | 280 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 1024 | 8,850.27 ns | 76.433 ns | 67.756 ns | 8,837.98 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 1024 | 6,524.08 ns | 24.421 ns | 20.393 ns | 6,518.63 ns | 0.74 | 0.01 | 0.1450 | - | - | 312 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 2048 | 17,638.01 ns | 208.425 ns | 194.961 ns | 17,645.52 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 2048 | 12,827.77 ns | 55.197 ns | 48.931 ns | 12,800.81 ns | 0.73 | 0.01 | 0.1526 | - | - | 344 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 4096 | 34,696.09 ns | 103.430 ns | 96.748 ns | 34,698.35 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 4096 | 25,527.50 ns | 276.994 ns | 259.100 ns | 25,384.84 ns | 0.74 | 0.01 | 0.1526 | - | - | 376 B | 0.006 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 8192 | 69,429.80 ns | 342.425 ns | 303.551 ns | 69,411.41 ns | 1.00 | 0.00 | 62.5000 | - | - | 131409 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 8192 | 50,481.98 ns | 445.098 ns | 347.504 ns | 50,357.37 ns | 0.73 | 0.01 | 0.1831 | - | - | 408 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 16384 | 205,825.44 ns | 1,126.992 ns | 1,054.189 ns | 206,108.84 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262532 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 16384 | 100,040.85 ns | 406.472 ns | 360.327 ns | 99,968.49 ns | 0.49 | 0.00 | 0.1221 | - | - | 442 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 32768 | 449,865.22 ns | 2,775.842 ns | 2,596.524 ns | 450,479.15 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524756 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 32768 | 205,285.65 ns | 4,037.102 ns | 5,526.031 ns | 204,362.44 ns | 0.46 | 0.01 | - | - | - | 474 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 65536 | 755,415.23 ns | 4,934.526 ns | 4,374.329 ns | 754,912.65 ns | 1.00 | 0.00 | 312.5000 | 248.0469 | 248.0469 | 1049153 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 65536 | 435,044.38 ns | 8,629.603 ns | 16,626.316 ns | 437,810.94 ns | 0.57 | 0.02 | - | - | - | 510 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 131072 | 1,545,422.10 ns | 18,672.077 ns | 16,552.310 ns | 1,544,944.14 ns | 1.00 | 0.00 | 550.7813 | 484.3750 | 484.3750 | 2097978 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 131072 | 854,004.41 ns | 16,611.239 ns | 27,753.649 ns | 860,179.05 ns | 0.55 | 0.02 | - | - | - | 549 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableList | 850000 | 10,686,702.49 ns | 211,218.496 ns | 251,440.595 ns | 10,719,078.91 ns | 1.00 | 0.00 | 546.8750 | 484.3750 | 484.3750 | 16778122 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableList | 850000 | 5,293,758.75 ns | 105,482.908 ns | 121,474.273 ns | 5,290,523.44 ns | 0.50 | 0.02 | - | - | - | 733 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 0 | 21.24 ns | 0.244 ns | 0.228 ns | 21.13 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 0 | 54.83 ns | 0.480 ns | 0.426 ns | 54.65 ns | 2.59 | 0.03 | 0.0650 | - | - | 136 B | 1.70 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 1 | 35.78 ns | 0.167 ns | 0.130 ns | 35.80 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 1 | 242,173.38 ns | 3,287.264 ns | 2,914.074 ns | 241,949.76 ns | 6,777.87 | 87.70 | 114.2578 | 70.0684 | - | 524459 B | 3,856.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 2 | 53.84 ns | 1.091 ns | 1.911 ns | 52.91 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 2 | 122,843.62 ns | 1,234.305 ns | 1,094.179 ns | 122,945.24 ns | 2,249.03 | 78.42 | 95.4590 | 38.8184 | - | 327850 B | 2,410.66 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 3 | 58.63 ns | 0.553 ns | 0.517 ns | 58.34 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 3 | 61,344.96 ns | 1,218.905 ns | 1,897.688 ns | 61,452.93 ns | 1,044.48 | 27.67 | 100.0977 | 20.1416 | - | 229545 B | 1,687.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 4 | 68.42 ns | 1.289 ns | 1.205 ns | 67.96 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 4 | 59,795.14 ns | 1,134.297 ns | 1,393.019 ns | 59,428.66 ns | 875.17 | 30.02 | 99.3652 | 19.8975 | - | 229545 B | 1,687.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 5 | 82.28 ns | 1.431 ns | 1.338 ns | 82.43 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 5 | 35,056.88 ns | 698.299 ns | 1,223.015 ns | 35,204.66 ns | 427.77 | 18.13 | 75.8667 | 15.6250 | - | 180392 B | 805.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 6 | 89.10 ns | 0.985 ns | 0.769 ns | 89.13 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 6 | 33,834.12 ns | 665.554 ns | 1,130.162 ns | 33,915.81 ns | 380.65 | 14.30 | 73.9746 | 17.6392 | - | 180392 B | 805.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 7 | 96.52 ns | 1.241 ns | 1.100 ns | 96.19 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 7 | 33,956.83 ns | 659.700 ns | 903.005 ns | 34,282.02 ns | 353.59 | 9.06 | 73.9136 | 17.6392 | - | 180392 B | 805.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 8 | 105.82 ns | 1.046 ns | 0.978 ns | 105.92 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 8 | 35,307.64 ns | 703.489 ns | 1,194.578 ns | 35,641.86 ns | 335.20 | 11.22 | 78.2471 | 13.3667 | - | 180392 B | 805.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 9 | 132.11 ns | 1.115 ns | 1.043 ns | 131.76 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 9 | 22,396.56 ns | 434.944 ns | 427.173 ns | 22,480.55 ns | 169.68 | 3.07 | 69.0918 | 11.7493 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 10 | 138.59 ns | 0.640 ns | 0.534 ns | 138.74 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 10 | 21,191.67 ns | 412.212 ns | 550.292 ns | 21,252.59 ns | 154.51 | 1.67 | 69.0308 | 11.9019 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 11 | 143.74 ns | 1.239 ns | 1.159 ns | 143.80 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 11 | 22,157.14 ns | 281.844 ns | 249.848 ns | 22,126.26 ns | 154.17 | 2.38 | 69.0613 | 11.8408 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 12 | 152.09 ns | 1.092 ns | 1.022 ns | 151.77 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 12 | 21,624.86 ns | 308.173 ns | 288.265 ns | 21,742.89 ns | 142.19 | 2.55 | 69.1528 | 11.1694 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 13 | 158.74 ns | 1.942 ns | 1.817 ns | 158.17 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 13 | 22,351.98 ns | 440.161 ns | 556.663 ns | 22,411.38 ns | 141.28 | 4.31 | 69.1528 | 10.6201 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 14 | 165.96 ns | 1.955 ns | 1.829 ns | 165.31 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 14 | 22,125.00 ns | 268.176 ns | 237.731 ns | 22,113.45 ns | 133.46 | 2.49 | 69.1223 | 11.6577 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 15 | 172.85 ns | 0.881 ns | 0.824 ns | 172.80 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 15 | 22,542.99 ns | 288.220 ns | 269.601 ns | 22,454.91 ns | 130.42 | 1.84 | 69.0918 | 11.8713 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 16 | 190.23 ns | 1.139 ns | 1.009 ns | 189.73 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 16 | 21,964.76 ns | 288.056 ns | 255.354 ns | 21,966.31 ns | 115.47 | 1.31 | 69.0002 | 11.9629 | - | 155816 B | 414.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 17 | 222.08 ns | 2.240 ns | 1.986 ns | 221.45 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 17 | 15,371.35 ns | 71.041 ns | 55.464 ns | 15,377.95 ns | 69.16 | 0.81 | 65.2771 | 10.1624 | - | 143528 B | 218.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 18 | 229.75 ns | 2.799 ns | 2.618 ns | 229.02 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 18 | 15,488.06 ns | 143.398 ns | 134.135 ns | 15,465.51 ns | 67.42 | 0.82 | 65.3076 | 10.2234 | - | 143528 B | 218.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 19 | 239.92 ns | 3.669 ns | 3.253 ns | 240.21 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 19 | 15,231.72 ns | 157.506 ns | 131.524 ns | 15,283.70 ns | 63.50 | 0.91 | 65.2771 | 10.1929 | - | 143528 B | 218.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 20 | 263.46 ns | 5.282 ns | 9.658 ns | 262.57 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 20 | 15,521.44 ns | 248.027 ns | 219.869 ns | 15,575.36 ns | 59.67 | 2.39 | 65.3076 | 10.1624 | - | 143528 B | 218.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 30 | 328.38 ns | 1.578 ns | 1.232 ns | 328.04 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 30 | 15,413.99 ns | 144.819 ns | 128.379 ns | 15,427.34 ns | 46.91 | 0.46 | 65.2771 | 10.2234 | - | 143528 B | 218.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 32 | 342.78 ns | 1.281 ns | 1.136 ns | 342.68 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 32 | 15,420.49 ns | 268.032 ns | 275.249 ns | 15,392.94 ns | 45.09 | 0.90 | 65.3381 | 10.1624 | - | 143528 B | 218.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 36 | 444.55 ns | 5.822 ns | 5.446 ns | 445.02 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 36 | 6,310.06 ns | 123.759 ns | 206.774 ns | 6,274.89 ns | 14.59 | 0.51 | 3.9978 | - | - | 8360 B | 7.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 37 | 470.02 ns | 8.695 ns | 15.900 ns | 466.01 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 37 | 6,093.13 ns | 80.585 ns | 67.292 ns | 6,081.89 ns | 12.65 | 0.60 | 3.9978 | - | - | 8360 B | 7.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 475.02 ns | 7.382 ns | 6.905 ns | 472.17 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 473.66 ns | 8.149 ns | 7.622 ns | 472.11 ns | 1.00 | 0.02 | 0.5698 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 6,197.49 ns | 115.232 ns | 113.173 ns | 6,206.49 ns | 13.06 | 0.32 | 3.9978 | - | - | 8360 B | 7.01 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 6,199.03 ns | 93.113 ns | 87.098 ns | 6,202.28 ns | 13.05 | 0.24 | 3.9978 | - | - | 8360 B | 7.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 50 | 557.49 ns | 6.963 ns | 6.172 ns | 555.00 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 50 | 6,220.45 ns | 63.771 ns | 59.651 ns | 6,209.36 ns | 11.17 | 0.17 | 3.9978 | - | - | 8360 B | 7.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 60 | 648.63 ns | 11.410 ns | 10.673 ns | 650.46 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 60 | 6,211.75 ns | 124.239 ns | 116.213 ns | 6,169.68 ns | 9.58 | 0.20 | 3.9978 | - | - | 8360 B | 7.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 70 | 791.11 ns | 11.140 ns | 10.420 ns | 789.19 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 70 | 3,609.18 ns | 70.427 ns | 109.647 ns | 3,591.62 ns | 4.52 | 0.14 | 2.0370 | - | - | 4264 B | 1.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 80 | 879.72 ns | 17.456 ns | 20.103 ns | 876.60 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 80 | 3,583.09 ns | 66.536 ns | 71.192 ns | 3,601.66 ns | 4.08 | 0.11 | 2.0370 | - | - | 4264 B | 1.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 850000 | 10,953,562.99 ns | 212,093.928 ns | 208,304.596 ns | 10,946,453.91 ns | 1.00 | 0.00 | 531.2500 | 468.7500 | 468.7500 | 16778108 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 850000 | 5,458,793.54 ns | 43,884.873 ns | 36,645.856 ns | 5,474,311.33 ns | 0.50 | 0.01 | - | - | - | 709 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 90 | 943.68 ns | 9.147 ns | 8.557 ns | 942.25 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 90 | 3,644.09 ns | 72.228 ns | 67.562 ns | 3,650.08 ns | 3.86 | 0.09 | 2.0370 | - | - | 4264 B | 1.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 100 | 1,050.13 ns | 16.040 ns | 15.004 ns | 1,045.07 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 100 | 3,684.75 ns | 49.622 ns | 43.989 ns | 3,695.76 ns | 3.52 | 0.07 | 2.0370 | - | - | 4264 B | 1.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 128 | 1,282.23 ns | 24.572 ns | 29.252 ns | 1,276.40 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 128 | 3,778.82 ns | 74.092 ns | 69.306 ns | 3,790.09 ns | 2.92 | 0.07 | 2.0370 | - | - | 4264 B | 1.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 256 | 2,357.15 ns | 42.713 ns | 49.189 ns | 2,345.21 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 256 | 3,183.61 ns | 36.248 ns | 33.906 ns | 3,179.15 ns | 1.35 | 0.03 | 1.0567 | - | - | 2216 B | 0.51 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 512 | 4,703.72 ns | 88.811 ns | 91.202 ns | 4,677.37 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 512 | 4,093.94 ns | 44.875 ns | 39.781 ns | 4,082.82 ns | 0.87 | 0.02 | 0.6866 | - | - | 1440 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 1024 | 9,174.73 ns | 173.419 ns | 162.216 ns | 9,171.58 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 1024 | 6,896.65 ns | 57.148 ns | 47.721 ns | 6,879.62 ns | 0.75 | 0.02 | 0.3815 | - | - | 800 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 2048 | 18,196.37 ns | 348.065 ns | 427.455 ns | 18,175.82 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.00 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 2048 | 13,153.41 ns | 257.285 ns | 240.665 ns | 13,162.01 ns | 0.73 | 0.02 | 0.2289 | - | - | 480 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 4096 | 35,512.05 ns | 616.418 ns | 576.598 ns | 35,353.27 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 4096 | 26,149.69 ns | 291.788 ns | 243.656 ns | 26,149.77 ns | 0.74 | 0.01 | 0.1526 | - | - | 320 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 8192 | 70,448.28 ns | 1,119.298 ns | 1,046.992 ns | 70,225.56 ns | 1.00 | 0.00 | 62.5000 | - | - | 131409 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 8192 | 50,466.32 ns | 452.676 ns | 401.285 ns | 50,323.60 ns | 0.72 | 0.01 | 0.0610 | - | - | 241 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 16384 | 208,264.65 ns | 3,608.785 ns | 3,375.659 ns | 207,562.87 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262533 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 16384 | 98,150.09 ns | 770.966 ns | 643.791 ns | 97,931.35 ns | 0.47 | 0.01 | 0.1221 | - | - | 482 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 32768 | 451,749.03 ns | 4,315.140 ns | 4,036.385 ns | 452,396.39 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524756 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 32768 | 197,399.79 ns | 3,121.955 ns | 3,340.457 ns | 196,038.61 ns | 0.44 | 0.01 | 0.2441 | - | - | 538 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 65536 | 786,029.00 ns | 14,590.367 ns | 12,933.980 ns | 785,717.87 ns | 1.00 | 0.00 | 313.4766 | 249.0234 | 249.0234 | 1049210 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 65536 | 414,940.61 ns | 7,805.086 ns | 7,300.882 ns | 416,898.93 ns | 0.53 | 0.01 | - | - | - | 582 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 131072 | 1,572,647.55 ns | 29,371.341 ns | 30,162.205 ns | 1,570,304.49 ns | 1.00 | 0.00 | 548.8281 | 482.4219 | 482.4219 | 2097989 B | 1.000 | -| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 131072 | 845,513.99 ns | 11,990.075 ns | 10,012.256 ns | 840,984.47 ns | 0.54 | 0.01 | - | - | - | 621 B | 0.000 | -
- -# `AddRange` when Source is IList Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.306 - [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 -``` -
-Add Entire Collection Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|----------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | AddRa(...)IList [25] | List | Array | 0 | 11.561 ns | 0.0952 ns | 0.0890 ns | 11.533 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 0 | 9.782 ns | 0.0406 ns | 0.0360 ns | 9.774 ns | 0.85 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 1 | 30.887 ns | 0.2160 ns | 0.1915 ns | 30.816 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 1 | 16.521 ns | 0.1141 ns | 0.1011 ns | 16.478 ns | 0.53 | 0.00 | 0.0153 | - | - | 32 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 2 | 30.927 ns | 0.1817 ns | 0.1611 ns | 30.939 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 2 | 16.872 ns | 0.1693 ns | 0.1584 ns | 16.816 ns | 0.55 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 3 | 31.020 ns | 0.3183 ns | 0.2978 ns | 30.927 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 3 | 16.985 ns | 0.1386 ns | 0.1297 ns | 16.958 ns | 0.55 | 0.01 | 0.0229 | - | - | 48 B | 0.55 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 4 | 30.893 ns | 0.1192 ns | 0.1057 ns | 30.900 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 4 | 17.427 ns | 0.1497 ns | 0.1327 ns | 17.423 ns | 0.56 | 0.00 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 5 | 31.337 ns | 0.3092 ns | 0.2741 ns | 31.228 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 5 | 17.753 ns | 0.3123 ns | 0.2921 ns | 17.764 ns | 0.57 | 0.01 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 6 | 31.526 ns | 0.1789 ns | 0.1494 ns | 31.487 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 6 | 17.893 ns | 0.1490 ns | 0.1320 ns | 17.843 ns | 0.57 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 7 | 31.588 ns | 0.0404 ns | 0.0316 ns | 31.584 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 7 | 18.253 ns | 0.1078 ns | 0.1009 ns | 18.210 ns | 0.58 | 0.00 | 0.0382 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 8 | 31.822 ns | 0.1194 ns | 0.0997 ns | 31.807 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 8 | 18.796 ns | 0.1734 ns | 0.1537 ns | 18.760 ns | 0.59 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 9 | 32.727 ns | 0.1830 ns | 0.1622 ns | 32.705 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 9 | 19.057 ns | 0.0349 ns | 0.0291 ns | 19.053 ns | 0.58 | 0.00 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 10 | 32.955 ns | 0.0982 ns | 0.0918 ns | 32.977 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 10 | 19.487 ns | 0.0434 ns | 0.0406 ns | 19.481 ns | 0.59 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 11 | 33.982 ns | 0.0925 ns | 0.0820 ns | 33.960 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 11 | 20.028 ns | 0.0508 ns | 0.0451 ns | 20.036 ns | 0.59 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 12 | 34.230 ns | 0.1326 ns | 0.1175 ns | 34.239 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 12 | 20.367 ns | 0.0507 ns | 0.0423 ns | 20.363 ns | 0.60 | 0.00 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 13 | 34.708 ns | 0.0795 ns | 0.0705 ns | 34.702 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 13 | 20.585 ns | 0.0638 ns | 0.0533 ns | 20.605 ns | 0.59 | 0.00 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 14 | 34.910 ns | 0.2307 ns | 0.1927 ns | 34.852 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 14 | 20.834 ns | 0.1324 ns | 0.1174 ns | 20.801 ns | 0.60 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 15 | 35.028 ns | 0.2072 ns | 0.1837 ns | 34.957 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 15 | 21.328 ns | 0.1690 ns | 0.1498 ns | 21.361 ns | 0.61 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 16 | 35.412 ns | 0.3122 ns | 0.2921 ns | 35.398 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 16 | 21.820 ns | 0.2015 ns | 0.1682 ns | 21.786 ns | 0.62 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 17 | 36.019 ns | 0.1591 ns | 0.1242 ns | 36.007 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 17 | 21.641 ns | 0.0269 ns | 0.0210 ns | 21.645 ns | 0.60 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 18 | 35.666 ns | 0.1202 ns | 0.1066 ns | 35.651 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 18 | 22.160 ns | 0.0412 ns | 0.0365 ns | 22.162 ns | 0.62 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 19 | 36.616 ns | 0.1072 ns | 0.1002 ns | 36.616 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 19 | 22.770 ns | 0.0372 ns | 0.0291 ns | 22.766 ns | 0.62 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 20 | 37.018 ns | 0.1070 ns | 0.0893 ns | 37.009 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 20 | 23.053 ns | 0.0319 ns | 0.0267 ns | 23.058 ns | 0.62 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 30 | 40.198 ns | 0.0746 ns | 0.0698 ns | 40.209 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 30 | 26.306 ns | 0.0476 ns | 0.0397 ns | 26.306 ns | 0.65 | 0.00 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 32 | 41.025 ns | 0.0718 ns | 0.0560 ns | 41.034 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 32 | 27.334 ns | 0.0474 ns | 0.0443 ns | 27.329 ns | 0.67 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 36 | 49.029 ns | 0.4502 ns | 0.4211 ns | 48.973 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 36 | 33.956 ns | 0.3211 ns | 0.3003 ns | 33.924 ns | 0.69 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 37 | 49.276 ns | 0.3163 ns | 0.2469 ns | 49.330 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 37 | 35.178 ns | 0.3446 ns | 0.3055 ns | 35.098 ns | 0.71 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 40 | 50.841 ns | 0.5103 ns | 0.4524 ns | 50.682 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)IList [25] | List | Array | 40 | 50.833 ns | 0.5447 ns | 0.5095 ns | 50.910 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 40 | 36.350 ns | 0.3127 ns | 0.2772 ns | 36.325 ns | 0.72 | 0.01 | 0.1644 | - | - | 344 B | 0.91 | -| Actual | AddRa(...)IList [25] | List | Array | 40 | 35.943 ns | 0.2114 ns | 0.1978 ns | 35.984 ns | 0.71 | 0.01 | 0.1644 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 50 | 55.876 ns | 0.5287 ns | 0.4687 ns | 55.975 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 50 | 41.327 ns | 0.3464 ns | 0.3240 ns | 41.384 ns | 0.74 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 60 | 60.153 ns | 1.1107 ns | 1.0390 ns | 60.539 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 60 | 46.532 ns | 0.4100 ns | 0.3835 ns | 46.534 ns | 0.77 | 0.02 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 70 | 64.312 ns | 0.8018 ns | 0.7500 ns | 64.353 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 70 | 51.531 ns | 0.5393 ns | 0.5045 ns | 51.358 ns | 0.80 | 0.01 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 80 | 69.591 ns | 0.8384 ns | 0.7842 ns | 69.782 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 80 | 53.840 ns | 1.0982 ns | 1.3889 ns | 53.336 ns | 0.78 | 0.02 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 90 | 75.388 ns | 1.0285 ns | 0.9117 ns | 75.309 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 90 | 58.507 ns | 0.3529 ns | 0.3301 ns | 58.386 ns | 0.78 | 0.01 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 100 | 81.709 ns | 0.8223 ns | 0.7692 ns | 81.595 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 100 | 64.289 ns | 1.0734 ns | 1.0041 ns | 64.239 ns | 0.79 | 0.01 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 128 | 92.710 ns | 1.4550 ns | 1.3610 ns | 92.521 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 128 | 78.214 ns | 0.5141 ns | 0.4809 ns | 78.205 ns | 0.84 | 0.01 | 0.5009 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 256 | 158.083 ns | 2.0865 ns | 1.9517 ns | 158.151 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 256 | 138.683 ns | 1.2822 ns | 1.1366 ns | 138.785 ns | 0.88 | 0.01 | 0.9899 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 512 | 281.664 ns | 5.5848 ns | 5.7352 ns | 282.142 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 512 | 255.959 ns | 2.0557 ns | 1.7166 ns | 256.302 ns | 0.91 | 0.02 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 1024 | 549.075 ns | 10.9479 ns | 11.7141 ns | 549.289 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 1024 | 509.102 ns | 5.6384 ns | 5.2741 ns | 508.597 ns | 0.92 | 0.02 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 2048 | 1,064.091 ns | 20.2860 ns | 24.1491 ns | 1,060.544 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 2048 | 951.449 ns | 18.6972 ns | 17.4894 ns | 946.171 ns | 0.89 | 0.02 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 4096 | 2,116.288 ns | 31.3652 ns | 27.8044 ns | 2,114.965 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 4096 | 1,983.915 ns | 39.7221 ns | 37.1561 ns | 1,998.955 ns | 0.94 | 0.02 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 8192 | 3,953.464 ns | 44.5599 ns | 45.7598 ns | 3,936.942 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 8192 | 3,806.840 ns | 64.6403 ns | 53.9776 ns | 3,812.026 ns | 0.96 | 0.02 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 16384 | 65,027.839 ns | 1,313.6789 ns | 3,873.4120 ns | 65,996.844 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 16384 | 64,941.044 ns | 1,287.4233 ns | 3,755.4741 ns | 65,528.821 ns | 1.00 | 0.08 | 41.6260 | 41.6260 | 41.6260 | 131123 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 32768 | 129,345.736 ns | 2,683.2450 ns | 7,911.6083 ns | 129,610.901 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 32768 | 125,133.467 ns | 2,474.2627 ns | 5,685.0300 ns | 125,954.346 ns | 0.97 | 0.07 | 83.2520 | 83.2520 | 83.2520 | 262222 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 65536 | 124,025.820 ns | 2,445.4793 ns | 2,718.1437 ns | 123,502.734 ns | 1.00 | 0.00 | 125.2441 | 124.2676 | 124.2676 | 524893 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 65536 | 125,483.961 ns | 2,483.1422 ns | 3,140.3799 ns | 124,636.328 ns | 1.01 | 0.04 | 116.6992 | 116.4551 | 116.4551 | 524387 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 131072 | 306,819.266 ns | 6,118.1585 ns | 8,374.6044 ns | 307,005.542 ns | 1.00 | 0.00 | 191.8945 | 190.4297 | 190.4297 | 1049230 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 131072 | 309,582.061 ns | 6,102.8761 ns | 8,555.3800 ns | 308,461.304 ns | 1.01 | 0.04 | 201.6602 | 201.1719 | 201.1719 | 1048723 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | Array | 850000 | 3,451,548.203 ns | 120,204.4577 ns | 354,425.5555 ns | 3,522,158.594 ns | 1.00 | 0.00 | 171.8750 | 171.8750 | 171.8750 | 6800215 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | Array | 850000 | 3,492,861.539 ns | 87,128.2228 ns | 256,899.5307 ns | 3,480,016.016 ns | 1.02 | 0.12 | 175.7813 | 175.7813 | 175.7813 | 6800182 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 0 | 10.109 ns | 0.0399 ns | 0.0334 ns | 10.100 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 0 | 14.650 ns | 0.0529 ns | 0.0442 ns | 14.650 ns | 1.45 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 1 | 30.894 ns | 0.0484 ns | 0.0404 ns | 30.900 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 1 | 54.664 ns | 0.4874 ns | 0.4559 ns | 54.757 ns | 1.77 | 0.02 | 0.0267 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 2 | 31.072 ns | 0.3179 ns | 0.2818 ns | 31.117 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 2 | 54.812 ns | 0.6247 ns | 0.5844 ns | 54.656 ns | 1.76 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 3 | 31.067 ns | 0.1880 ns | 0.1468 ns | 31.092 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 3 | 55.097 ns | 0.3519 ns | 0.3119 ns | 55.057 ns | 1.77 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 4 | 30.937 ns | 0.2062 ns | 0.1722 ns | 30.972 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 4 | 53.967 ns | 0.5870 ns | 0.5204 ns | 53.788 ns | 1.74 | 0.02 | 0.0267 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 5 | 31.492 ns | 0.2808 ns | 0.2626 ns | 31.462 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 5 | 55.160 ns | 0.6057 ns | 0.5665 ns | 55.190 ns | 1.75 | 0.02 | 0.0267 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 6 | 31.581 ns | 0.2464 ns | 0.2185 ns | 31.486 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 6 | 55.440 ns | 0.9516 ns | 0.8901 ns | 55.658 ns | 1.75 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 7 | 31.885 ns | 0.1909 ns | 0.1692 ns | 31.807 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 7 | 53.472 ns | 0.5804 ns | 0.5145 ns | 53.528 ns | 1.68 | 0.02 | 0.0267 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 8 | 31.843 ns | 0.1115 ns | 0.0988 ns | 31.852 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 8 | 54.059 ns | 0.5702 ns | 0.5333 ns | 54.221 ns | 1.70 | 0.02 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 9 | 32.882 ns | 0.2576 ns | 0.2284 ns | 32.841 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 9 | 56.155 ns | 0.8924 ns | 0.8347 ns | 56.340 ns | 1.71 | 0.03 | 0.0267 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 10 | 33.201 ns | 0.3842 ns | 0.3594 ns | 33.010 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 10 | 57.274 ns | 0.8838 ns | 0.8267 ns | 57.432 ns | 1.73 | 0.04 | 0.0267 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 11 | 34.248 ns | 0.4626 ns | 0.4327 ns | 34.008 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 11 | 56.770 ns | 0.6994 ns | 0.6542 ns | 56.878 ns | 1.66 | 0.02 | 0.0267 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 12 | 34.345 ns | 0.1920 ns | 0.1702 ns | 34.262 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 12 | 56.465 ns | 0.7831 ns | 0.7325 ns | 56.272 ns | 1.65 | 0.02 | 0.0267 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 13 | 34.667 ns | 0.2287 ns | 0.2139 ns | 34.596 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 13 | 57.184 ns | 0.5465 ns | 0.4844 ns | 57.189 ns | 1.65 | 0.01 | 0.0267 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 14 | 35.081 ns | 0.1810 ns | 0.1693 ns | 35.067 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 14 | 56.229 ns | 0.5598 ns | 0.5237 ns | 56.276 ns | 1.60 | 0.01 | 0.0267 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 15 | 35.284 ns | 0.0622 ns | 0.0519 ns | 35.263 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 15 | 56.588 ns | 0.8965 ns | 0.8386 ns | 56.413 ns | 1.61 | 0.02 | 0.0267 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 16 | 35.556 ns | 0.1859 ns | 0.1648 ns | 35.519 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 16 | 56.044 ns | 0.6294 ns | 0.5888 ns | 56.125 ns | 1.58 | 0.02 | 0.0267 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 17 | 35.601 ns | 0.0829 ns | 0.0735 ns | 35.607 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 17 | 56.008 ns | 0.6647 ns | 0.6218 ns | 55.821 ns | 1.57 | 0.02 | 0.0267 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 18 | 35.894 ns | 0.3423 ns | 0.3034 ns | 35.740 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 18 | 56.599 ns | 0.6876 ns | 0.6096 ns | 56.450 ns | 1.58 | 0.02 | 0.0267 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 19 | 36.732 ns | 0.1739 ns | 0.1452 ns | 36.684 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 19 | 73.265 ns | 0.3722 ns | 0.3299 ns | 73.190 ns | 1.99 | 0.01 | 0.0267 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 20 | 37.093 ns | 0.2831 ns | 0.2510 ns | 36.971 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 20 | 58.017 ns | 0.4944 ns | 0.4129 ns | 58.121 ns | 1.56 | 0.02 | 0.0267 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 30 | 40.556 ns | 0.2538 ns | 0.2374 ns | 40.508 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 30 | 58.084 ns | 0.7491 ns | 0.6640 ns | 57.896 ns | 1.43 | 0.02 | 0.0267 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 32 | 41.118 ns | 0.2689 ns | 0.2515 ns | 41.099 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 32 | 57.374 ns | 1.1336 ns | 1.0604 ns | 57.057 ns | 1.40 | 0.03 | 0.0267 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 36 | 48.473 ns | 0.4292 ns | 0.4015 ns | 48.396 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 36 | 62.450 ns | 0.2505 ns | 0.2220 ns | 62.433 ns | 1.29 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 37 | 49.121 ns | 0.4816 ns | 0.4269 ns | 49.022 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 37 | 61.496 ns | 1.1423 ns | 1.0685 ns | 61.561 ns | 1.25 | 0.02 | 0.0267 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 40 | 50.690 ns | 0.5339 ns | 0.4733 ns | 50.603 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)IList [25] | List | PooledList | 40 | 51.017 ns | 0.4182 ns | 0.3912 ns | 50.976 ns | 1.01 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 40 | 60.131 ns | 0.6523 ns | 0.5783 ns | 60.192 ns | 1.19 | 0.02 | 0.0267 | - | - | 56 B | 0.15 | -| Actual | AddRa(...)IList [25] | List | PooledList | 40 | 60.715 ns | 0.5925 ns | 0.5542 ns | 60.921 ns | 1.20 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 50 | 55.576 ns | 0.3552 ns | 0.3149 ns | 55.557 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 50 | 64.926 ns | 0.7339 ns | 0.6865 ns | 64.989 ns | 1.17 | 0.01 | 0.0267 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 60 | 59.674 ns | 0.9602 ns | 0.8512 ns | 59.822 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 60 | 63.438 ns | 0.7619 ns | 0.7127 ns | 63.402 ns | 1.06 | 0.02 | 0.0267 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 70 | 66.442 ns | 1.1041 ns | 1.0328 ns | 66.359 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 70 | 66.461 ns | 0.7842 ns | 0.7335 ns | 66.596 ns | 1.00 | 0.02 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 80 | 70.782 ns | 0.8726 ns | 0.8162 ns | 70.860 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 80 | 66.146 ns | 0.2943 ns | 0.2457 ns | 66.140 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 850000 | 2,520,368.112 ns | 23,734.4002 ns | 22,201.1726 ns | 2,516,511.133 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 850000 | 1,455,313.070 ns | 5,962.7425 ns | 4,655.3171 ns | 1,453,272.168 ns | 0.58 | 0.01 | - | - | - | 82 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 90 | 76.598 ns | 1.2409 ns | 1.1000 ns | 76.878 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 90 | 66.730 ns | 0.3418 ns | 0.3030 ns | 66.654 ns | 0.87 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 100 | 80.429 ns | 0.9076 ns | 0.8490 ns | 80.258 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 100 | 66.371 ns | 0.9463 ns | 0.7902 ns | 66.440 ns | 0.82 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 128 | 93.337 ns | 1.4172 ns | 1.3256 ns | 93.539 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 128 | 66.341 ns | 0.6787 ns | 0.6349 ns | 66.462 ns | 0.71 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 256 | 156.577 ns | 2.2610 ns | 2.1149 ns | 156.954 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 256 | 77.210 ns | 1.0303 ns | 0.9638 ns | 77.487 ns | 0.49 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 512 | 285.824 ns | 5.7056 ns | 5.8592 ns | 285.271 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | PooledList | 512 | 94.687 ns | 1.6892 ns | 1.5801 ns | 94.770 ns | 0.33 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 1024 | 547.219 ns | 10.7280 ns | 13.1750 ns | 543.768 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 1024 | 125.771 ns | 0.9057 ns | 0.8472 ns | 125.709 ns | 0.23 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 2048 | 1,079.753 ns | 19.7248 ns | 18.4506 ns | 1,078.116 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 2048 | 244.736 ns | 0.3130 ns | 0.2775 ns | 244.771 ns | 0.23 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 4096 | 2,083.964 ns | 39.0491 ns | 36.5266 ns | 2,071.794 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 4096 | 599.418 ns | 2.8731 ns | 2.6875 ns | 597.939 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 8192 | 3,974.473 ns | 74.3755 ns | 65.9319 ns | 3,952.464 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 8192 | 1,150.329 ns | 5.4272 ns | 5.0766 ns | 1,148.314 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 16384 | 64,586.399 ns | 1,285.7132 ns | 2,383.1518 ns | 64,706.549 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131154 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 16384 | 2,227.499 ns | 3.7093 ns | 3.2882 ns | 2,228.010 ns | 0.03 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 32768 | 127,391.077 ns | 2,578.4185 ns | 7,602.5250 ns | 129,305.945 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 32768 | 4,719.842 ns | 12.0225 ns | 10.6576 ns | 4,719.759 ns | 0.04 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 65536 | 129,773.814 ns | 2,523.2607 ns | 3,098.7908 ns | 130,421.252 ns | 1.00 | 0.00 | 112.0605 | 111.0840 | 111.0840 | 525042 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 65536 | 10,743.036 ns | 17.4562 ns | 15.4745 ns | 10,741.354 ns | 0.08 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | PooledList | 131072 | 379,768.488 ns | 7,466.2023 ns | 10,466.5729 ns | 381,160.303 ns | 1.00 | 0.00 | 168.9453 | 167.9688 | 167.9688 | 1049081 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | PooledList | 131072 | 22,723.708 ns | 132.3462 ns | 123.7967 ns | 22,677.478 ns | 0.06 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 0 | 10.556 ns | 0.1377 ns | 0.1221 ns | 10.593 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 0 | 22.582 ns | 0.2576 ns | 0.2151 ns | 22.525 ns | 2.14 | 0.04 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 1 | 30.934 ns | 0.1036 ns | 0.0865 ns | 30.906 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 1 | 31.276 ns | 0.1281 ns | 0.1136 ns | 31.263 ns | 1.01 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 2 | 31.017 ns | 0.1996 ns | 0.1867 ns | 30.917 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 2 | 31.332 ns | 0.3444 ns | 0.3222 ns | 31.199 ns | 1.01 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 3 | 30.975 ns | 0.1415 ns | 0.1324 ns | 30.976 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 3 | 31.215 ns | 0.2941 ns | 0.2607 ns | 31.289 ns | 1.01 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 4 | 30.572 ns | 0.1119 ns | 0.1047 ns | 30.568 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 4 | 31.021 ns | 0.3081 ns | 0.2882 ns | 30.868 ns | 1.01 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 5 | 31.091 ns | 0.1006 ns | 0.0892 ns | 31.070 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 5 | 43.284 ns | 0.4728 ns | 0.4423 ns | 43.043 ns | 1.39 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 6 | 31.501 ns | 0.0543 ns | 0.0508 ns | 31.509 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 6 | 42.989 ns | 0.1585 ns | 0.1237 ns | 42.950 ns | 1.36 | 0.00 | 0.0918 | - | - | 192 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 7 | 31.793 ns | 0.2292 ns | 0.2144 ns | 31.732 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 7 | 43.253 ns | 0.2087 ns | 0.1743 ns | 43.267 ns | 1.36 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 8 | 32.056 ns | 0.2277 ns | 0.2130 ns | 32.007 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 8 | 42.991 ns | 0.2103 ns | 0.1756 ns | 42.948 ns | 1.34 | 0.01 | 0.0918 | - | - | 192 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 9 | 32.645 ns | 0.2217 ns | 0.2074 ns | 32.605 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 9 | 46.822 ns | 0.8454 ns | 0.7908 ns | 46.790 ns | 1.43 | 0.03 | 0.1224 | - | - | 256 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 10 | 32.990 ns | 0.3022 ns | 0.2827 ns | 32.853 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 10 | 47.038 ns | 0.6039 ns | 0.5354 ns | 47.053 ns | 1.43 | 0.01 | 0.1224 | - | - | 256 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 11 | 33.714 ns | 0.0654 ns | 0.0511 ns | 33.729 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 11 | 46.832 ns | 0.3533 ns | 0.3132 ns | 46.754 ns | 1.39 | 0.01 | 0.1224 | - | - | 256 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 12 | 33.891 ns | 0.1144 ns | 0.0893 ns | 33.890 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 12 | 46.540 ns | 0.4162 ns | 0.3689 ns | 46.369 ns | 1.37 | 0.01 | 0.1224 | - | - | 256 B | 1.68 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 13 | 34.447 ns | 0.1012 ns | 0.0845 ns | 34.408 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 13 | 46.713 ns | 0.4259 ns | 0.3776 ns | 46.567 ns | 1.36 | 0.01 | 0.1224 | - | - | 256 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 14 | 34.855 ns | 0.1577 ns | 0.1317 ns | 34.821 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 14 | 46.945 ns | 0.2243 ns | 0.1988 ns | 46.972 ns | 1.35 | 0.01 | 0.1224 | - | - | 256 B | 1.52 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 15 | 34.923 ns | 0.1695 ns | 0.1502 ns | 34.860 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 15 | 46.334 ns | 0.3718 ns | 0.3478 ns | 46.237 ns | 1.33 | 0.01 | 0.1224 | - | - | 256 B | 1.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 16 | 35.087 ns | 0.1825 ns | 0.1707 ns | 35.114 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 16 | 46.055 ns | 0.2463 ns | 0.2183 ns | 46.020 ns | 1.31 | 0.01 | 0.1224 | - | - | 256 B | 1.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 17 | 35.473 ns | 0.1741 ns | 0.1359 ns | 35.410 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 17 | 51.173 ns | 0.4867 ns | 0.4064 ns | 50.947 ns | 1.44 | 0.01 | 0.1836 | - | - | 384 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 18 | 35.428 ns | 0.0679 ns | 0.0567 ns | 35.428 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 18 | 50.516 ns | 0.4454 ns | 0.4167 ns | 50.472 ns | 1.43 | 0.01 | 0.1836 | - | - | 384 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 19 | 36.520 ns | 0.2362 ns | 0.2209 ns | 36.435 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 19 | 51.992 ns | 0.5031 ns | 0.4460 ns | 52.101 ns | 1.42 | 0.01 | 0.1836 | - | - | 384 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 20 | 37.032 ns | 0.1528 ns | 0.1354 ns | 37.002 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 20 | 52.423 ns | 0.4830 ns | 0.4282 ns | 52.431 ns | 1.42 | 0.01 | 0.1836 | - | - | 384 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 30 | 40.212 ns | 0.0826 ns | 0.0690 ns | 40.241 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 30 | 53.643 ns | 0.8850 ns | 0.8278 ns | 53.834 ns | 1.34 | 0.02 | 0.1836 | - | - | 384 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 32 | 40.597 ns | 0.2112 ns | 0.1872 ns | 40.583 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 32 | 51.593 ns | 0.8684 ns | 0.8123 ns | 51.203 ns | 1.27 | 0.02 | 0.1836 | - | - | 384 B | 1.23 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 36 | 49.492 ns | 0.3177 ns | 0.2972 ns | 49.488 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 36 | 69.912 ns | 0.5021 ns | 0.4193 ns | 69.921 ns | 1.41 | 0.01 | 0.0650 | - | - | 136 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 37 | 49.991 ns | 0.3507 ns | 0.3281 ns | 49.943 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 37 | 61.196 ns | 0.7443 ns | 0.6216 ns | 61.256 ns | 1.22 | 0.01 | 0.0650 | - | - | 136 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 40 | 50.410 ns | 0.5518 ns | 0.5162 ns | 50.364 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 40 | 50.093 ns | 0.4844 ns | 0.4294 ns | 50.112 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 40 | 66.396 ns | 0.6599 ns | 0.5850 ns | 66.354 ns | 1.32 | 0.02 | 0.0650 | - | - | 136 B | 0.36 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 40 | 64.040 ns | 1.2770 ns | 1.1945 ns | 64.447 ns | 1.27 | 0.03 | 0.0650 | - | - | 136 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 50 | 54.756 ns | 0.4812 ns | 0.4266 ns | 54.702 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 50 | 65.578 ns | 1.2450 ns | 1.1645 ns | 65.451 ns | 1.20 | 0.02 | 0.0650 | - | - | 136 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 60 | 58.328 ns | 0.2445 ns | 0.2287 ns | 58.339 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 60 | 68.801 ns | 0.3399 ns | 0.3013 ns | 68.802 ns | 1.18 | 0.00 | 0.0650 | - | - | 136 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 70 | 64.164 ns | 0.9150 ns | 0.8558 ns | 64.039 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 70 | 63.476 ns | 0.7882 ns | 0.7373 ns | 63.472 ns | 0.99 | 0.02 | 0.0650 | - | - | 136 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 80 | 68.632 ns | 1.0906 ns | 1.0202 ns | 68.545 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 80 | 68.444 ns | 1.0898 ns | 0.9661 ns | 68.687 ns | 1.00 | 0.02 | 0.0650 | - | - | 136 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 90 | 73.865 ns | 1.0296 ns | 0.9631 ns | 74.175 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 90 | 62.814 ns | 0.7448 ns | 0.6602 ns | 62.828 ns | 0.85 | 0.02 | 0.0650 | - | - | 136 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 100 | 78.313 ns | 1.5455 ns | 1.4456 ns | 78.142 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 100 | 66.653 ns | 0.9742 ns | 0.9113 ns | 66.687 ns | 0.85 | 0.02 | 0.0650 | - | - | 136 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 128 | 99.120 ns | 1.1909 ns | 0.9944 ns | 99.276 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 128 | 65.425 ns | 0.6866 ns | 0.6087 ns | 65.417 ns | 0.66 | 0.01 | 0.0650 | - | - | 136 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 256 | 157.757 ns | 2.7300 ns | 2.4201 ns | 157.605 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 256 | 74.849 ns | 0.2300 ns | 0.1920 ns | 74.830 ns | 0.47 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 512 | 287.147 ns | 5.5596 ns | 5.4603 ns | 286.818 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 512 | 102.657 ns | 0.7090 ns | 0.6632 ns | 102.494 ns | 0.36 | 0.01 | 0.0650 | - | - | 136 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 1024 | 544.297 ns | 10.7342 ns | 12.3616 ns | 541.139 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 1024 | 126.693 ns | 0.7221 ns | 0.6401 ns | 126.689 ns | 0.23 | 0.00 | 0.0648 | - | - | 136 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 2048 | 1,060.795 ns | 18.7660 ns | 15.6705 ns | 1,062.407 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 2048 | 241.718 ns | 1.6162 ns | 1.3496 ns | 241.483 ns | 0.23 | 0.00 | 0.0648 | - | - | 136 B | 0.008 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 4096 | 2,175.340 ns | 42.9639 ns | 40.1885 ns | 2,176.568 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 4096 | 606.627 ns | 0.7069 ns | 0.6266 ns | 606.803 ns | 0.28 | 0.00 | 0.0648 | - | - | 136 B | 0.004 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 8192 | 4,017.371 ns | 57.7421 ns | 54.0120 ns | 3,991.319 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 8192 | 1,139.919 ns | 2.6974 ns | 2.3912 ns | 1,139.340 ns | 0.28 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 16384 | 63,974.696 ns | 1,266.8082 ns | 2,379.3728 ns | 63,946.506 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 16384 | 2,214.292 ns | 5.7931 ns | 5.1354 ns | 2,212.453 ns | 0.03 | 0.00 | 0.0648 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 32768 | 126,119.643 ns | 2,489.7550 ns | 5,568.6938 ns | 126,839.966 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 32768 | 4,747.791 ns | 18.1336 ns | 16.0750 ns | 4,752.184 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 65536 | 125,046.032 ns | 1,903.5659 ns | 1,780.5967 ns | 124,956.787 ns | 1.00 | 0.00 | 121.8262 | 120.8496 | 120.8496 | 525089 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 65536 | 10,783.095 ns | 53.1563 ns | 49.7224 ns | 10,763.589 ns | 0.09 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 131072 | 454,041.977 ns | 35,108.3205 ns | 103,517.6751 ns | 394,892.920 ns | 1.00 | 0.00 | 165.0391 | 164.0625 | 164.0625 | 1048894 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 131072 | 22,479.243 ns | 28.8111 ns | 25.5403 ns | 22,477.042 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableList | 850000 | 2,506,399.051 ns | 16,140.5016 ns | 14,308.1343 ns | 2,510,799.805 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableList | 850000 | 1,458,663.991 ns | 20,268.5738 ns | 18,959.2365 ns | 1,463,663.770 ns | 0.58 | 0.01 | - | - | - | 161 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 0 | 11.427 ns | 0.1625 ns | 0.1520 ns | 11.341 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 0 | 21.876 ns | 0.3315 ns | 0.3101 ns | 21.825 ns | 1.91 | 0.04 | 0.0421 | - | - | 88 B | 2.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 1 | 30.961 ns | 0.2584 ns | 0.2291 ns | 30.885 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 1 | 96.964 ns | 1.6963 ns | 1.5867 ns | 97.019 ns | 3.13 | 0.06 | 0.0880 | - | - | 184 B | 2.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 2 | 30.974 ns | 0.3002 ns | 0.2808 ns | 30.904 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 2 | 98.452 ns | 0.8725 ns | 0.7735 ns | 98.493 ns | 3.18 | 0.04 | 0.0956 | - | - | 200 B | 2.27 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 3 | 30.894 ns | 0.2017 ns | 0.1788 ns | 30.814 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 3 | 101.677 ns | 1.3753 ns | 1.2192 ns | 101.755 ns | 3.29 | 0.04 | 0.1070 | - | - | 224 B | 2.55 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 4 | 30.737 ns | 0.3144 ns | 0.2787 ns | 30.655 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 4 | 98.949 ns | 0.9144 ns | 0.8106 ns | 98.782 ns | 3.22 | 0.03 | 0.1109 | - | - | 232 B | 2.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 5 | 31.461 ns | 0.3613 ns | 0.3380 ns | 31.286 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 5 | 104.993 ns | 1.6420 ns | 1.5359 ns | 105.024 ns | 3.34 | 0.06 | 0.1301 | - | - | 272 B | 2.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 6 | 31.591 ns | 0.1534 ns | 0.1360 ns | 31.523 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 6 | 103.441 ns | 1.8832 ns | 1.6694 ns | 103.637 ns | 3.27 | 0.06 | 0.1339 | - | - | 280 B | 2.69 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 7 | 31.676 ns | 0.1623 ns | 0.1438 ns | 31.614 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 7 | 101.432 ns | 1.7286 ns | 1.5324 ns | 101.809 ns | 3.20 | 0.04 | 0.1377 | - | - | 288 B | 2.57 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 8 | 31.728 ns | 0.0741 ns | 0.0619 ns | 31.723 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 8 | 100.853 ns | 1.5857 ns | 1.4832 ns | 101.192 ns | 3.17 | 0.05 | 0.1415 | - | - | 296 B | 2.47 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 9 | 32.739 ns | 0.1926 ns | 0.1608 ns | 32.682 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 9 | 109.329 ns | 0.9654 ns | 0.9030 ns | 109.145 ns | 3.34 | 0.03 | 0.1760 | - | - | 368 B | 2.88 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 10 | 33.114 ns | 0.0566 ns | 0.0473 ns | 33.117 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 10 | 107.779 ns | 1.1626 ns | 1.0875 ns | 107.968 ns | 3.26 | 0.04 | 0.1798 | - | - | 376 B | 2.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 11 | 34.027 ns | 0.1806 ns | 0.1601 ns | 33.962 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 11 | 112.670 ns | 1.6568 ns | 1.5497 ns | 112.423 ns | 3.31 | 0.05 | 0.1836 | - | - | 384 B | 2.67 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 12 | 34.148 ns | 0.0747 ns | 0.0662 ns | 34.133 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 12 | 112.535 ns | 1.3192 ns | 1.2340 ns | 112.265 ns | 3.29 | 0.03 | 0.1874 | - | - | 392 B | 2.58 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 13 | 34.603 ns | 0.0550 ns | 0.0459 ns | 34.588 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 13 | 113.749 ns | 0.6956 ns | 0.6506 ns | 113.741 ns | 3.29 | 0.02 | 0.1912 | - | - | 400 B | 2.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 14 | 34.777 ns | 0.0593 ns | 0.0495 ns | 34.791 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 14 | 111.589 ns | 1.1807 ns | 0.9859 ns | 111.716 ns | 3.21 | 0.03 | 0.1950 | - | - | 408 B | 2.43 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 15 | 34.990 ns | 0.1500 ns | 0.1329 ns | 34.952 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 15 | 110.815 ns | 0.7695 ns | 0.6821 ns | 110.906 ns | 3.17 | 0.02 | 0.1988 | - | - | 416 B | 2.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 16 | 35.001 ns | 0.1396 ns | 0.1237 ns | 35.032 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 16 | 106.799 ns | 1.4223 ns | 1.2608 ns | 107.128 ns | 3.05 | 0.03 | 0.2027 | - | - | 424 B | 2.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 17 | 35.472 ns | 0.2175 ns | 0.1928 ns | 35.407 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 17 | 113.563 ns | 0.5820 ns | 0.5444 ns | 113.264 ns | 3.20 | 0.02 | 0.2677 | - | - | 560 B | 2.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 18 | 35.767 ns | 0.2285 ns | 0.2138 ns | 35.699 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 18 | 113.764 ns | 0.8705 ns | 0.6796 ns | 113.648 ns | 3.18 | 0.03 | 0.2716 | - | - | 568 B | 2.84 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 19 | 36.833 ns | 0.2695 ns | 0.2521 ns | 36.687 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 19 | 118.829 ns | 1.3396 ns | 1.2531 ns | 118.823 ns | 3.23 | 0.04 | 0.2754 | - | - | 576 B | 2.77 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 20 | 36.942 ns | 0.2047 ns | 0.1815 ns | 36.858 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 20 | 118.490 ns | 2.1452 ns | 2.0066 ns | 118.753 ns | 3.21 | 0.06 | 0.2792 | - | - | 584 B | 2.70 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 30 | 40.281 ns | 0.1968 ns | 0.1643 ns | 40.215 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 30 | 121.877 ns | 1.3765 ns | 1.2876 ns | 121.663 ns | 3.02 | 0.04 | 0.3173 | - | - | 664 B | 2.24 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 32 | 41.229 ns | 0.2518 ns | 0.2103 ns | 41.236 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 32 | 120.601 ns | 2.1520 ns | 2.0130 ns | 120.556 ns | 2.93 | 0.05 | 0.3250 | - | - | 680 B | 2.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 36 | 49.076 ns | 0.7010 ns | 0.6557 ns | 48.805 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 36 | 137.030 ns | 2.0529 ns | 1.9203 ns | 136.662 ns | 2.79 | 0.05 | 0.2217 | - | - | 464 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 37 | 49.921 ns | 0.4713 ns | 0.4409 ns | 49.888 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 37 | 137.923 ns | 1.5966 ns | 1.4153 ns | 137.730 ns | 2.76 | 0.04 | 0.0880 | - | - | 184 B | 0.52 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 50.882 ns | 0.5683 ns | 0.5316 ns | 50.818 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 50.127 ns | 0.3722 ns | 0.3300 ns | 50.155 ns | 0.98 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 136.375 ns | 1.9591 ns | 1.8325 ns | 136.078 ns | 2.68 | 0.05 | 0.0880 | - | - | 184 B | 0.49 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 137.301 ns | 1.8969 ns | 1.6815 ns | 137.890 ns | 2.70 | 0.06 | 0.0880 | - | - | 184 B | 0.49 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 50 | 55.534 ns | 0.5898 ns | 0.5229 ns | 55.535 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 50 | 148.491 ns | 1.1530 ns | 1.0221 ns | 148.421 ns | 2.67 | 0.03 | 0.0880 | - | - | 184 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 60 | 59.640 ns | 1.2013 ns | 1.3834 ns | 58.841 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 60 | 140.369 ns | 0.9340 ns | 0.8737 ns | 140.442 ns | 2.34 | 0.06 | 0.0880 | - | - | 184 B | 0.34 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 70 | 64.660 ns | 0.9782 ns | 0.8672 ns | 64.609 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 70 | 150.759 ns | 1.6271 ns | 1.4424 ns | 150.359 ns | 2.33 | 0.04 | 0.0880 | - | - | 184 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 80 | 70.355 ns | 0.9071 ns | 0.8041 ns | 70.180 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 80 | 147.871 ns | 1.4497 ns | 1.2851 ns | 147.876 ns | 2.10 | 0.03 | 0.0880 | - | - | 184 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 850000 | 3,384,784.004 ns | 72,885.3393 ns | 212,609.9557 ns | 3,406,206.836 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800219 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 850000 | 2,899,466.155 ns | 10,038.6035 ns | 8,898.9605 ns | 2,900,662.695 ns | 0.93 | 0.08 | - | - | - | 514 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 90 | 74.707 ns | 1.2513 ns | 1.1705 ns | 74.637 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 90 | 148.435 ns | 1.2341 ns | 1.0940 ns | 148.388 ns | 1.99 | 0.03 | 0.0880 | - | - | 184 B | 0.24 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 100 | 81.646 ns | 1.2866 ns | 1.2035 ns | 81.741 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 100 | 151.587 ns | 1.5725 ns | 1.3940 ns | 151.394 ns | 1.86 | 0.03 | 0.0880 | - | - | 184 B | 0.21 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 128 | 93.299 ns | 1.3477 ns | 1.1254 ns | 93.623 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 128 | 163.134 ns | 0.9073 ns | 0.8487 ns | 163.007 ns | 1.75 | 0.02 | 0.0880 | - | - | 184 B | 0.17 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 256 | 157.157 ns | 2.3804 ns | 2.2267 ns | 156.437 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 256 | 175.526 ns | 1.1563 ns | 1.0816 ns | 175.576 ns | 1.12 | 0.02 | 0.0880 | - | - | 184 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 512 | 283.826 ns | 4.8978 ns | 4.5814 ns | 283.468 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 512 | 203.324 ns | 1.8002 ns | 1.6839 ns | 203.104 ns | 0.72 | 0.01 | 0.0880 | - | - | 184 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 1024 | 534.657 ns | 10.7360 ns | 13.1847 ns | 532.521 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 1024 | 292.517 ns | 1.8817 ns | 1.7602 ns | 292.501 ns | 0.55 | 0.01 | 0.0877 | - | - | 184 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 2048 | 1,077.110 ns | 20.5871 ns | 39.1690 ns | 1,067.488 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 2048 | 637.152 ns | 4.2153 ns | 3.9430 ns | 638.531 ns | 0.58 | 0.03 | 0.0877 | - | - | 184 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 4096 | 2,098.656 ns | 41.6158 ns | 54.1123 ns | 2,101.329 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 4096 | 1,190.662 ns | 2.3803 ns | 2.2265 ns | 1,190.206 ns | 0.57 | 0.02 | 0.0877 | - | - | 184 B | 0.006 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 8192 | 3,922.221 ns | 29.2421 ns | 27.3530 ns | 3,918.271 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 8192 | 2,273.528 ns | 3.0178 ns | 2.3561 ns | 2,273.366 ns | 0.58 | 0.00 | 0.0877 | - | - | 184 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 16384 | 64,771.845 ns | 1,295.0230 ns | 3,715.6637 ns | 64,796.143 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 16384 | 4,708.604 ns | 6.5462 ns | 6.1233 ns | 4,708.671 ns | 0.07 | 0.00 | 0.2213 | - | - | 464 B | 0.004 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 32768 | 126,789.227 ns | 2,532.3679 ns | 5,919.3283 ns | 128,485.181 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 32768 | 10,899.942 ns | 68.4004 ns | 63.9817 ns | 10,907.268 ns | 0.09 | 0.00 | 0.2136 | - | - | 464 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 65536 | 125,077.772 ns | 2,406.0231 ns | 3,211.9718 ns | 125,489.795 ns | 1.00 | 0.00 | 119.6289 | 118.6523 | 118.6523 | 525043 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 65536 | 22,357.269 ns | 136.9451 ns | 121.3983 ns | 22,328.387 ns | 0.18 | 0.01 | 0.2136 | - | - | 464 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 131072 | 312,634.663 ns | 6,159.5050 ns | 9,219.2571 ns | 311,814.404 ns | 1.00 | 0.00 | 194.8242 | 193.3594 | 193.3594 | 1049261 B | 1.000 | -| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 131072 | 45,652.759 ns | 488.1634 ns | 432.7441 ns | 45,733.435 ns | 0.15 | 0.01 | 0.1831 | - | - | 464 B | 0.000 | -
- -# `AddRange` when Source is List Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.306 - [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 -``` -
-Add Entire Collection Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | AddRa(...)sList [24] | List | Array | 0 | 10.900 ns | 0.1637 ns | 0.1451 ns | 10.869 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 0 | 10.968 ns | 0.0896 ns | 0.0838 ns | 10.963 ns | 1.01 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 1 | 24.776 ns | 0.3375 ns | 0.3157 ns | 24.744 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 1 | 10.720 ns | 0.1142 ns | 0.1068 ns | 10.690 ns | 0.43 | 0.01 | 0.0153 | - | - | 32 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 2 | 24.820 ns | 0.2216 ns | 0.2073 ns | 24.850 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 2 | 11.004 ns | 0.1534 ns | 0.1435 ns | 10.927 ns | 0.44 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 3 | 24.797 ns | 0.2301 ns | 0.2153 ns | 24.798 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 3 | 11.281 ns | 0.0378 ns | 0.0295 ns | 11.265 ns | 0.45 | 0.00 | 0.0229 | - | - | 48 B | 0.55 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 4 | 24.881 ns | 0.4802 ns | 0.4492 ns | 24.665 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 4 | 11.620 ns | 0.1667 ns | 0.1477 ns | 11.540 ns | 0.47 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 5 | 24.991 ns | 0.2176 ns | 0.1929 ns | 24.877 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 5 | 12.074 ns | 0.0889 ns | 0.0832 ns | 12.042 ns | 0.48 | 0.00 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 6 | 25.414 ns | 0.2014 ns | 0.1883 ns | 25.424 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 6 | 12.309 ns | 0.1137 ns | 0.1064 ns | 12.321 ns | 0.48 | 0.01 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 7 | 25.685 ns | 0.1566 ns | 0.1464 ns | 25.675 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 7 | 12.817 ns | 0.1075 ns | 0.1005 ns | 12.758 ns | 0.50 | 0.00 | 0.0383 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 8 | 26.081 ns | 0.1935 ns | 0.1715 ns | 26.036 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 8 | 13.311 ns | 0.1073 ns | 0.0951 ns | 13.279 ns | 0.51 | 0.01 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 9 | 26.749 ns | 0.1829 ns | 0.1711 ns | 26.697 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 9 | 13.823 ns | 0.2158 ns | 0.2018 ns | 13.693 ns | 0.52 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 10 | 27.004 ns | 0.2930 ns | 0.2598 ns | 26.927 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 10 | 13.900 ns | 0.0288 ns | 0.0240 ns | 13.894 ns | 0.51 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 11 | 28.021 ns | 0.2473 ns | 0.2065 ns | 28.072 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 11 | 14.630 ns | 0.2856 ns | 0.2532 ns | 14.500 ns | 0.52 | 0.01 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 12 | 29.109 ns | 0.5562 ns | 0.4930 ns | 28.914 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 12 | 14.959 ns | 0.1591 ns | 0.1488 ns | 14.876 ns | 0.51 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 13 | 28.415 ns | 0.1495 ns | 0.1167 ns | 28.413 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 13 | 15.367 ns | 0.1841 ns | 0.1722 ns | 15.325 ns | 0.54 | 0.01 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 14 | 28.838 ns | 0.2783 ns | 0.2467 ns | 28.762 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 14 | 15.743 ns | 0.1311 ns | 0.1227 ns | 15.689 ns | 0.55 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 15 | 29.148 ns | 0.3040 ns | 0.2843 ns | 29.188 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 15 | 15.762 ns | 0.0467 ns | 0.0390 ns | 15.751 ns | 0.54 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 16 | 29.303 ns | 0.2234 ns | 0.1980 ns | 29.215 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 16 | 15.998 ns | 0.0984 ns | 0.0873 ns | 15.974 ns | 0.55 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 17 | 29.777 ns | 0.2377 ns | 0.2107 ns | 29.697 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 17 | 16.300 ns | 0.0523 ns | 0.0408 ns | 16.297 ns | 0.55 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 18 | 29.881 ns | 0.0712 ns | 0.0556 ns | 29.870 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 18 | 16.796 ns | 0.1546 ns | 0.1446 ns | 16.774 ns | 0.56 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 19 | 31.346 ns | 0.5159 ns | 0.4826 ns | 31.106 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 19 | 17.671 ns | 0.3829 ns | 0.6604 ns | 17.375 ns | 0.56 | 0.03 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 20 | 31.779 ns | 0.1795 ns | 0.1591 ns | 31.738 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 20 | 17.441 ns | 0.0667 ns | 0.0557 ns | 17.426 ns | 0.55 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 30 | 35.182 ns | 0.1529 ns | 0.1355 ns | 35.230 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 30 | 20.737 ns | 0.1967 ns | 0.1840 ns | 20.694 ns | 0.59 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 32 | 35.490 ns | 0.1190 ns | 0.0994 ns | 35.477 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 32 | 21.302 ns | 0.0753 ns | 0.0629 ns | 21.285 ns | 0.60 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 36 | 37.510 ns | 0.5145 ns | 0.4296 ns | 37.403 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 36 | 22.597 ns | 0.1680 ns | 0.1572 ns | 22.542 ns | 0.60 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 37 | 37.301 ns | 0.3142 ns | 0.2785 ns | 37.218 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 37 | 22.791 ns | 0.1320 ns | 0.1170 ns | 22.759 ns | 0.61 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 40 | 38.410 ns | 0.4096 ns | 0.3831 ns | 38.444 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)sList [24] | List | Array | 40 | 38.112 ns | 0.1304 ns | 0.1089 ns | 38.106 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 40 | 24.124 ns | 0.0481 ns | 0.0427 ns | 24.116 ns | 0.63 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | -| Actual | AddRa(...)sList [24] | List | Array | 40 | 23.867 ns | 0.1469 ns | 0.1374 ns | 23.799 ns | 0.62 | 0.01 | 0.1645 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 50 | 41.406 ns | 0.2024 ns | 0.1691 ns | 41.338 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 50 | 27.083 ns | 0.1757 ns | 0.1557 ns | 26.991 ns | 0.65 | 0.00 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 60 | 45.711 ns | 0.3373 ns | 0.3155 ns | 45.805 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 60 | 30.578 ns | 0.3389 ns | 0.3170 ns | 30.387 ns | 0.67 | 0.01 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 70 | 49.032 ns | 0.3409 ns | 0.3189 ns | 49.123 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 70 | 34.046 ns | 0.3775 ns | 0.3347 ns | 33.904 ns | 0.69 | 0.01 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 80 | 52.295 ns | 0.1185 ns | 0.0925 ns | 52.295 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 80 | 36.979 ns | 0.0517 ns | 0.0403 ns | 36.977 ns | 0.71 | 0.00 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 90 | 54.656 ns | 0.0976 ns | 0.0865 ns | 54.669 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 90 | 39.972 ns | 0.1052 ns | 0.0932 ns | 39.962 ns | 0.73 | 0.00 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 100 | 57.661 ns | 0.1003 ns | 0.0838 ns | 57.690 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 100 | 44.216 ns | 0.1678 ns | 0.1487 ns | 44.239 ns | 0.77 | 0.00 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 128 | 65.674 ns | 0.1278 ns | 0.1067 ns | 65.636 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 128 | 52.699 ns | 0.3878 ns | 0.3239 ns | 52.592 ns | 0.80 | 0.00 | 0.5010 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 256 | 112.863 ns | 0.2599 ns | 0.2171 ns | 112.845 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 256 | 100.391 ns | 0.4527 ns | 0.3780 ns | 100.431 ns | 0.89 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 512 | 200.238 ns | 0.4835 ns | 0.3775 ns | 200.203 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 512 | 179.056 ns | 0.3721 ns | 0.3107 ns | 178.973 ns | 0.89 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 1024 | 393.686 ns | 2.2637 ns | 2.0067 ns | 393.175 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 1024 | 353.785 ns | 0.9575 ns | 0.8488 ns | 353.542 ns | 0.90 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 2048 | 767.932 ns | 4.2333 ns | 3.3051 ns | 768.692 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 2048 | 675.048 ns | 2.3414 ns | 1.9552 ns | 675.147 ns | 0.88 | 0.00 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 4096 | 1,509.292 ns | 4.3506 ns | 3.6330 ns | 1,508.327 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 4096 | 1,436.992 ns | 6.1629 ns | 5.7648 ns | 1,437.866 ns | 0.95 | 0.00 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 8192 | 2,852.302 ns | 11.1977 ns | 9.9265 ns | 2,855.262 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 8192 | 2,744.862 ns | 19.3780 ns | 17.1781 ns | 2,742.430 ns | 0.96 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 16384 | 62,943.792 ns | 1,261.0148 ns | 3,718.1305 ns | 64,097.217 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 16384 | 60,746.212 ns | 1,213.4860 ns | 1,853.1213 ns | 60,909.015 ns | 0.97 | 0.07 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 32768 | 121,765.578 ns | 2,426.5001 ns | 6,087.6142 ns | 124,802.698 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 32768 | 120,947.167 ns | 2,410.9372 ns | 5,587.7135 ns | 122,273.132 ns | 1.00 | 0.07 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 65536 | 117,170.234 ns | 1,331.3979 ns | 1,245.3905 ns | 116,773.206 ns | 1.00 | 0.00 | 126.9531 | 125.8545 | 125.8545 | 524865 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 65536 | 116,519.789 ns | 1,538.4105 ns | 1,439.0301 ns | 116,742.932 ns | 0.99 | 0.01 | 119.0186 | 118.6523 | 118.6523 | 524347 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 131072 | 305,755.076 ns | 6,110.5995 ns | 12,619.4475 ns | 303,551.733 ns | 1.00 | 0.00 | 188.4766 | 187.0117 | 187.0117 | 1048970 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 131072 | 323,919.398 ns | 5,454.6289 ns | 11,624.2589 ns | 324,083.887 ns | 1.06 | 0.05 | 160.1563 | 159.6680 | 159.6680 | 1048648 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | Array | 850000 | 2,254,409.126 ns | 43,936.1907 ns | 53,957.5879 ns | 2,268,590.820 ns | 1.00 | 0.00 | 156.2500 | 156.2500 | 156.2500 | 6800109 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | Array | 850000 | 2,248,246.094 ns | 43,864.1089 ns | 64,295.4421 ns | 2,267,407.812 ns | 1.00 | 0.02 | 156.2500 | 156.2500 | 156.2500 | 6800077 B | 1.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 0 | 9.882 ns | 0.2216 ns | 0.2722 ns | 9.669 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 0 | 15.415 ns | 0.0826 ns | 0.0732 ns | 15.400 ns | 1.56 | 0.04 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 1 | 24.904 ns | 0.1663 ns | 0.1389 ns | 24.947 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 1 | 49.775 ns | 0.5137 ns | 0.4805 ns | 49.819 ns | 2.00 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 2 | 24.986 ns | 0.1927 ns | 0.1803 ns | 25.043 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 2 | 49.758 ns | 0.5326 ns | 0.4982 ns | 49.702 ns | 1.99 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 3 | 25.974 ns | 0.4238 ns | 0.3964 ns | 25.976 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 3 | 49.726 ns | 0.7875 ns | 0.7367 ns | 49.452 ns | 1.91 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 4 | 26.040 ns | 0.4701 ns | 0.4397 ns | 26.027 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 4 | 49.568 ns | 0.4047 ns | 0.3588 ns | 49.463 ns | 1.90 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 5 | 26.009 ns | 0.3495 ns | 0.3269 ns | 26.071 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 5 | 49.387 ns | 0.1730 ns | 0.1350 ns | 49.444 ns | 1.90 | 0.03 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 6 | 26.302 ns | 0.1916 ns | 0.1600 ns | 26.245 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 6 | 49.553 ns | 0.3185 ns | 0.2486 ns | 49.574 ns | 1.88 | 0.02 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 7 | 26.604 ns | 0.3101 ns | 0.2900 ns | 26.440 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 7 | 49.933 ns | 0.6100 ns | 0.5706 ns | 49.914 ns | 1.88 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 8 | 26.972 ns | 0.3871 ns | 0.3621 ns | 26.771 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 8 | 49.375 ns | 0.3325 ns | 0.3110 ns | 49.308 ns | 1.83 | 0.03 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 9 | 27.105 ns | 0.2439 ns | 0.2281 ns | 27.109 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 9 | 51.028 ns | 0.5495 ns | 0.5140 ns | 51.189 ns | 1.88 | 0.02 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 10 | 27.409 ns | 0.1752 ns | 0.1553 ns | 27.356 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 10 | 51.531 ns | 0.6790 ns | 0.6351 ns | 51.517 ns | 1.88 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 11 | 28.877 ns | 0.1809 ns | 0.1510 ns | 28.869 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 11 | 53.229 ns | 0.7354 ns | 0.6879 ns | 53.371 ns | 1.84 | 0.02 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 12 | 29.260 ns | 0.2924 ns | 0.2735 ns | 29.131 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 12 | 52.826 ns | 0.6964 ns | 0.6514 ns | 52.816 ns | 1.81 | 0.03 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 13 | 30.198 ns | 0.5388 ns | 0.7006 ns | 29.950 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 13 | 53.378 ns | 0.7139 ns | 0.6678 ns | 53.446 ns | 1.76 | 0.05 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 14 | 29.995 ns | 0.2793 ns | 0.2613 ns | 29.953 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 14 | 53.161 ns | 0.7360 ns | 0.6884 ns | 53.282 ns | 1.77 | 0.02 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 15 | 29.932 ns | 0.2170 ns | 0.1923 ns | 29.891 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 15 | 52.625 ns | 0.7510 ns | 0.7025 ns | 52.757 ns | 1.76 | 0.02 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 16 | 30.217 ns | 0.3593 ns | 0.3361 ns | 30.222 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 16 | 52.435 ns | 0.7897 ns | 0.7387 ns | 52.188 ns | 1.74 | 0.03 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 17 | 30.155 ns | 0.1668 ns | 0.1393 ns | 30.110 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 17 | 52.103 ns | 0.6692 ns | 0.6260 ns | 52.167 ns | 1.73 | 0.02 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 18 | 30.335 ns | 0.1589 ns | 0.1241 ns | 30.338 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 18 | 52.253 ns | 0.7654 ns | 0.7160 ns | 52.383 ns | 1.72 | 0.03 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 19 | 31.694 ns | 0.2620 ns | 0.2323 ns | 31.574 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 19 | 54.396 ns | 0.5447 ns | 0.4548 ns | 54.523 ns | 1.72 | 0.03 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 20 | 32.504 ns | 0.4363 ns | 0.3868 ns | 32.463 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 20 | 54.544 ns | 0.4790 ns | 0.4247 ns | 54.525 ns | 1.68 | 0.02 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 30 | 35.813 ns | 0.2891 ns | 0.2705 ns | 35.825 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 30 | 57.690 ns | 0.1816 ns | 0.1610 ns | 57.659 ns | 1.61 | 0.01 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 32 | 36.182 ns | 0.2115 ns | 0.1875 ns | 36.236 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 32 | 57.378 ns | 0.1385 ns | 0.1081 ns | 57.400 ns | 1.59 | 0.01 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 36 | 37.711 ns | 0.1443 ns | 0.1279 ns | 37.670 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 36 | 56.907 ns | 0.1475 ns | 0.1307 ns | 56.885 ns | 1.51 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 37 | 38.422 ns | 0.3862 ns | 0.3612 ns | 38.429 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 37 | 57.246 ns | 0.2016 ns | 0.1787 ns | 57.238 ns | 1.49 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 40 | 39.027 ns | 0.2808 ns | 0.2627 ns | 38.901 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)sList [24] | List | PooledList | 40 | 38.971 ns | 0.1072 ns | 0.0950 ns | 38.951 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 40 | 56.754 ns | 0.4191 ns | 0.3921 ns | 56.523 ns | 1.45 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | AddRa(...)sList [24] | List | PooledList | 40 | 57.018 ns | 0.4412 ns | 0.3684 ns | 57.026 ns | 1.46 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 50 | 42.738 ns | 0.4053 ns | 0.3593 ns | 42.534 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 50 | 57.256 ns | 0.1728 ns | 0.1349 ns | 57.227 ns | 1.34 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 60 | 46.517 ns | 0.1567 ns | 0.1389 ns | 46.491 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 60 | 57.670 ns | 0.1562 ns | 0.1219 ns | 57.704 ns | 1.24 | 0.00 | 0.0267 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 70 | 50.052 ns | 0.1401 ns | 0.1311 ns | 50.089 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 70 | 58.601 ns | 0.1619 ns | 0.1435 ns | 58.593 ns | 1.17 | 0.00 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 80 | 53.331 ns | 0.1023 ns | 0.0907 ns | 53.360 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 80 | 59.579 ns | 0.1748 ns | 0.1549 ns | 59.610 ns | 1.12 | 0.00 | 0.0267 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 850000 | 2,694,908.501 ns | 53,517.4515 ns | 92,314.9743 ns | 2,692,474.414 ns | 1.00 | 0.00 | 101.5625 | 101.5625 | 101.5625 | 6800091 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 850000 | 989,039.557 ns | 9,391.0372 ns | 8,784.3820 ns | 990,766.406 ns | 0.36 | 0.01 | - | - | - | 57 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 90 | 57.568 ns | 0.4039 ns | 0.3778 ns | 57.402 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 90 | 61.004 ns | 0.6292 ns | 0.5886 ns | 60.635 ns | 1.06 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 100 | 60.499 ns | 0.2552 ns | 0.2131 ns | 60.479 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 100 | 60.777 ns | 0.2064 ns | 0.1611 ns | 60.733 ns | 1.01 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 128 | 68.757 ns | 0.2856 ns | 0.2671 ns | 68.720 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 128 | 62.404 ns | 0.3370 ns | 0.3152 ns | 62.392 ns | 0.91 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 256 | 107.412 ns | 0.7486 ns | 0.7003 ns | 107.122 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 256 | 71.265 ns | 0.5534 ns | 0.5176 ns | 71.020 ns | 0.66 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 512 | 201.111 ns | 0.8833 ns | 0.8263 ns | 200.921 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | PooledList | 512 | 88.281 ns | 0.7845 ns | 0.7338 ns | 87.999 ns | 0.44 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 1024 | 394.540 ns | 2.3701 ns | 2.1010 ns | 393.890 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 1024 | 119.730 ns | 1.0994 ns | 1.0284 ns | 119.703 ns | 0.30 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 2048 | 773.346 ns | 5.3219 ns | 4.9781 ns | 771.826 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 2048 | 281.812 ns | 1.7688 ns | 1.6546 ns | 281.259 ns | 0.36 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 4096 | 1,516.986 ns | 9.1806 ns | 8.5875 ns | 1,518.081 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 4096 | 575.893 ns | 1.2566 ns | 1.0493 ns | 576.079 ns | 0.38 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 8192 | 2,869.766 ns | 31.1670 ns | 26.0259 ns | 2,869.614 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 8192 | 1,153.794 ns | 8.3242 ns | 7.7865 ns | 1,152.730 ns | 0.40 | 0.01 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 16384 | 62,714.785 ns | 1,244.3376 ns | 2,678.5679 ns | 62,789.398 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 16384 | 2,325.273 ns | 2.5835 ns | 2.2902 ns | 2,325.078 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 32768 | 125,288.926 ns | 2,569.4672 ns | 7,576.1320 ns | 127,289.258 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 32768 | 5,174.197 ns | 6.0723 ns | 5.6801 ns | 5,171.732 ns | 0.04 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 65536 | 117,926.163 ns | 1,727.3894 ns | 1,615.8011 ns | 118,293.427 ns | 1.00 | 0.00 | 124.0234 | 122.9248 | 122.9248 | 524941 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 65536 | 11,283.153 ns | 17.7420 ns | 15.7278 ns | 11,277.905 ns | 0.10 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | PooledList | 131072 | 339,625.593 ns | 6,762.8489 ns | 15,538.7701 ns | 340,312.451 ns | 1.00 | 0.00 | 166.9922 | 166.0156 | 166.0156 | 1048884 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | PooledList | 131072 | 22,532.876 ns | 39.9415 ns | 35.4071 ns | 22,523.160 ns | 0.07 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 0 | 10.662 ns | 0.0263 ns | 0.0246 ns | 10.664 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 0 | 20.762 ns | 0.1174 ns | 0.1098 ns | 20.768 ns | 1.95 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 1 | 23.328 ns | 0.0868 ns | 0.0770 ns | 23.342 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 1 | 19.978 ns | 0.1036 ns | 0.0918 ns | 19.985 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 2 | 23.409 ns | 0.1539 ns | 0.1439 ns | 23.377 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 2 | 20.272 ns | 0.0753 ns | 0.0705 ns | 20.274 ns | 0.87 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 3 | 23.395 ns | 0.1410 ns | 0.1250 ns | 23.407 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 3 | 19.902 ns | 0.1046 ns | 0.0874 ns | 19.922 ns | 0.85 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 4 | 23.332 ns | 0.1401 ns | 0.1242 ns | 23.297 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 4 | 19.948 ns | 0.1243 ns | 0.1038 ns | 19.963 ns | 0.85 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 5 | 23.723 ns | 0.0354 ns | 0.0295 ns | 23.721 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 5 | 31.442 ns | 0.2135 ns | 0.1893 ns | 31.472 ns | 1.33 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 6 | 24.001 ns | 0.0709 ns | 0.0554 ns | 23.993 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 6 | 31.596 ns | 0.1852 ns | 0.1732 ns | 31.654 ns | 1.32 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 7 | 24.354 ns | 0.0654 ns | 0.0511 ns | 24.353 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 7 | 31.787 ns | 0.3793 ns | 0.3548 ns | 31.605 ns | 1.31 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 8 | 24.631 ns | 0.2459 ns | 0.2300 ns | 24.744 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 8 | 31.417 ns | 0.2752 ns | 0.2440 ns | 31.305 ns | 1.28 | 0.02 | 0.0918 | - | - | 192 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 9 | 24.957 ns | 0.2966 ns | 0.2775 ns | 24.810 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 9 | 33.884 ns | 0.2777 ns | 0.2598 ns | 33.964 ns | 1.36 | 0.02 | 0.1224 | - | - | 256 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 10 | 25.360 ns | 0.3467 ns | 0.3243 ns | 25.210 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 10 | 34.029 ns | 0.3593 ns | 0.3185 ns | 33.897 ns | 1.34 | 0.02 | 0.1224 | - | - | 256 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 11 | 25.798 ns | 0.1976 ns | 0.1752 ns | 25.708 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 11 | 36.466 ns | 0.4225 ns | 0.3745 ns | 36.500 ns | 1.41 | 0.02 | 0.1224 | - | - | 256 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 12 | 26.220 ns | 0.2275 ns | 0.2128 ns | 26.247 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 12 | 36.995 ns | 0.4512 ns | 0.4000 ns | 37.087 ns | 1.41 | 0.01 | 0.1224 | - | - | 256 B | 1.68 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 13 | 27.919 ns | 0.0467 ns | 0.0364 ns | 27.932 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 13 | 36.792 ns | 0.3169 ns | 0.2964 ns | 36.742 ns | 1.32 | 0.01 | 0.1224 | - | - | 256 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 14 | 26.653 ns | 0.0511 ns | 0.0399 ns | 26.656 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 14 | 36.898 ns | 0.5461 ns | 0.5108 ns | 36.847 ns | 1.39 | 0.02 | 0.1224 | - | - | 256 B | 1.52 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 15 | 27.114 ns | 0.2327 ns | 0.2177 ns | 27.016 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 15 | 36.317 ns | 0.5650 ns | 0.5285 ns | 36.292 ns | 1.34 | 0.02 | 0.1224 | - | - | 256 B | 1.45 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 16 | 27.635 ns | 0.3074 ns | 0.2876 ns | 27.585 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 16 | 35.100 ns | 0.5421 ns | 0.5071 ns | 34.970 ns | 1.27 | 0.02 | 0.1224 | - | - | 256 B | 1.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 17 | 27.992 ns | 0.2252 ns | 0.2106 ns | 27.997 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 17 | 39.391 ns | 0.5958 ns | 0.5573 ns | 39.530 ns | 1.41 | 0.02 | 0.1836 | - | - | 384 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 18 | 28.214 ns | 0.1351 ns | 0.1198 ns | 28.203 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 18 | 39.549 ns | 0.4089 ns | 0.3625 ns | 39.612 ns | 1.40 | 0.01 | 0.1836 | - | - | 384 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 19 | 29.010 ns | 0.5537 ns | 0.5179 ns | 28.909 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 19 | 42.351 ns | 0.6433 ns | 0.6017 ns | 42.592 ns | 1.46 | 0.03 | 0.1836 | - | - | 384 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 20 | 28.822 ns | 0.2908 ns | 0.2578 ns | 28.737 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 20 | 42.102 ns | 0.4215 ns | 0.3520 ns | 42.238 ns | 1.46 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 30 | 32.216 ns | 0.2364 ns | 0.2211 ns | 32.250 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 30 | 42.758 ns | 0.4794 ns | 0.4485 ns | 42.796 ns | 1.33 | 0.01 | 0.1836 | - | - | 384 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 32 | 33.104 ns | 0.3896 ns | 0.3454 ns | 32.973 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 32 | 41.854 ns | 0.2911 ns | 0.2581 ns | 41.932 ns | 1.26 | 0.01 | 0.1836 | - | - | 384 B | 1.23 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 36 | 34.598 ns | 0.3746 ns | 0.3504 ns | 34.374 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 36 | 52.152 ns | 0.3769 ns | 0.3341 ns | 52.133 ns | 1.51 | 0.02 | 0.0650 | - | - | 136 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 37 | 42.993 ns | 0.3526 ns | 0.3126 ns | 42.984 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 37 | 48.802 ns | 0.4426 ns | 0.4140 ns | 48.916 ns | 1.14 | 0.01 | 0.0650 | - | - | 136 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 40 | 45.327 ns | 0.3848 ns | 0.3411 ns | 45.408 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 40 | 44.640 ns | 0.4487 ns | 0.4197 ns | 44.547 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 40 | 51.490 ns | 0.7919 ns | 0.7407 ns | 51.370 ns | 1.14 | 0.02 | 0.0650 | - | - | 136 B | 0.36 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 40 | 50.331 ns | 0.4084 ns | 0.3820 ns | 50.348 ns | 1.11 | 0.01 | 0.0650 | - | - | 136 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 50 | 49.686 ns | 0.5801 ns | 0.5426 ns | 49.835 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 50 | 48.861 ns | 0.3903 ns | 0.3651 ns | 48.903 ns | 0.98 | 0.01 | 0.0650 | - | - | 136 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 60 | 55.222 ns | 0.9793 ns | 0.9160 ns | 55.304 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 60 | 50.406 ns | 0.6221 ns | 0.5819 ns | 50.609 ns | 0.91 | 0.02 | 0.0650 | - | - | 136 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 70 | 59.639 ns | 0.5240 ns | 0.4902 ns | 59.674 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 70 | 51.276 ns | 0.3608 ns | 0.3374 ns | 51.342 ns | 0.86 | 0.01 | 0.0650 | - | - | 136 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 80 | 62.926 ns | 0.8099 ns | 0.7576 ns | 62.884 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 80 | 53.457 ns | 0.5823 ns | 0.5447 ns | 53.692 ns | 0.85 | 0.01 | 0.0650 | - | - | 136 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 90 | 68.657 ns | 0.7288 ns | 0.6817 ns | 68.650 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 90 | 51.996 ns | 0.7653 ns | 0.7159 ns | 51.656 ns | 0.76 | 0.01 | 0.0650 | - | - | 136 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 100 | 72.366 ns | 1.1535 ns | 1.0790 ns | 72.434 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 100 | 53.440 ns | 0.6623 ns | 0.5871 ns | 53.249 ns | 0.74 | 0.01 | 0.0650 | - | - | 136 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 128 | 86.276 ns | 1.3645 ns | 1.2763 ns | 85.931 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 128 | 54.843 ns | 0.5694 ns | 0.5326 ns | 54.729 ns | 0.64 | 0.01 | 0.0650 | - | - | 136 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 256 | 149.720 ns | 2.9365 ns | 2.7468 ns | 149.436 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 256 | 62.319 ns | 0.6457 ns | 0.5392 ns | 62.109 ns | 0.42 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 512 | 273.217 ns | 5.0212 ns | 4.6968 ns | 273.434 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 512 | 91.256 ns | 1.1094 ns | 1.0377 ns | 90.933 ns | 0.33 | 0.01 | 0.0650 | - | - | 136 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 1024 | 539.725 ns | 8.4545 ns | 7.9084 ns | 538.635 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 1024 | 121.492 ns | 0.4481 ns | 0.3742 ns | 121.587 ns | 0.23 | 0.00 | 0.0648 | - | - | 136 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 2048 | 1,071.889 ns | 20.4942 ns | 20.1280 ns | 1,067.685 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 2048 | 256.002 ns | 1.5244 ns | 1.4259 ns | 256.022 ns | 0.24 | 0.00 | 0.0648 | - | - | 136 B | 0.008 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 4096 | 2,145.019 ns | 41.4481 ns | 47.7316 ns | 2,147.316 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 4096 | 589.963 ns | 1.6652 ns | 1.3905 ns | 589.737 ns | 0.27 | 0.01 | 0.0648 | - | - | 136 B | 0.004 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 8192 | 4,068.138 ns | 68.0033 ns | 60.2832 ns | 4,061.301 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 8192 | 1,069.563 ns | 3.1950 ns | 3.9238 ns | 1,068.856 ns | 0.26 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 16384 | 64,981.147 ns | 1,295.0403 ns | 3,818.4557 ns | 65,517.908 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 16384 | 2,310.719 ns | 14.2907 ns | 13.3675 ns | 2,305.269 ns | 0.04 | 0.00 | 0.0648 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 32768 | 125,265.467 ns | 2,487.3575 ns | 5,764.8292 ns | 127,476.892 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 32768 | 5,077.521 ns | 9.3875 ns | 8.3217 ns | 5,076.466 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 65536 | 124,065.222 ns | 2,393.8944 ns | 2,939.9173 ns | 123,803.674 ns | 1.00 | 0.00 | 122.3145 | 121.3379 | 121.3379 | 524912 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 65536 | 11,772.198 ns | 47.7368 ns | 39.8624 ns | 11,757.787 ns | 0.09 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 131072 | 351,182.982 ns | 6,930.9717 ns | 15,502.1113 ns | 353,653.271 ns | 1.00 | 0.00 | 154.2969 | 153.3203 | 153.3203 | 1048960 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 131072 | 22,267.199 ns | 53.6820 ns | 44.8269 ns | 22,259.190 ns | 0.06 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableList | 850000 | 2,579,255.938 ns | 50,408.1680 ns | 67,293.4564 ns | 2,591,026.562 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableList | 850000 | 995,848.884 ns | 10,721.5975 ns | 9,504.4169 ns | 998,970.020 ns | 0.39 | 0.01 | - | - | - | 149 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 0 | 11.147 ns | 0.1650 ns | 0.1543 ns | 11.053 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 0 | 18.141 ns | 0.2743 ns | 0.2565 ns | 18.026 ns | 1.63 | 0.03 | 0.0421 | - | - | 88 B | 2.75 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 1 | 23.538 ns | 0.0832 ns | 0.0695 ns | 23.552 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 1 | 63.765 ns | 0.7577 ns | 0.7087 ns | 63.938 ns | 2.71 | 0.04 | 0.0726 | - | - | 152 B | 1.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 2 | 23.513 ns | 0.1026 ns | 0.0909 ns | 23.524 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 2 | 64.338 ns | 0.9316 ns | 0.8714 ns | 64.512 ns | 2.74 | 0.04 | 0.0764 | - | - | 160 B | 1.82 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 3 | 23.535 ns | 0.1275 ns | 0.1131 ns | 23.543 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 3 | 68.631 ns | 1.0177 ns | 0.9519 ns | 68.436 ns | 2.92 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 4 | 23.570 ns | 0.0905 ns | 0.0846 ns | 23.555 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 4 | 64.425 ns | 0.8796 ns | 0.8227 ns | 64.467 ns | 2.73 | 0.04 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 5 | 23.918 ns | 0.2214 ns | 0.2071 ns | 24.014 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 5 | 66.814 ns | 1.3700 ns | 1.3455 ns | 67.032 ns | 2.79 | 0.07 | 0.0994 | - | - | 208 B | 2.17 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 6 | 24.254 ns | 0.1073 ns | 0.0896 ns | 24.219 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 6 | 70.033 ns | 0.9243 ns | 0.8646 ns | 70.113 ns | 2.89 | 0.04 | 0.0994 | - | - | 208 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 7 | 24.519 ns | 0.1685 ns | 0.1407 ns | 24.461 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 7 | 67.891 ns | 0.6130 ns | 0.5734 ns | 67.922 ns | 2.77 | 0.03 | 0.0994 | - | - | 208 B | 1.86 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 8 | 24.830 ns | 0.2301 ns | 0.2153 ns | 24.690 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 8 | 64.382 ns | 0.4604 ns | 0.4081 ns | 64.452 ns | 2.60 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 9 | 25.104 ns | 0.1700 ns | 0.1590 ns | 25.056 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 9 | 70.498 ns | 1.4433 ns | 1.3500 ns | 70.601 ns | 2.81 | 0.05 | 0.1301 | - | - | 272 B | 2.12 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 10 | 25.497 ns | 0.2260 ns | 0.2003 ns | 25.424 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 10 | 71.201 ns | 0.9236 ns | 0.8639 ns | 71.099 ns | 2.79 | 0.04 | 0.1301 | - | - | 272 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 11 | 26.207 ns | 0.0863 ns | 0.0720 ns | 26.199 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 11 | 69.000 ns | 0.5877 ns | 0.4907 ns | 68.981 ns | 2.63 | 0.02 | 0.1301 | - | - | 272 B | 1.89 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 12 | 26.735 ns | 0.2304 ns | 0.2155 ns | 26.833 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 12 | 71.577 ns | 0.9710 ns | 0.9082 ns | 71.655 ns | 2.68 | 0.04 | 0.1301 | - | - | 272 B | 1.79 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 13 | 27.212 ns | 0.3904 ns | 0.3652 ns | 27.020 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 13 | 73.673 ns | 1.0537 ns | 0.9856 ns | 73.736 ns | 2.71 | 0.05 | 0.1301 | - | - | 272 B | 1.70 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 14 | 27.157 ns | 0.2949 ns | 0.2758 ns | 26.987 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 14 | 71.790 ns | 1.0183 ns | 0.9525 ns | 72.044 ns | 2.64 | 0.04 | 0.1301 | - | - | 272 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 15 | 27.482 ns | 0.1830 ns | 0.1528 ns | 27.459 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 15 | 73.558 ns | 1.0953 ns | 1.0245 ns | 73.547 ns | 2.68 | 0.04 | 0.1301 | - | - | 272 B | 1.55 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 16 | 28.011 ns | 0.2137 ns | 0.1999 ns | 28.026 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 16 | 68.875 ns | 1.1750 ns | 1.0991 ns | 69.155 ns | 2.46 | 0.05 | 0.1301 | - | - | 272 B | 1.48 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 17 | 28.315 ns | 0.2642 ns | 0.2472 ns | 28.384 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 17 | 73.488 ns | 0.8915 ns | 0.7445 ns | 73.282 ns | 2.59 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 18 | 28.537 ns | 0.3274 ns | 0.2902 ns | 28.366 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 18 | 78.541 ns | 1.5678 ns | 1.3898 ns | 78.484 ns | 2.75 | 0.05 | 0.1912 | - | - | 400 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 19 | 29.619 ns | 0.2659 ns | 0.2076 ns | 29.569 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 19 | 77.614 ns | 1.2187 ns | 1.1400 ns | 77.429 ns | 2.63 | 0.04 | 0.1912 | - | - | 400 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 20 | 29.412 ns | 0.2932 ns | 0.2289 ns | 29.327 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 20 | 77.507 ns | 1.5823 ns | 1.5540 ns | 77.626 ns | 2.64 | 0.05 | 0.1912 | - | - | 400 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 30 | 32.582 ns | 0.1033 ns | 0.0863 ns | 32.594 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 30 | 78.495 ns | 0.9910 ns | 0.9270 ns | 78.604 ns | 2.41 | 0.03 | 0.1912 | - | - | 400 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 32 | 33.787 ns | 0.3666 ns | 0.3250 ns | 33.748 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 32 | 73.195 ns | 0.9241 ns | 0.8192 ns | 73.104 ns | 2.17 | 0.02 | 0.1912 | - | - | 400 B | 1.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 36 | 41.292 ns | 0.7189 ns | 0.7383 ns | 41.224 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 36 | 90.454 ns | 1.1146 ns | 1.0426 ns | 90.164 ns | 2.18 | 0.05 | 0.0726 | - | - | 152 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 37 | 41.764 ns | 0.6511 ns | 0.6091 ns | 41.825 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 37 | 94.358 ns | 0.7783 ns | 0.6899 ns | 94.426 ns | 2.26 | 0.03 | 0.0726 | - | - | 152 B | 0.43 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 43.434 ns | 0.4400 ns | 0.4116 ns | 43.625 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 45.004 ns | 0.5726 ns | 0.5356 ns | 44.794 ns | 1.04 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 95.163 ns | 0.9738 ns | 0.9109 ns | 95.414 ns | 2.19 | 0.03 | 0.0726 | - | - | 152 B | 0.40 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 90.262 ns | 0.5011 ns | 0.4184 ns | 90.214 ns | 2.08 | 0.03 | 0.0726 | - | - | 152 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 50 | 48.545 ns | 0.7105 ns | 0.6646 ns | 48.394 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 50 | 86.724 ns | 0.8487 ns | 0.7939 ns | 86.569 ns | 1.79 | 0.02 | 0.0726 | - | - | 152 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 60 | 52.510 ns | 0.8905 ns | 0.8329 ns | 52.412 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 60 | 91.048 ns | 0.8719 ns | 0.8156 ns | 91.045 ns | 1.73 | 0.03 | 0.0726 | - | - | 152 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 70 | 57.998 ns | 0.8765 ns | 0.8199 ns | 58.223 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 70 | 94.418 ns | 0.8735 ns | 0.7743 ns | 94.506 ns | 1.63 | 0.02 | 0.0726 | - | - | 152 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 80 | 61.584 ns | 0.9545 ns | 0.8928 ns | 61.533 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 80 | 91.144 ns | 0.7758 ns | 0.6877 ns | 91.227 ns | 1.48 | 0.02 | 0.0726 | - | - | 152 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 850000 | 2,552,485.778 ns | 50,601.5629 ns | 124,126.4961 ns | 2,561,205.469 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 850000 | 1,402,280.221 ns | 24,938.7902 ns | 23,327.7598 ns | 1,386,580.664 ns | 0.55 | 0.04 | - | - | - | 445 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 90 | 67.744 ns | 1.4001 ns | 1.4378 ns | 67.875 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 90 | 98.338 ns | 1.0207 ns | 0.9548 ns | 98.716 ns | 1.45 | 0.04 | 0.0726 | - | - | 152 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 100 | 71.117 ns | 1.1286 ns | 1.0557 ns | 70.853 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 100 | 100.146 ns | 0.8346 ns | 0.7807 ns | 100.081 ns | 1.41 | 0.02 | 0.0726 | - | - | 152 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 128 | 86.734 ns | 1.7640 ns | 1.7325 ns | 86.405 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 128 | 98.654 ns | 0.4437 ns | 0.3933 ns | 98.680 ns | 1.14 | 0.02 | 0.0726 | - | - | 152 B | 0.14 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 256 | 151.934 ns | 2.7584 ns | 2.5802 ns | 151.490 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 256 | 107.676 ns | 1.6545 ns | 1.4666 ns | 107.006 ns | 0.71 | 0.01 | 0.0726 | - | - | 152 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 512 | 287.009 ns | 5.4882 ns | 5.8723 ns | 285.913 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 512 | 118.064 ns | 0.7037 ns | 0.6238 ns | 117.871 ns | 0.41 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 1024 | 546.254 ns | 10.5374 ns | 11.7123 ns | 545.656 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 1024 | 151.216 ns | 1.0516 ns | 0.8781 ns | 150.926 ns | 0.28 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 2048 | 1,058.532 ns | 20.4304 ns | 25.0904 ns | 1,055.086 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 2048 | 344.122 ns | 0.5488 ns | 0.4582 ns | 343.927 ns | 0.33 | 0.01 | 0.0725 | - | - | 152 B | 0.009 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 4096 | 2,084.871 ns | 35.5141 ns | 29.6559 ns | 2,082.227 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 4096 | 635.637 ns | 1.9858 ns | 1.6582 ns | 635.702 ns | 0.30 | 0.00 | 0.0725 | - | - | 152 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 8192 | 4,030.369 ns | 52.9474 ns | 44.2135 ns | 4,037.312 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 8192 | 1,227.361 ns | 1.3412 ns | 1.1890 ns | 1,227.335 ns | 0.30 | 0.00 | 0.0725 | - | - | 152 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 16384 | 63,680.482 ns | 1,269.5463 ns | 2,865.5776 ns | 64,523.438 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 16384 | 2,482.393 ns | 4.8548 ns | 4.0540 ns | 2,482.490 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 32768 | 126,205.583 ns | 2,522.8943 ns | 5,376.4935 ns | 127,686.475 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 32768 | 4,879.764 ns | 14.8785 ns | 13.1894 ns | 4,876.628 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 65536 | 125,617.547 ns | 2,428.8927 ns | 2,271.9878 ns | 126,223.145 ns | 1.00 | 0.00 | 113.7695 | 112.7930 | 112.7930 | 525098 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 65536 | 10,999.739 ns | 79.9506 ns | 74.7859 ns | 10,986.104 ns | 0.09 | 0.00 | 0.1984 | - | - | 432 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 131072 | 368,580.983 ns | 7,330.8526 ns | 21,033.5904 ns | 372,785.938 ns | 1.00 | 0.00 | 172.3633 | 171.3867 | 171.3867 | 1048974 B | 1.000 | -| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 131072 | 22,344.782 ns | 91.1245 ns | 76.0931 ns | 22,355.394 ns | 0.06 | 0.00 | 0.1831 | - | - | 432 B | 0.000 | -
- -# `AddRange` when Source is of the Same Type Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.306 - [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 -``` -
-Add Entire Collection Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | AddRa(...)eType [28] | List | Array | 0 | 11.130 ns | 0.2393 ns | 0.6046 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 0 | 11.542 ns | 0.1261 ns | 0.1118 ns | 1.03 | 0.06 | 0.0115 | - | - | 24 B | 0.75 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 1 | 25.470 ns | 0.3937 ns | 0.3682 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 1 | 11.578 ns | 0.1171 ns | 0.1038 ns | 0.45 | 0.01 | 0.0153 | - | - | 32 B | 0.36 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 2 | 25.193 ns | 0.2873 ns | 0.2687 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 2 | 11.983 ns | 0.1474 ns | 0.1307 ns | 0.48 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 3 | 26.398 ns | 0.5484 ns | 0.7864 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 3 | 13.067 ns | 0.2813 ns | 0.4035 ns | 0.50 | 0.02 | 0.0229 | - | - | 48 B | 0.55 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 4 | 26.088 ns | 0.4518 ns | 0.4005 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 4 | 13.009 ns | 0.2636 ns | 0.5841 ns | 0.51 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 5 | 26.131 ns | 0.5141 ns | 0.4808 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 5 | 13.350 ns | 0.2826 ns | 0.3254 ns | 0.51 | 0.02 | 0.0306 | - | - | 64 B | 0.67 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 6 | 26.358 ns | 0.1956 ns | 0.1734 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 6 | 18.101 ns | 0.3910 ns | 0.6202 ns | 0.69 | 0.02 | 0.0344 | - | - | 72 B | 0.69 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 7 | 27.862 ns | 0.5401 ns | 0.4510 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 7 | 15.122 ns | 0.2060 ns | 0.1927 ns | 0.54 | 0.01 | 0.0382 | - | - | 80 B | 0.71 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 8 | 26.364 ns | 0.2000 ns | 0.1773 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 8 | 13.496 ns | 0.1003 ns | 0.0837 ns | 0.51 | 0.01 | 0.0421 | - | - | 88 B | 0.73 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 9 | 27.020 ns | 0.4438 ns | 0.4151 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 9 | 14.024 ns | 0.0786 ns | 0.0614 ns | 0.52 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 10 | 27.181 ns | 0.2353 ns | 0.2086 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 10 | 14.397 ns | 0.0549 ns | 0.0487 ns | 0.53 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 11 | 28.177 ns | 0.4046 ns | 0.4659 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 11 | 14.810 ns | 0.0962 ns | 0.0803 ns | 0.52 | 0.01 | 0.0536 | - | - | 112 B | 0.78 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 12 | 28.219 ns | 0.1322 ns | 0.1104 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 12 | 15.395 ns | 0.2990 ns | 0.2937 ns | 0.55 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 13 | 29.309 ns | 0.4947 ns | 0.4628 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 13 | 15.667 ns | 0.3425 ns | 0.3204 ns | 0.53 | 0.02 | 0.0612 | - | - | 128 B | 0.80 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 14 | 28.922 ns | 0.2560 ns | 0.1999 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 14 | 15.738 ns | 0.1038 ns | 0.0811 ns | 0.54 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 15 | 29.055 ns | 0.2204 ns | 0.1840 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 15 | 17.284 ns | 0.3746 ns | 0.9190 ns | 0.63 | 0.03 | 0.0688 | - | - | 144 B | 0.82 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 16 | 29.595 ns | 0.1483 ns | 0.1387 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 16 | 16.447 ns | 0.1694 ns | 0.1502 ns | 0.56 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 17 | 30.339 ns | 0.2740 ns | 0.2139 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 17 | 17.072 ns | 0.1804 ns | 0.1599 ns | 0.56 | 0.01 | 0.0765 | - | - | 160 B | 0.83 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 18 | 30.067 ns | 0.1784 ns | 0.1581 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 18 | 16.924 ns | 0.0651 ns | 0.0544 ns | 0.56 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 19 | 30.815 ns | 0.1268 ns | 0.1059 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 19 | 17.468 ns | 0.0858 ns | 0.0803 ns | 0.57 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 20 | 31.092 ns | 0.1723 ns | 0.1612 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 20 | 18.077 ns | 0.3485 ns | 0.3423 ns | 0.58 | 0.01 | 0.0880 | - | - | 184 B | 0.85 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 30 | 34.591 ns | 0.1228 ns | 0.1026 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 30 | 21.257 ns | 0.3219 ns | 0.3011 ns | 0.61 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 32 | 35.428 ns | 0.4571 ns | 0.4276 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 32 | 21.349 ns | 0.2307 ns | 0.2158 ns | 0.60 | 0.01 | 0.1339 | - | - | 280 B | 0.90 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 36 | 37.796 ns | 0.4431 ns | 0.4145 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 36 | 22.991 ns | 0.3531 ns | 0.3130 ns | 0.61 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 37 | 45.827 ns | 0.7941 ns | 0.7428 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 37 | 29.952 ns | 0.4111 ns | 0.3645 ns | 0.65 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 40 | 43.855 ns | 0.9048 ns | 1.2976 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)eType [28] | List | Array | 40 | 44.531 ns | 0.8081 ns | 0.7559 ns | 1.00 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 40 | 32.028 ns | 0.4175 ns | 0.3906 ns | 0.72 | 0.02 | 0.1644 | - | - | 344 B | 0.91 | -| Actual | AddRa(...)eType [28] | List | Array | 40 | 31.861 ns | 0.4754 ns | 0.4214 ns | 0.72 | 0.02 | 0.1644 | - | - | 344 B | 0.91 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 50 | 49.180 ns | 0.4984 ns | 0.4662 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 50 | 35.845 ns | 0.4755 ns | 0.4215 ns | 0.73 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 60 | 56.015 ns | 0.9489 ns | 0.8412 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 60 | 41.637 ns | 0.5269 ns | 0.4400 ns | 0.74 | 0.01 | 0.2410 | - | - | 504 B | 0.94 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 70 | 59.495 ns | 1.2186 ns | 1.1399 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 70 | 46.731 ns | 0.7153 ns | 0.6691 ns | 0.79 | 0.02 | 0.2792 | - | - | 584 B | 0.95 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 80 | 62.753 ns | 1.3043 ns | 1.0892 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 80 | 50.285 ns | 0.4069 ns | 0.3398 ns | 0.80 | 0.02 | 0.3175 | - | - | 664 B | 0.95 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 90 | 68.272 ns | 1.3466 ns | 1.3829 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 90 | 55.361 ns | 0.8554 ns | 0.8001 ns | 0.81 | 0.02 | 0.3557 | - | - | 744 B | 0.96 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 100 | 71.997 ns | 1.2148 ns | 1.1931 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 100 | 59.530 ns | 0.4752 ns | 0.3968 ns | 0.83 | 0.02 | 0.3940 | - | - | 824 B | 0.96 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 128 | 87.677 ns | 1.4620 ns | 1.3676 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 128 | 79.391 ns | 1.0735 ns | 1.0042 ns | 0.91 | 0.02 | 0.5009 | - | - | 1048 B | 0.97 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 256 | 156.349 ns | 3.0060 ns | 3.2164 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 256 | 139.939 ns | 2.7788 ns | 3.8036 ns | 0.90 | 0.03 | 0.9899 | - | - | 2072 B | 0.98 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 512 | 285.700 ns | 4.3492 ns | 4.0683 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 512 | 254.336 ns | 3.3971 ns | 2.8368 ns | 0.89 | 0.01 | 1.9684 | - | - | 4120 B | 0.99 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 1024 | 548.307 ns | 9.5689 ns | 10.6358 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 1024 | 502.519 ns | 5.8992 ns | 5.5182 ns | 0.92 | 0.02 | 3.9215 | - | - | 8216 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 2048 | 1,091.469 ns | 20.9323 ns | 20.5583 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 2048 | 996.147 ns | 18.7552 ns | 17.5437 ns | 0.91 | 0.03 | 7.8125 | - | - | 16408 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 4096 | 2,219.535 ns | 44.1725 ns | 55.8640 ns | 1.00 | 0.00 | 15.6212 | - | - | 32824 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 4096 | 2,093.852 ns | 33.5667 ns | 29.7560 ns | 0.94 | 0.03 | 15.6250 | - | - | 32792 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 8192 | 4,137.783 ns | 67.2569 ns | 59.6215 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 8192 | 4,050.748 ns | 79.3689 ns | 74.2417 ns | 0.98 | 0.02 | 31.2500 | - | - | 65560 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 16384 | 62,361.460 ns | 1,234.4155 ns | 2,760.9472 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 16384 | 62,640.143 ns | 1,222.8484 ns | 1,143.8531 ns | 1.00 | 0.05 | 41.6260 | 41.6260 | 41.6260 | 131123 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 32768 | 124,444.963 ns | 2,209.2170 ns | 2,066.5029 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 32768 | 124,601.272 ns | 1,884.6954 ns | 1,762.9453 ns | 1.00 | 0.02 | 83.2520 | 83.2520 | 83.2520 | 262222 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 65536 | 124,986.510 ns | 2,432.2288 ns | 2,388.7739 ns | 1.00 | 0.00 | 121.8262 | 120.8496 | 120.8496 | 524915 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 65536 | 125,391.075 ns | 2,006.6992 ns | 1,778.8865 ns | 1.00 | 0.02 | 114.0137 | 113.7695 | 113.7695 | 524379 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 131072 | 349,388.666 ns | 6,956.3878 ns | 14,974.3587 ns | 1.00 | 0.00 | 171.8750 | 170.8984 | 170.8984 | 1049002 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 131072 | 351,255.893 ns | 9,386.1730 ns | 25,053.5957 ns | 1.00 | 0.08 | 151.3672 | 151.3672 | 151.3672 | 1048697 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | Array | 850000 | 2,420,456.454 ns | 47,773.4283 ns | 117,189.0337 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | Array | 850000 | 2,445,365.667 ns | 47,758.0764 ns | 81,096.8382 ns | 1.01 | 0.06 | 93.7500 | 93.7500 | 93.7500 | 6800108 B | 1.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 0 | 10.864 ns | 0.2451 ns | 0.2517 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 0 | 18.548 ns | 0.3782 ns | 0.3158 ns | 1.71 | 0.05 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 1 | 23.588 ns | 0.1952 ns | 0.1524 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 1 | 48.688 ns | 0.8480 ns | 0.7933 ns | 2.07 | 0.04 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 2 | 23.806 ns | 0.1126 ns | 0.0941 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 2 | 48.646 ns | 0.9822 ns | 0.9647 ns | 2.03 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 3 | 24.054 ns | 0.2895 ns | 0.2566 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 3 | 49.753 ns | 0.3469 ns | 0.2896 ns | 2.07 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 4 | 24.077 ns | 0.3817 ns | 0.3570 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 4 | 48.919 ns | 0.9848 ns | 1.2455 ns | 2.03 | 0.05 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 5 | 24.336 ns | 0.0824 ns | 0.0771 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 5 | 49.869 ns | 0.5317 ns | 0.4713 ns | 2.05 | 0.02 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 6 | 24.621 ns | 0.3176 ns | 0.2971 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 6 | 50.022 ns | 0.3998 ns | 0.3338 ns | 2.03 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 7 | 24.859 ns | 0.3857 ns | 0.3608 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 7 | 49.068 ns | 0.8517 ns | 0.7967 ns | 1.97 | 0.04 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 8 | 25.558 ns | 0.5077 ns | 0.6235 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 8 | 49.053 ns | 0.4336 ns | 0.3844 ns | 1.93 | 0.06 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 9 | 25.654 ns | 0.2436 ns | 0.2160 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 9 | 50.699 ns | 0.4827 ns | 0.4279 ns | 1.98 | 0.03 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 10 | 25.680 ns | 0.1746 ns | 0.1363 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 10 | 49.127 ns | 0.6465 ns | 0.5731 ns | 1.91 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 11 | 26.616 ns | 0.2380 ns | 0.1988 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 11 | 51.448 ns | 0.8978 ns | 1.0688 ns | 1.92 | 0.04 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 12 | 27.378 ns | 0.4981 ns | 0.4159 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 12 | 50.385 ns | 0.5370 ns | 0.4760 ns | 1.84 | 0.04 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 13 | 26.974 ns | 0.2220 ns | 0.2076 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 13 | 51.002 ns | 0.5437 ns | 0.4820 ns | 1.89 | 0.03 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 14 | 27.633 ns | 0.0526 ns | 0.0411 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 14 | 51.993 ns | 0.8438 ns | 0.7893 ns | 1.88 | 0.03 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 15 | 29.526 ns | 0.0964 ns | 0.0752 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 15 | 49.912 ns | 0.3768 ns | 0.3340 ns | 1.69 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 16 | 28.423 ns | 0.2398 ns | 0.2125 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 16 | 50.269 ns | 0.5110 ns | 0.4530 ns | 1.77 | 0.02 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 17 | 28.634 ns | 0.5830 ns | 0.5169 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 17 | 51.806 ns | 0.3907 ns | 0.3463 ns | 1.81 | 0.03 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 18 | 28.709 ns | 0.1578 ns | 0.1398 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 18 | 51.321 ns | 0.6393 ns | 0.5338 ns | 1.79 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 19 | 29.629 ns | 0.1498 ns | 0.1169 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 19 | 51.460 ns | 0.8538 ns | 0.7987 ns | 1.74 | 0.03 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 20 | 29.696 ns | 0.0653 ns | 0.0510 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 20 | 53.873 ns | 0.5867 ns | 0.5488 ns | 1.81 | 0.02 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 30 | 33.173 ns | 0.0947 ns | 0.0739 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 30 | 52.831 ns | 0.9119 ns | 0.8084 ns | 1.59 | 0.03 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 32 | 33.970 ns | 0.3746 ns | 0.3321 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 32 | 51.453 ns | 0.5877 ns | 0.5210 ns | 1.51 | 0.02 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 36 | 35.917 ns | 0.5893 ns | 0.5224 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 36 | 53.030 ns | 0.9696 ns | 0.8596 ns | 1.48 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 37 | 42.025 ns | 0.3079 ns | 0.2404 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 37 | 57.318 ns | 0.6425 ns | 0.5695 ns | 1.36 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 40 | 44.006 ns | 0.5927 ns | 0.5254 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)eType [28] | List | PooledList | 40 | 45.799 ns | 0.6992 ns | 0.5838 ns | 1.04 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 40 | 56.113 ns | 0.6086 ns | 0.5693 ns | 1.28 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | AddRa(...)eType [28] | List | PooledList | 40 | 55.865 ns | 1.1411 ns | 1.3141 ns | 1.27 | 0.04 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 50 | 51.379 ns | 0.5447 ns | 0.5095 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 50 | 57.035 ns | 0.8954 ns | 0.8375 ns | 1.11 | 0.02 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 60 | 54.870 ns | 0.5687 ns | 0.5041 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 60 | 58.892 ns | 0.6835 ns | 0.6393 ns | 1.07 | 0.02 | 0.0268 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 70 | 60.498 ns | 1.0837 ns | 0.9606 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 70 | 57.776 ns | 0.4136 ns | 0.3869 ns | 0.96 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 80 | 62.523 ns | 1.0781 ns | 1.0084 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 80 | 57.940 ns | 0.8512 ns | 0.7963 ns | 0.93 | 0.02 | 0.0267 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 850000 | 2,066,797.500 ns | 20,523.3232 ns | 19,197.5293 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 6800131 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 850000 | 964,365.792 ns | 9,801.7259 ns | 8,688.9747 ns | 0.47 | 0.01 | - | - | - | 70 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 90 | 68.833 ns | 0.8645 ns | 0.7664 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 90 | 58.597 ns | 0.3887 ns | 0.3034 ns | 0.85 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 100 | 74.301 ns | 1.5183 ns | 1.4912 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 100 | 64.482 ns | 0.4218 ns | 0.3739 ns | 0.87 | 0.02 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 128 | 88.448 ns | 1.4699 ns | 1.3749 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 128 | 60.385 ns | 0.7399 ns | 0.6179 ns | 0.68 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 256 | 149.847 ns | 2.5773 ns | 2.4108 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 256 | 73.161 ns | 0.5521 ns | 0.5164 ns | 0.49 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 512 | 283.413 ns | 5.2589 ns | 4.9192 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | PooledList | 512 | 86.162 ns | 1.2962 ns | 1.2124 ns | 0.30 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 1024 | 555.119 ns | 9.5200 ns | 8.9050 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 1024 | 119.310 ns | 1.1890 ns | 0.9928 ns | 0.21 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 2048 | 1,087.334 ns | 20.4621 ns | 21.8942 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 2048 | 268.578 ns | 1.2559 ns | 1.0487 ns | 0.25 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 4096 | 2,197.142 ns | 43.4581 ns | 40.6508 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 4096 | 601.797 ns | 2.5170 ns | 2.3544 ns | 0.27 | 0.01 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 8192 | 4,177.224 ns | 83.1534 ns | 81.6677 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 8192 | 1,094.748 ns | 2.9803 ns | 2.3268 ns | 0.26 | 0.01 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 16384 | 62,481.090 ns | 1,226.8973 ns | 2,421.7756 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 16384 | 2,352.365 ns | 6.4542 ns | 5.7215 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 32768 | 60,438.673 ns | 838.5708 ns | 743.3712 ns | 1.00 | 0.00 | 64.5142 | 63.9038 | 63.9038 | 262643 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 32768 | 5,212.466 ns | 21.0913 ns | 19.7288 ns | 0.09 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 65536 | 126,815.479 ns | 2,451.5053 ns | 3,187.6494 ns | 1.00 | 0.00 | 123.0469 | 122.0703 | 122.0703 | 524855 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 65536 | 12,057.761 ns | 23.2018 ns | 19.3746 ns | 0.09 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | PooledList | 131072 | 555,120.439 ns | 16,978.8548 ns | 50,062.5365 ns | 1.00 | 0.00 | 130.8594 | 129.8828 | 129.8828 | 1048907 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | PooledList | 131072 | 24,792.478 ns | 152.7210 ns | 142.8553 ns | 0.04 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 0 | 9.984 ns | 0.1471 ns | 0.1304 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 0 | 23.295 ns | 0.0688 ns | 0.0575 ns | 2.33 | 0.03 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 1 | 24.646 ns | 0.0579 ns | 0.0484 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 1 | 23.080 ns | 0.0728 ns | 0.0608 ns | 0.94 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 2 | 25.075 ns | 0.3903 ns | 0.3651 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 2 | 23.446 ns | 0.2082 ns | 0.1846 ns | 0.93 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 3 | 25.234 ns | 0.2101 ns | 0.1755 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 3 | 23.276 ns | 0.1936 ns | 0.1811 ns | 0.92 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 4 | 24.821 ns | 0.2100 ns | 0.1862 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 4 | 23.723 ns | 0.2376 ns | 0.1984 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 5 | 25.455 ns | 0.1967 ns | 0.1643 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 5 | 24.119 ns | 0.4441 ns | 0.3937 ns | 0.95 | 0.02 | 0.0536 | - | - | 112 B | 1.17 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 6 | 25.880 ns | 0.3365 ns | 0.2983 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 6 | 24.328 ns | 0.3539 ns | 0.3310 ns | 0.94 | 0.02 | 0.0574 | - | - | 120 B | 1.15 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 7 | 26.254 ns | 0.4840 ns | 0.4527 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 7 | 24.480 ns | 0.1700 ns | 0.1590 ns | 0.93 | 0.01 | 0.0612 | - | - | 128 B | 1.14 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 8 | 26.215 ns | 0.2432 ns | 0.2275 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 8 | 24.226 ns | 0.1506 ns | 0.1258 ns | 0.92 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 9 | 27.113 ns | 0.3339 ns | 0.2960 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 9 | 25.085 ns | 0.1451 ns | 0.1212 ns | 0.93 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 10 | 27.033 ns | 0.1833 ns | 0.1715 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 10 | 25.472 ns | 0.0927 ns | 0.0822 ns | 0.94 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 11 | 27.718 ns | 0.1791 ns | 0.1398 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 11 | 26.043 ns | 0.2054 ns | 0.1820 ns | 0.94 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 12 | 28.322 ns | 0.1488 ns | 0.1319 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 12 | 26.749 ns | 0.3152 ns | 0.2949 ns | 0.95 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 13 | 28.553 ns | 0.0852 ns | 0.0712 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 13 | 26.703 ns | 0.1340 ns | 0.1188 ns | 0.94 | 0.00 | 0.0842 | - | - | 176 B | 1.10 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 14 | 28.731 ns | 0.2008 ns | 0.1780 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 14 | 26.911 ns | 0.2181 ns | 0.2040 ns | 0.94 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 15 | 29.373 ns | 0.4128 ns | 0.3861 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 15 | 26.830 ns | 0.2702 ns | 0.2256 ns | 0.92 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 16 | 29.921 ns | 0.2043 ns | 0.1811 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 16 | 27.116 ns | 0.2464 ns | 0.2184 ns | 0.91 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 17 | 29.394 ns | 0.2128 ns | 0.1777 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 17 | 27.931 ns | 0.3428 ns | 0.3039 ns | 0.95 | 0.01 | 0.0995 | - | - | 208 B | 1.08 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 18 | 30.388 ns | 0.3601 ns | 0.3368 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 18 | 27.886 ns | 0.3436 ns | 0.3214 ns | 0.92 | 0.01 | 0.1033 | - | - | 216 B | 1.08 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 19 | 31.047 ns | 0.5781 ns | 0.5407 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 19 | 28.831 ns | 0.3529 ns | 0.3301 ns | 0.93 | 0.02 | 0.1071 | - | - | 224 B | 1.08 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 20 | 30.976 ns | 0.2613 ns | 0.2445 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 20 | 29.190 ns | 0.3043 ns | 0.2847 ns | 0.94 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 30 | 34.546 ns | 0.5836 ns | 0.5459 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 30 | 31.642 ns | 0.1564 ns | 0.1221 ns | 0.92 | 0.01 | 0.1492 | - | - | 312 B | 1.05 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 32 | 35.010 ns | 0.1142 ns | 0.1012 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 32 | 31.866 ns | 0.1098 ns | 0.0917 ns | 0.91 | 0.00 | 0.1568 | - | - | 328 B | 1.05 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 36 | 37.283 ns | 0.3699 ns | 0.3460 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 36 | 34.279 ns | 0.6879 ns | 0.5744 ns | 0.92 | 0.02 | 0.1721 | - | - | 360 B | 1.05 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 37 | 42.471 ns | 0.8034 ns | 0.9564 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 37 | 39.053 ns | 0.5582 ns | 0.4948 ns | 0.92 | 0.03 | 0.0382 | - | - | 80 B | 0.23 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 40 | 44.106 ns | 0.4028 ns | 0.3570 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 40 | 44.109 ns | 0.7584 ns | 0.7094 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 40 | 41.890 ns | 0.8572 ns | 1.1443 ns | 0.95 | 0.04 | 0.0382 | - | - | 80 B | 0.21 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 40 | 41.548 ns | 0.8442 ns | 1.2373 ns | 0.93 | 0.03 | 0.0382 | - | - | 80 B | 0.21 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 50 | 49.175 ns | 0.8146 ns | 0.7619 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 50 | 41.499 ns | 0.8199 ns | 0.9442 ns | 0.84 | 0.03 | 0.0382 | - | - | 80 B | 0.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 60 | 53.845 ns | 1.0794 ns | 1.8034 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 60 | 41.220 ns | 0.6544 ns | 0.6121 ns | 0.75 | 0.03 | 0.0382 | - | - | 80 B | 0.15 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 70 | 57.915 ns | 1.1268 ns | 1.0540 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 70 | 42.082 ns | 0.8164 ns | 0.8019 ns | 0.73 | 0.02 | 0.0382 | - | - | 80 B | 0.13 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 80 | 63.026 ns | 1.2702 ns | 1.5599 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 80 | 44.869 ns | 0.7835 ns | 0.7329 ns | 0.72 | 0.02 | 0.0382 | - | - | 80 B | 0.11 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 90 | 66.255 ns | 0.9316 ns | 0.8259 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 90 | 44.769 ns | 0.9159 ns | 0.9800 ns | 0.68 | 0.02 | 0.0382 | - | - | 80 B | 0.10 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 100 | 73.985 ns | 1.2756 ns | 1.1932 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 100 | 46.870 ns | 0.7417 ns | 0.6575 ns | 0.63 | 0.01 | 0.0382 | - | - | 80 B | 0.09 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 128 | 85.671 ns | 1.0133 ns | 0.8462 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 128 | 45.684 ns | 0.9202 ns | 1.0597 ns | 0.53 | 0.02 | 0.0382 | - | - | 80 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 256 | 153.485 ns | 2.9825 ns | 3.0628 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 256 | 57.447 ns | 0.8614 ns | 0.8057 ns | 0.38 | 0.01 | 0.0382 | - | - | 80 B | 0.04 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 512 | 280.755 ns | 5.6056 ns | 5.7565 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 512 | 86.984 ns | 0.3941 ns | 0.3494 ns | 0.31 | 0.01 | 0.0381 | - | - | 80 B | 0.02 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 1024 | 540.902 ns | 10.5032 ns | 12.0955 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 1024 | 119.791 ns | 0.7695 ns | 0.7198 ns | 0.22 | 0.00 | 0.0381 | - | - | 80 B | 0.010 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 2048 | 1,071.924 ns | 20.7493 ns | 23.0628 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 2048 | 256.106 ns | 1.7875 ns | 1.6721 ns | 0.24 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 4096 | 2,152.656 ns | 42.3875 ns | 82.6735 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 4096 | 590.185 ns | 1.8672 ns | 1.6552 ns | 0.27 | 0.01 | 0.0381 | - | - | 80 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 8192 | 4,117.021 ns | 81.1150 ns | 102.5846 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 8192 | 1,057.719 ns | 3.7570 ns | 3.1373 ns | 0.26 | 0.01 | 0.0381 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 16384 | 61,909.318 ns | 1,168.6242 ns | 1,093.1318 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 16384 | 2,213.035 ns | 9.2986 ns | 8.6979 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 32768 | 124,050.279 ns | 1,854.0950 ns | 1,734.3216 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 32768 | 4,783.964 ns | 33.6396 ns | 31.4665 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 65536 | 127,514.403 ns | 2,414.8174 ns | 2,684.0632 ns | 1.00 | 0.00 | 113.5254 | 112.5488 | 112.5488 | 525062 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 65536 | 11,186.556 ns | 63.5896 ns | 56.3706 ns | 0.09 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 131072 | 339,330.092 ns | 6,385.0031 ns | 5,660.1390 ns | 1.00 | 0.00 | 140.6250 | 139.6484 | 139.6484 | 1049099 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 131072 | 21,402.054 ns | 176.6340 ns | 165.2236 ns | 0.06 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableList | 850000 | 2,376,119.556 ns | 47,395.7652 ns | 92,441.8000 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableList | 850000 | 994,650.133 ns | 14,850.8560 ns | 13,891.4999 ns | 0.42 | 0.02 | - | - | - | 93 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 0 | 10.904 ns | 0.0638 ns | 0.0566 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 0 | 20.511 ns | 0.2668 ns | 0.2496 ns | 1.88 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 1 | 24.959 ns | 0.0797 ns | 0.0706 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 1 | 72.454 ns | 0.2531 ns | 0.2367 ns | 2.90 | 0.01 | 0.0726 | - | - | 152 B | 1.73 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 2 | 25.108 ns | 0.3381 ns | 0.3162 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 2 | 71.529 ns | 0.4878 ns | 0.4073 ns | 2.85 | 0.04 | 0.0764 | - | - | 160 B | 1.82 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 3 | 26.151 ns | 0.4230 ns | 0.3957 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 3 | 66.991 ns | 0.6016 ns | 0.5627 ns | 2.56 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 4 | 26.056 ns | 0.4589 ns | 0.4068 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 4 | 72.162 ns | 0.8150 ns | 0.7624 ns | 2.77 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 5 | 26.859 ns | 0.4836 ns | 0.4524 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 5 | 66.718 ns | 0.9715 ns | 0.9087 ns | 2.48 | 0.05 | 0.0994 | - | - | 208 B | 2.17 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 6 | 26.665 ns | 0.3548 ns | 0.3484 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 6 | 67.162 ns | 1.3353 ns | 1.3713 ns | 2.52 | 0.06 | 0.0994 | - | - | 208 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 7 | 26.300 ns | 0.2841 ns | 0.2658 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 7 | 66.967 ns | 1.1590 ns | 0.9678 ns | 2.55 | 0.05 | 0.0994 | - | - | 208 B | 1.86 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 8 | 27.574 ns | 0.1915 ns | 0.1698 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 8 | 74.324 ns | 0.4434 ns | 0.3703 ns | 2.70 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 9 | 26.977 ns | 0.0502 ns | 0.0419 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 9 | 70.684 ns | 0.8233 ns | 0.7702 ns | 2.62 | 0.03 | 0.1301 | - | - | 272 B | 2.12 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 10 | 27.462 ns | 0.1436 ns | 0.1199 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 10 | 70.197 ns | 1.2714 ns | 1.1893 ns | 2.55 | 0.04 | 0.1301 | - | - | 272 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 11 | 29.863 ns | 0.5762 ns | 0.5390 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 11 | 73.540 ns | 1.4041 ns | 1.3790 ns | 2.46 | 0.06 | 0.1301 | - | - | 272 B | 1.89 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 12 | 29.872 ns | 0.1969 ns | 0.1842 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 12 | 72.325 ns | 0.8258 ns | 0.7724 ns | 2.42 | 0.03 | 0.1301 | - | - | 272 B | 1.79 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 13 | 29.975 ns | 0.2438 ns | 0.2161 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 13 | 72.729 ns | 0.9520 ns | 0.8905 ns | 2.43 | 0.04 | 0.1301 | - | - | 272 B | 1.70 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 14 | 30.268 ns | 0.2860 ns | 0.2536 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 14 | 72.482 ns | 1.0387 ns | 0.9716 ns | 2.39 | 0.04 | 0.1301 | - | - | 272 B | 1.62 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 15 | 30.054 ns | 0.3848 ns | 0.3600 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 15 | 71.198 ns | 1.1847 ns | 1.1082 ns | 2.37 | 0.04 | 0.1301 | - | - | 272 B | 1.55 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 16 | 29.915 ns | 0.1625 ns | 0.1357 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 16 | 77.678 ns | 0.7768 ns | 0.7266 ns | 2.59 | 0.03 | 0.1301 | - | - | 272 B | 1.48 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 17 | 30.334 ns | 0.4255 ns | 0.3980 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 17 | 75.712 ns | 1.3404 ns | 1.2538 ns | 2.50 | 0.05 | 0.1912 | - | - | 400 B | 2.08 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 18 | 30.239 ns | 0.4177 ns | 0.3907 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 18 | 75.437 ns | 0.9996 ns | 0.8347 ns | 2.50 | 0.04 | 0.1912 | - | - | 400 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 19 | 32.478 ns | 0.3859 ns | 0.3421 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 19 | 77.166 ns | 0.7857 ns | 0.6561 ns | 2.37 | 0.04 | 0.1912 | - | - | 400 B | 1.92 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 20 | 32.781 ns | 0.3910 ns | 0.3265 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 20 | 77.595 ns | 1.4140 ns | 1.3227 ns | 2.37 | 0.05 | 0.1912 | - | - | 400 B | 1.85 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 30 | 35.679 ns | 0.5166 ns | 0.4314 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 30 | 78.698 ns | 1.2769 ns | 1.1945 ns | 2.21 | 0.05 | 0.1912 | - | - | 400 B | 1.35 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 32 | 35.066 ns | 0.4752 ns | 0.4212 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 32 | 82.503 ns | 0.6996 ns | 0.6545 ns | 2.35 | 0.03 | 0.1912 | - | - | 400 B | 1.28 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 36 | 42.449 ns | 0.3532 ns | 0.2949 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 36 | 90.669 ns | 0.8020 ns | 0.7109 ns | 2.14 | 0.03 | 0.0726 | - | - | 152 B | 0.44 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 37 | 45.330 ns | 0.6440 ns | 0.5709 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 37 | 86.098 ns | 1.0429 ns | 0.9755 ns | 1.90 | 0.03 | 0.0726 | - | - | 152 B | 0.43 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 45.714 ns | 0.6506 ns | 0.5767 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 45.859 ns | 0.5729 ns | 0.5359 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 86.625 ns | 1.4336 ns | 1.3410 ns | 1.90 | 0.04 | 0.0726 | - | - | 152 B | 0.40 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 85.021 ns | 1.1591 ns | 1.0842 ns | 1.86 | 0.03 | 0.0726 | - | - | 152 B | 0.40 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 50 | 50.080 ns | 0.9707 ns | 1.6484 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 50 | 91.564 ns | 0.9019 ns | 0.7995 ns | 1.78 | 0.04 | 0.0726 | - | - | 152 B | 0.33 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 60 | 55.192 ns | 1.1290 ns | 1.0561 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 60 | 88.056 ns | 0.9427 ns | 0.8818 ns | 1.60 | 0.04 | 0.0726 | - | - | 152 B | 0.28 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 70 | 60.089 ns | 0.9410 ns | 0.8803 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 70 | 88.199 ns | 0.7938 ns | 0.6629 ns | 1.47 | 0.02 | 0.0726 | - | - | 152 B | 0.25 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 80 | 65.051 ns | 1.0846 ns | 1.0145 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 80 | 87.173 ns | 1.3621 ns | 1.2742 ns | 1.34 | 0.03 | 0.0726 | - | - | 152 B | 0.22 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 850000 | 2,073,757.688 ns | 35,902.6590 ns | 44,091.6896 ns | 1.00 | 0.00 | 85.9375 | 85.9375 | 85.9375 | 6800136 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 850000 | 1,397,636.775 ns | 21,279.7061 ns | 18,863.9052 ns | 0.67 | 0.02 | - | - | - | 457 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 90 | 69.863 ns | 1.2842 ns | 1.2012 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 90 | 88.215 ns | 1.2682 ns | 1.0590 ns | 1.26 | 0.03 | 0.0726 | - | - | 152 B | 0.20 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 100 | 76.827 ns | 1.5786 ns | 1.5504 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 100 | 90.378 ns | 1.3849 ns | 1.2954 ns | 1.18 | 0.03 | 0.0726 | - | - | 152 B | 0.18 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 128 | 87.659 ns | 1.6866 ns | 1.8047 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 128 | 96.360 ns | 1.9181 ns | 1.9698 ns | 1.10 | 0.03 | 0.0726 | - | - | 152 B | 0.14 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 256 | 156.419 ns | 2.9980 ns | 2.8043 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 256 | 106.052 ns | 1.3438 ns | 1.2570 ns | 0.68 | 0.01 | 0.0726 | - | - | 152 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 512 | 284.013 ns | 5.5347 ns | 7.3887 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 512 | 124.200 ns | 0.9799 ns | 0.9166 ns | 0.44 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 1024 | 548.962 ns | 10.6434 ns | 10.9300 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 1024 | 159.443 ns | 1.3463 ns | 1.1935 ns | 0.29 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 2048 | 1,082.050 ns | 20.4083 ns | 20.9578 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 2048 | 296.525 ns | 2.5386 ns | 2.3746 ns | 0.27 | 0.01 | 0.0725 | - | - | 152 B | 0.009 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 4096 | 2,162.695 ns | 41.0124 ns | 45.5851 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 4096 | 643.180 ns | 1.7082 ns | 1.4264 ns | 0.30 | 0.01 | 0.0725 | - | - | 152 B | 0.005 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 8192 | 4,173.033 ns | 76.6649 ns | 71.7124 ns | 1.00 | 0.00 | 31.2424 | 0.0076 | - | 65592 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 8192 | 1,118.365 ns | 2.7970 ns | 2.1837 ns | 0.27 | 0.00 | 0.0725 | - | - | 152 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 16384 | 62,637.616 ns | 642.2715 ns | 600.7811 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 16384 | 2,460.005 ns | 14.7731 ns | 13.8188 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 32768 | 124,466.459 ns | 2,474.2540 ns | 4,825.8424 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 32768 | 4,915.874 ns | 33.8292 ns | 29.9887 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 65536 | 124,811.930 ns | 1,904.0356 ns | 1,781.0361 ns | 1.00 | 0.00 | 121.8262 | 120.8496 | 120.8496 | 524913 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 65536 | 11,048.069 ns | 77.3298 ns | 72.3343 ns | 0.09 | 0.00 | 0.1984 | - | - | 432 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 131072 | 557,480.125 ns | 15,327.4575 ns | 44,952.7795 ns | 1.00 | 0.00 | 124.0234 | 124.0234 | 124.0234 | 1048847 B | 1.000 | -| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 131072 | 23,189.499 ns | 157.7244 ns | 139.8186 ns | 0.04 | 0.00 | 0.1831 | - | - | 432 B | 0.000 | -
- -# `foreach` Benchmarks -## Environment - -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.400 - [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 -``` - -
-Non-Versioned & Versioned foreach Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | -|--------- |----------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|-----------------:|------:|--------:|----------:|------------:| -| Baseline | ForEach | List | Array | 0 | 3.487 ns | 0.0179 ns | 0.0150 ns | 3.482 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 0 | 3.434 ns | 0.0081 ns | 0.0072 ns | 3.434 ns | 0.98 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 1 | 5.630 ns | 0.0174 ns | 0.0163 ns | 5.627 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 1 | 4.184 ns | 0.0255 ns | 0.0226 ns | 4.178 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 2 | 7.334 ns | 0.0255 ns | 0.0226 ns | 7.331 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 2 | 5.380 ns | 0.0192 ns | 0.0170 ns | 5.372 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 3 | 9.049 ns | 0.0539 ns | 0.0450 ns | 9.029 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 3 | 6.786 ns | 0.0396 ns | 0.0370 ns | 6.798 ns | 0.75 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 4 | 11.407 ns | 0.2501 ns | 0.2977 ns | 11.303 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 4 | 7.772 ns | 0.0253 ns | 0.0224 ns | 7.768 ns | 0.68 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 5 | 12.862 ns | 0.0414 ns | 0.0367 ns | 12.845 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 5 | 9.454 ns | 0.0152 ns | 0.0127 ns | 9.448 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 6 | 15.321 ns | 0.0833 ns | 0.0696 ns | 15.326 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 6 | 10.668 ns | 0.0156 ns | 0.0138 ns | 10.665 ns | 0.70 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 7 | 17.036 ns | 0.0375 ns | 0.0293 ns | 17.043 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 7 | 11.966 ns | 0.0340 ns | 0.0301 ns | 11.965 ns | 0.70 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 8 | 18.712 ns | 0.1134 ns | 0.0947 ns | 18.676 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 8 | 14.084 ns | 0.0917 ns | 0.0858 ns | 14.068 ns | 0.75 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 9 | 20.313 ns | 0.0572 ns | 0.0478 ns | 20.325 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 9 | 14.891 ns | 0.0550 ns | 0.0488 ns | 14.889 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 10 | 22.192 ns | 0.4737 ns | 0.3956 ns | 22.071 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 10 | 16.123 ns | 0.0641 ns | 0.0569 ns | 16.114 ns | 0.73 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 11 | 23.641 ns | 0.1011 ns | 0.0946 ns | 23.669 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 11 | 17.335 ns | 0.0499 ns | 0.0417 ns | 17.327 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 12 | 25.257 ns | 0.0708 ns | 0.0662 ns | 25.251 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 12 | 18.630 ns | 0.0767 ns | 0.0717 ns | 18.630 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 13 | 26.951 ns | 0.0753 ns | 0.0629 ns | 26.954 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 13 | 19.711 ns | 0.0645 ns | 0.0603 ns | 19.727 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 14 | 31.153 ns | 0.8776 ns | 2.5877 ns | 30.424 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 14 | 21.176 ns | 0.1692 ns | 0.1583 ns | 21.133 ns | 0.67 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 15 | 30.372 ns | 0.1292 ns | 0.1208 ns | 30.368 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 15 | 22.237 ns | 0.1125 ns | 0.1053 ns | 22.237 ns | 0.73 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 16 | 32.101 ns | 0.1252 ns | 0.1171 ns | 32.097 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 16 | 23.175 ns | 0.0321 ns | 0.0268 ns | 23.164 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 17 | 33.932 ns | 0.1474 ns | 0.1307 ns | 33.933 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 17 | 24.482 ns | 0.0630 ns | 0.0589 ns | 24.484 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 18 | 38.305 ns | 1.0860 ns | 3.2022 ns | 36.323 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 18 | 25.664 ns | 0.0367 ns | 0.0325 ns | 25.654 ns | 0.67 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 19 | 37.343 ns | 0.1699 ns | 0.1589 ns | 37.291 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 19 | 26.873 ns | 0.0570 ns | 0.0533 ns | 26.840 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 20 | 38.951 ns | 0.1495 ns | 0.1399 ns | 38.977 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 20 | 28.079 ns | 0.0525 ns | 0.0465 ns | 28.084 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 30 | 62.954 ns | 0.1634 ns | 0.1276 ns | 62.929 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 30 | 40.119 ns | 0.0740 ns | 0.0692 ns | 40.091 ns | 0.64 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 32 | 76.166 ns | 1.5663 ns | 3.5988 ns | 77.714 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 32 | 50.062 ns | 0.1958 ns | 0.1831 ns | 50.081 ns | 0.66 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 36 | 86.614 ns | 1.7552 ns | 2.1555 ns | 87.531 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 36 | 53.487 ns | 0.0479 ns | 0.0448 ns | 53.469 ns | 0.62 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 37 | 75.856 ns | 0.3714 ns | 0.3102 ns | 75.819 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 37 | 54.833 ns | 0.1245 ns | 0.1164 ns | 54.792 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 40 | 80.450 ns | 0.2158 ns | 0.2018 ns | 80.410 ns | 1.00 | 0.00 | - | NA | -| Baseline | ForEach | List | Array | 40 | 95.505 ns | 1.9345 ns | 2.3757 ns | 96.241 ns | 1.18 | 0.03 | - | NA | -| Actual | ForEach | List | Array | 40 | 57.393 ns | 0.1455 ns | 0.1290 ns | 57.330 ns | 0.71 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 40 | 57.380 ns | 0.1309 ns | 0.1161 ns | 57.341 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 50 | 113.094 ns | 2.2972 ns | 5.4596 ns | 114.487 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 50 | 69.941 ns | 0.2646 ns | 0.2346 ns | 69.901 ns | 0.62 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 60 | 135.453 ns | 2.7219 ns | 3.7257 ns | 135.652 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 60 | 82.196 ns | 0.3092 ns | 0.2892 ns | 82.136 ns | 0.61 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 70 | 131.325 ns | 0.3936 ns | 0.3682 ns | 131.332 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 70 | 94.408 ns | 0.2604 ns | 0.2435 ns | 94.316 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 80 | 148.601 ns | 0.6620 ns | 0.6192 ns | 148.551 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 80 | 105.787 ns | 0.2325 ns | 0.2061 ns | 105.737 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 90 | 165.663 ns | 0.5758 ns | 0.5386 ns | 165.592 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 90 | 118.377 ns | 0.4253 ns | 0.3978 ns | 118.196 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 100 | 182.601 ns | 0.6587 ns | 0.5839 ns | 182.786 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 100 | 130.277 ns | 0.3582 ns | 0.3350 ns | 130.165 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 128 | 230.132 ns | 0.6950 ns | 0.6161 ns | 230.085 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 128 | 163.550 ns | 0.3581 ns | 0.3350 ns | 163.526 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 256 | 446.447 ns | 0.8596 ns | 0.8040 ns | 446.478 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 256 | 318.035 ns | 0.5664 ns | 0.5021 ns | 317.986 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 512 | 881.729 ns | 2.9007 ns | 2.7133 ns | 880.546 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 512 | 627.926 ns | 1.0484 ns | 0.9807 ns | 627.657 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 1024 | 1,749.543 ns | 3.1759 ns | 2.8154 ns | 1,749.770 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 1024 | 1,244.577 ns | 1.6036 ns | 1.4216 ns | 1,244.631 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 2048 | 3,479.646 ns | 7.1813 ns | 6.7174 ns | 3,477.583 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 2048 | 2,484.262 ns | 3.8278 ns | 3.5806 ns | 2,483.284 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 4096 | 6,966.203 ns | 14.6556 ns | 13.7088 ns | 6,970.947 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 4096 | 4,970.602 ns | 9.2895 ns | 8.6894 ns | 4,969.536 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 8192 | 13,932.168 ns | 38.3528 ns | 35.8753 ns | 13,919.844 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 8192 | 9,919.799 ns | 17.7701 ns | 16.6222 ns | 9,920.946 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 16384 | 27,879.434 ns | 146.9250 ns | 130.2452 ns | 27,832.965 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 16384 | 19,808.677 ns | 46.0551 ns | 43.0800 ns | 19,790.013 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 32768 | 55,575.696 ns | 129.2643 ns | 120.9139 ns | 55,538.348 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 32768 | 39,620.633 ns | 99.5818 ns | 88.2767 ns | 39,592.172 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 65536 | 111,706.166 ns | 159.1455 ns | 141.0783 ns | 111,688.910 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 65536 | 79,235.173 ns | 103.3609 ns | 91.6267 ns | 79,206.268 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 131072 | 222,985.042 ns | 722.8065 ns | 676.1137 ns | 222,746.484 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | Array | 131072 | 158,797.176 ns | 245.8026 ns | 229.9239 ns | 158,728.003 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | Array | 850000 | 1,559,428.776 ns | 3,833.1196 ns | 3,585.5025 ns | 1,559,275.586 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | ForEach | List | Array | 850000 | 1,108,570.229 ns | 3,343.2555 ns | 2,963.7089 ns | 1,108,734.277 ns | 0.71 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 0 | 3.434 ns | 0.0141 ns | 0.0132 ns | 3.429 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 0 | 3.444 ns | 0.0110 ns | 0.0103 ns | 3.448 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 1 | 5.614 ns | 0.0233 ns | 0.0218 ns | 5.614 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 1 | 5.583 ns | 0.0185 ns | 0.0173 ns | 5.587 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 2 | 7.765 ns | 0.1669 ns | 0.1479 ns | 7.798 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 2 | 7.342 ns | 0.0477 ns | 0.0398 ns | 7.332 ns | 0.95 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 3 | 9.467 ns | 0.2188 ns | 0.4615 ns | 9.411 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 3 | 9.380 ns | 0.2160 ns | 0.3949 ns | 9.224 ns | 1.00 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 4 | 11.567 ns | 0.2513 ns | 0.3087 ns | 11.491 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 4 | 11.327 ns | 0.1668 ns | 0.1560 ns | 11.260 ns | 0.98 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 5 | 12.887 ns | 0.0472 ns | 0.0394 ns | 12.882 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 5 | 12.827 ns | 0.0344 ns | 0.0321 ns | 12.827 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 6 | 15.519 ns | 0.1414 ns | 0.1181 ns | 15.496 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 6 | 15.445 ns | 0.0905 ns | 0.0803 ns | 15.428 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 7 | 17.103 ns | 0.1409 ns | 0.1177 ns | 17.108 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 7 | 17.039 ns | 0.1346 ns | 0.1259 ns | 17.020 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 8 | 19.299 ns | 0.3939 ns | 0.9661 ns | 18.764 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 8 | 18.884 ns | 0.1780 ns | 0.1486 ns | 18.830 ns | 0.96 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 9 | 20.700 ns | 0.2643 ns | 0.2343 ns | 20.647 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 9 | 20.432 ns | 0.0651 ns | 0.0544 ns | 20.435 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 10 | 22.201 ns | 0.0735 ns | 0.0574 ns | 22.197 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 10 | 22.337 ns | 0.2260 ns | 0.2114 ns | 22.364 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 11 | 23.811 ns | 0.1260 ns | 0.1052 ns | 23.796 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 11 | 23.819 ns | 0.0769 ns | 0.0719 ns | 23.809 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 12 | 25.586 ns | 0.0797 ns | 0.0707 ns | 25.574 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 12 | 25.558 ns | 0.0898 ns | 0.0796 ns | 25.559 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 13 | 27.169 ns | 0.0793 ns | 0.0703 ns | 27.160 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 13 | 27.174 ns | 0.1547 ns | 0.1292 ns | 27.117 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 14 | 28.957 ns | 0.1960 ns | 0.1737 ns | 28.968 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 14 | 29.072 ns | 0.2523 ns | 0.2237 ns | 28.988 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 15 | 30.935 ns | 0.4808 ns | 0.4015 ns | 30.814 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 15 | 30.655 ns | 0.1198 ns | 0.1062 ns | 30.629 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 16 | 35.813 ns | 1.0146 ns | 2.9916 ns | 36.201 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 16 | 32.350 ns | 0.1767 ns | 0.1566 ns | 32.320 ns | 0.91 | 0.08 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 17 | 34.243 ns | 0.2892 ns | 0.2705 ns | 34.160 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 17 | 34.064 ns | 0.1255 ns | 0.1112 ns | 34.064 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 18 | 35.583 ns | 0.1969 ns | 0.1745 ns | 35.562 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 18 | 35.784 ns | 0.1352 ns | 0.1199 ns | 35.800 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 19 | 37.909 ns | 0.7471 ns | 0.7993 ns | 37.585 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 19 | 37.530 ns | 0.1687 ns | 0.1578 ns | 37.519 ns | 0.99 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 20 | 39.243 ns | 0.1422 ns | 0.1330 ns | 39.228 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 20 | 39.426 ns | 0.2247 ns | 0.1992 ns | 39.361 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 30 | 63.002 ns | 0.2112 ns | 0.1764 ns | 62.997 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 30 | 65.206 ns | 1.2478 ns | 1.1061 ns | 65.334 ns | 1.04 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 32 | 77.233 ns | 1.5675 ns | 2.8265 ns | 77.958 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 32 | 74.176 ns | 1.5220 ns | 4.2174 ns | 74.708 ns | 0.97 | 0.07 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 36 | 76.701 ns | 1.5428 ns | 2.4471 ns | 75.445 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 36 | 73.986 ns | 0.3092 ns | 0.2741 ns | 73.994 ns | 0.97 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 37 | 77.157 ns | 1.5706 ns | 1.6129 ns | 76.256 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 37 | 76.747 ns | 0.9947 ns | 1.1056 ns | 76.332 ns | 1.00 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 40 | 94.101 ns | 1.9021 ns | 2.1142 ns | 93.753 ns | 1.00 | 0.00 | - | NA | -| Baseline | ForEach | List | PooledList | 40 | 81.920 ns | 1.0109 ns | 0.8962 ns | 81.665 ns | 0.87 | 0.02 | - | NA | -| Actual | ForEach | List | PooledList | 40 | 82.126 ns | 0.2497 ns | 0.1950 ns | 82.088 ns | 0.87 | 0.02 | - | NA | -| Actual | ForEach | List | PooledList | 40 | 81.877 ns | 0.4354 ns | 0.3400 ns | 81.879 ns | 0.87 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 50 | 114.548 ns | 2.3357 ns | 4.2709 ns | 116.251 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 50 | 97.259 ns | 0.4719 ns | 0.3940 ns | 97.210 ns | 0.85 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 60 | 115.943 ns | 0.4975 ns | 0.4155 ns | 116.023 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 60 | 115.545 ns | 0.6375 ns | 0.5652 ns | 115.333 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 70 | 132.611 ns | 0.8738 ns | 0.7746 ns | 132.364 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 70 | 132.470 ns | 0.6565 ns | 0.5820 ns | 132.474 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 80 | 149.596 ns | 0.8339 ns | 0.6510 ns | 149.639 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 80 | 150.304 ns | 0.7272 ns | 0.6072 ns | 150.155 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 90 | 168.000 ns | 1.5190 ns | 1.3466 ns | 167.437 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 90 | 169.943 ns | 3.3051 ns | 3.3941 ns | 168.897 ns | 1.02 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 100 | 184.615 ns | 0.7075 ns | 0.5908 ns | 184.613 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 100 | 183.936 ns | 0.7194 ns | 0.6729 ns | 184.181 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 128 | 277.400 ns | 5.5602 ns | 10.9753 ns | 279.962 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 128 | 234.935 ns | 3.4783 ns | 2.9045 ns | 233.790 ns | 0.85 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 256 | 463.407 ns | 9.0123 ns | 18.6120 ns | 452.785 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 256 | 448.334 ns | 2.0213 ns | 1.8907 ns | 447.834 ns | 0.95 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 512 | 900.356 ns | 15.5701 ns | 28.0761 ns | 890.155 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 512 | 885.681 ns | 1.9970 ns | 1.8680 ns | 885.209 ns | 0.96 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 1024 | 1,756.976 ns | 3.2978 ns | 3.0848 ns | 1,758.019 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 1024 | 1,749.680 ns | 3.1351 ns | 2.9325 ns | 1,749.040 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 2048 | 3,489.313 ns | 9.7968 ns | 9.1640 ns | 3,486.633 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 2048 | 3,483.028 ns | 6.0058 ns | 5.3240 ns | 3,481.583 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 4096 | 6,979.314 ns | 17.1730 ns | 16.0636 ns | 6,982.885 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 4096 | 8,763.527 ns | 166.6675 ns | 198.4059 ns | 8,845.802 ns | 1.26 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 8192 | 13,908.613 ns | 17.6154 ns | 15.6156 ns | 13,909.135 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 8192 | 13,898.685 ns | 15.3045 ns | 14.3158 ns | 13,894.859 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 16384 | 27,790.455 ns | 49.9030 ns | 44.2377 ns | 27,779.057 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 16384 | 27,824.080 ns | 72.2218 ns | 67.5563 ns | 27,794.858 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 32768 | 55,846.212 ns | 302.0570 ns | 282.5443 ns | 55,830.786 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 32768 | 68,962.246 ns | 1,358.7261 ns | 2,982.4367 ns | 70,118.353 ns | 1.25 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 65536 | 111,530.071 ns | 121.3229 ns | 94.7209 ns | 111,536.230 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 65536 | 111,566.079 ns | 406.3781 ns | 339.3442 ns | 111,462.988 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 131072 | 272,889.139 ns | 5,411.1805 ns | 13,171.5611 ns | 276,588.672 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | PooledList | 131072 | 223,426.717 ns | 466.1160 ns | 436.0052 ns | 223,518.799 ns | 0.81 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | PooledList | 850000 | 1,563,831.628 ns | 4,879.2411 ns | 4,564.0451 ns | 1,562,421.094 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | ForEach | List | PooledList | 850000 | 1,559,869.648 ns | 5,975.4829 ns | 5,589.4704 ns | 1,558,741.211 ns | 1.00 | 0.01 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 0 | 3.897 ns | 0.0079 ns | 0.0061 ns | 3.895 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 0 | 3.889 ns | 0.0093 ns | 0.0073 ns | 3.887 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 1 | 5.196 ns | 0.0596 ns | 0.0558 ns | 5.175 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 1 | 5.105 ns | 0.0202 ns | 0.0158 ns | 5.099 ns | 0.98 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 2 | 6.952 ns | 0.1676 ns | 0.1794 ns | 6.861 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 2 | 6.886 ns | 0.0452 ns | 0.0401 ns | 6.886 ns | 0.99 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 3 | 8.632 ns | 0.1190 ns | 0.1055 ns | 8.586 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 3 | 8.602 ns | 0.1814 ns | 0.2016 ns | 8.557 ns | 0.99 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 4 | 11.269 ns | 0.1537 ns | 0.1363 ns | 11.218 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 4 | 10.469 ns | 0.0791 ns | 0.0701 ns | 10.452 ns | 0.93 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 5 | 12.895 ns | 0.1120 ns | 0.1047 ns | 12.886 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 5 | 11.962 ns | 0.1177 ns | 0.0983 ns | 11.938 ns | 0.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 6 | 15.146 ns | 0.1488 ns | 0.1319 ns | 15.131 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 6 | 13.588 ns | 0.2112 ns | 0.3161 ns | 13.518 ns | 0.91 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 7 | 16.795 ns | 0.1409 ns | 0.1318 ns | 16.789 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 7 | 14.441 ns | 0.2025 ns | 0.1894 ns | 14.401 ns | 0.86 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 8 | 18.400 ns | 0.1146 ns | 0.1016 ns | 18.369 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 8 | 17.857 ns | 0.3822 ns | 0.3191 ns | 17.869 ns | 0.97 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 9 | 20.172 ns | 0.1349 ns | 0.1053 ns | 20.178 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 9 | 18.270 ns | 0.0718 ns | 0.0599 ns | 18.283 ns | 0.91 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 10 | 21.916 ns | 0.0928 ns | 0.0823 ns | 21.928 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 10 | 19.709 ns | 0.0979 ns | 0.0818 ns | 19.701 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 11 | 23.197 ns | 0.0585 ns | 0.0547 ns | 23.196 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 11 | 21.200 ns | 0.0596 ns | 0.0528 ns | 21.219 ns | 0.91 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 12 | 24.881 ns | 0.0510 ns | 0.0477 ns | 24.865 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 12 | 22.752 ns | 0.1361 ns | 0.1136 ns | 22.757 ns | 0.91 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 13 | 26.501 ns | 0.0529 ns | 0.0469 ns | 26.509 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 13 | 24.515 ns | 0.4878 ns | 0.4563 ns | 24.327 ns | 0.93 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 14 | 28.351 ns | 0.1112 ns | 0.1040 ns | 28.341 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 14 | 25.516 ns | 0.1428 ns | 0.1336 ns | 25.543 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 15 | 29.926 ns | 0.1134 ns | 0.1005 ns | 29.942 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 15 | 27.125 ns | 0.0984 ns | 0.0921 ns | 27.089 ns | 0.91 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 16 | 31.825 ns | 0.2127 ns | 0.1886 ns | 31.778 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 16 | 28.624 ns | 0.0813 ns | 0.0721 ns | 28.611 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 17 | 33.454 ns | 0.0703 ns | 0.0549 ns | 33.465 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 17 | 30.075 ns | 0.1216 ns | 0.1138 ns | 30.086 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 18 | 36.200 ns | 0.7540 ns | 1.3976 ns | 35.686 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 18 | 31.591 ns | 0.1500 ns | 0.1330 ns | 31.610 ns | 0.86 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 19 | 36.854 ns | 0.1329 ns | 0.1110 ns | 36.854 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 19 | 32.927 ns | 0.1723 ns | 0.1527 ns | 32.915 ns | 0.89 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 20 | 38.959 ns | 0.5167 ns | 0.4833 ns | 38.720 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 20 | 34.393 ns | 0.0862 ns | 0.0807 ns | 34.391 ns | 0.88 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 30 | 61.256 ns | 0.1077 ns | 0.0954 ns | 61.258 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 30 | 49.502 ns | 0.5085 ns | 0.4756 ns | 49.391 ns | 0.81 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 32 | 64.915 ns | 0.2272 ns | 0.2014 ns | 65.007 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 32 | 58.160 ns | 0.5696 ns | 0.5328 ns | 58.166 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 36 | 72.435 ns | 0.2443 ns | 0.2040 ns | 72.404 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 36 | 62.545 ns | 0.3182 ns | 0.2820 ns | 62.634 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 37 | 74.069 ns | 0.1884 ns | 0.1573 ns | 74.063 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 37 | 64.186 ns | 0.1868 ns | 0.1560 ns | 64.160 ns | 0.87 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 40 | 80.944 ns | 0.4681 ns | 0.4150 ns | 80.941 ns | 1.00 | 0.00 | - | NA | -| Baseline | ForEach | List | RecyclableList | 40 | 82.404 ns | 0.1928 ns | 0.1804 ns | 82.418 ns | 1.02 | 0.01 | - | NA | -| Actual | ForEach | List | RecyclableList | 40 | 69.077 ns | 0.2331 ns | 0.2180 ns | 69.100 ns | 0.85 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 40 | 69.334 ns | 0.2743 ns | 0.2566 ns | 69.322 ns | 0.86 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 50 | 98.201 ns | 0.3462 ns | 0.3069 ns | 98.232 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 50 | 84.078 ns | 0.3052 ns | 0.2548 ns | 84.133 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 60 | 114.693 ns | 0.3332 ns | 0.2953 ns | 114.678 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 60 | 98.711 ns | 0.3461 ns | 0.3237 ns | 98.646 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 70 | 132.078 ns | 0.5282 ns | 0.4941 ns | 132.078 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 70 | 114.073 ns | 0.3592 ns | 0.3184 ns | 113.962 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 80 | 150.952 ns | 1.7599 ns | 1.6462 ns | 150.293 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 80 | 126.950 ns | 0.5323 ns | 0.4719 ns | 126.853 ns | 0.84 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 90 | 166.176 ns | 0.7985 ns | 0.6668 ns | 166.213 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 90 | 141.332 ns | 0.4301 ns | 0.4023 ns | 141.242 ns | 0.85 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 100 | 183.225 ns | 0.7108 ns | 0.6301 ns | 183.186 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 100 | 159.109 ns | 0.4564 ns | 0.3811 ns | 158.983 ns | 0.87 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 128 | 231.789 ns | 0.8625 ns | 0.7203 ns | 231.707 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 128 | 198.749 ns | 1.1534 ns | 1.0225 ns | 198.388 ns | 0.86 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 256 | 526.449 ns | 11.2327 ns | 33.1200 ns | 535.656 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 256 | 387.056 ns | 1.9091 ns | 1.6924 ns | 387.088 ns | 0.76 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 512 | 1,095.189 ns | 21.5183 ns | 38.2488 ns | 1,110.607 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 512 | 757.916 ns | 2.6272 ns | 2.4575 ns | 758.071 ns | 0.70 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 1024 | 1,760.360 ns | 5.3118 ns | 4.7087 ns | 1,760.422 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 1024 | 1,510.912 ns | 5.9692 ns | 5.5836 ns | 1,509.651 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 2048 | 3,502.355 ns | 7.9543 ns | 6.2102 ns | 3,503.366 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 2048 | 3,023.332 ns | 9.8529 ns | 8.7343 ns | 3,023.347 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 4096 | 7,063.648 ns | 37.7039 ns | 35.2683 ns | 7,050.784 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 4096 | 6,017.671 ns | 21.8350 ns | 17.0473 ns | 6,016.796 ns | 0.85 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 8192 | 14,038.772 ns | 112.4703 ns | 99.7020 ns | 14,013.964 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 8192 | 12,272.461 ns | 185.1265 ns | 164.1098 ns | 12,257.167 ns | 0.87 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 16384 | 28,264.346 ns | 152.1960 ns | 142.3642 ns | 28,255.090 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableList | 16384 | 24,144.064 ns | 127.1945 ns | 112.7546 ns | 24,172.777 ns | 0.85 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 32768 | 55,945.263 ns | 217.6655 ns | 203.6044 ns | 55,822.766 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | ForEach | List | RecyclableList | 32768 | 48,280.504 ns | 292.4931 ns | 259.2875 ns | 48,278.644 ns | 0.86 | 0.01 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 65536 | 112,192.360 ns | 549.9817 ns | 459.2596 ns | 112,052.478 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | ForEach | List | RecyclableList | 65536 | 96,424.772 ns | 147.2971 ns | 130.5750 ns | 96,376.611 ns | 0.86 | 0.00 | 2 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 131072 | 280,593.286 ns | 5,557.9140 ns | 7,226.8581 ns | 282,078.113 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | ForEach | List | RecyclableList | 131072 | 193,267.340 ns | 602.3478 ns | 563.4365 ns | 193,258.716 ns | 0.69 | 0.02 | 3 B | 1.50 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableList | 850000 | 1,572,202.204 ns | 15,820.6387 ns | 14,024.5841 ns | 1,565,870.215 ns | 1.00 | 0.00 | 25 B | 1.00 | -| Actual | ForEach | List | RecyclableList | 850000 | 1,336,531.069 ns | 10,898.1858 ns | 9,660.9579 ns | 1,332,973.340 ns | 0.85 | 0.01 | 13 B | 0.52 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 0 | 3.920 ns | 0.0250 ns | 0.0209 ns | 3.912 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 0 | 5.460 ns | 0.0539 ns | 0.0477 ns | 5.455 ns | 1.39 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 1 | 6.337 ns | 0.1552 ns | 0.2915 ns | 6.517 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 1 | 8.225 ns | 0.1055 ns | 0.0987 ns | 8.215 ns | 1.29 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 2 | 7.344 ns | 0.0525 ns | 0.0438 ns | 7.328 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 2 | 11.911 ns | 0.2579 ns | 0.2413 ns | 11.793 ns | 1.62 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 3 | 9.086 ns | 0.0767 ns | 0.0680 ns | 9.058 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 3 | 16.080 ns | 0.3512 ns | 0.7636 ns | 16.058 ns | 1.77 | 0.08 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 4 | 11.257 ns | 0.0390 ns | 0.0326 ns | 11.257 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 4 | 18.643 ns | 0.1277 ns | 0.1066 ns | 18.662 ns | 1.66 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 5 | 13.377 ns | 0.2964 ns | 0.5192 ns | 13.175 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 5 | 23.191 ns | 0.3864 ns | 0.3017 ns | 23.221 ns | 1.77 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 6 | 15.426 ns | 0.0340 ns | 0.0284 ns | 15.425 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 6 | 26.109 ns | 0.2736 ns | 0.2425 ns | 26.118 ns | 1.69 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 7 | 17.238 ns | 0.1991 ns | 0.1663 ns | 17.188 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 7 | 29.406 ns | 0.3434 ns | 0.3212 ns | 29.397 ns | 1.71 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 8 | 18.987 ns | 0.1362 ns | 0.1274 ns | 18.938 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 8 | 32.332 ns | 0.0719 ns | 0.0637 ns | 32.334 ns | 1.70 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 9 | 20.603 ns | 0.1129 ns | 0.1001 ns | 20.592 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 9 | 36.690 ns | 0.4103 ns | 0.3838 ns | 36.684 ns | 1.78 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 10 | 22.547 ns | 0.2141 ns | 0.2003 ns | 22.540 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 10 | 39.811 ns | 0.5537 ns | 0.5179 ns | 39.642 ns | 1.77 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 11 | 24.009 ns | 0.1994 ns | 0.1767 ns | 23.955 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 11 | 43.239 ns | 0.4869 ns | 0.4554 ns | 43.032 ns | 1.80 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 12 | 25.849 ns | 0.2969 ns | 0.2479 ns | 25.848 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 12 | 47.156 ns | 0.9622 ns | 0.9881 ns | 46.710 ns | 1.83 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 13 | 27.538 ns | 0.3519 ns | 0.2748 ns | 27.473 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 13 | 51.656 ns | 1.0328 ns | 2.0145 ns | 50.958 ns | 1.86 | 0.09 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 14 | 33.262 ns | 1.2784 ns | 3.7493 ns | 32.738 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 14 | 55.363 ns | 1.1436 ns | 2.8691 ns | 54.621 ns | 1.71 | 0.23 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 15 | 32.695 ns | 0.9753 ns | 2.7186 ns | 31.360 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 15 | 66.578 ns | 0.8714 ns | 0.7276 ns | 66.439 ns | 1.95 | 0.09 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 16 | 34.387 ns | 0.8336 ns | 2.3783 ns | 33.290 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 16 | 67.789 ns | 0.6828 ns | 0.5702 ns | 67.800 ns | 1.97 | 0.11 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 17 | 36.782 ns | 1.0920 ns | 3.1333 ns | 35.205 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 17 | 71.822 ns | 0.4487 ns | 0.4198 ns | 71.845 ns | 1.94 | 0.19 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 18 | 39.311 ns | 1.0969 ns | 3.2343 ns | 39.106 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 18 | 74.991 ns | 0.5649 ns | 0.5284 ns | 75.072 ns | 1.88 | 0.16 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 19 | 37.563 ns | 0.1247 ns | 0.1042 ns | 37.530 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 19 | 78.368 ns | 0.2849 ns | 0.2665 ns | 78.339 ns | 2.09 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 20 | 39.201 ns | 0.2381 ns | 0.1859 ns | 39.152 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 20 | 81.695 ns | 0.3233 ns | 0.3024 ns | 81.616 ns | 2.08 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 30 | 63.352 ns | 0.4289 ns | 0.3348 ns | 63.300 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 30 | 117.247 ns | 1.3825 ns | 1.2932 ns | 117.002 ns | 1.85 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 32 | 75.545 ns | 1.5398 ns | 3.4755 ns | 76.149 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 32 | 124.538 ns | 2.2596 ns | 2.0031 ns | 124.019 ns | 1.66 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 36 | 73.480 ns | 0.3846 ns | 0.3409 ns | 73.532 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 36 | 138.077 ns | 1.4030 ns | 1.0954 ns | 138.365 ns | 1.88 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 37 | 75.778 ns | 0.4734 ns | 0.4196 ns | 75.679 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 37 | 141.462 ns | 1.8471 ns | 2.8757 ns | 140.394 ns | 1.88 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 40 | 80.076 ns | 0.1433 ns | 0.1119 ns | 80.111 ns | 1.00 | 0.00 | - | NA | -| Baseline | ForEach | List | RecyclableLongList | 40 | 80.585 ns | 0.3080 ns | 0.2405 ns | 80.613 ns | 1.01 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 40 | 167.978 ns | 6.7939 ns | 19.7103 ns | 159.602 ns | 2.03 | 0.08 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 40 | 154.534 ns | 2.5756 ns | 3.4383 ns | 153.739 ns | 1.93 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 50 | 99.272 ns | 1.9526 ns | 1.8264 ns | 98.170 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 50 | 184.432 ns | 1.0074 ns | 0.9423 ns | 184.027 ns | 1.86 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 60 | 113.774 ns | 0.4073 ns | 0.3810 ns | 113.630 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 60 | 219.955 ns | 3.2966 ns | 2.5737 ns | 219.345 ns | 1.93 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 70 | 130.797 ns | 0.6088 ns | 0.5695 ns | 130.696 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 70 | 253.115 ns | 0.3426 ns | 0.3037 ns | 253.111 ns | 1.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 80 | 147.581 ns | 0.3430 ns | 0.3208 ns | 147.562 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 80 | 286.753 ns | 0.7081 ns | 0.6624 ns | 286.741 ns | 1.94 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 850000 | 1,573,933.164 ns | 10,382.2066 ns | 9,711.5225 ns | 1,577,438.672 ns | 1.00 | 0.00 | 25 B | 1.00 | -| Actual | ForEach | List | RecyclableLongList | 850000 | 2,758,170.938 ns | 13,509.0478 ns | 12,636.3717 ns | 2,758,662.109 ns | 1.75 | 0.01 | 27 B | 1.08 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 90 | 164.562 ns | 0.3416 ns | 0.3028 ns | 164.540 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 90 | 321.062 ns | 0.5492 ns | 0.5137 ns | 321.053 ns | 1.95 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 100 | 183.520 ns | 0.6715 ns | 0.6281 ns | 183.629 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 100 | 354.458 ns | 0.7867 ns | 0.6974 ns | 354.207 ns | 1.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 128 | 229.202 ns | 0.9552 ns | 0.8467 ns | 229.057 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 128 | 501.192 ns | 10.0071 ns | 20.8886 ns | 489.900 ns | 2.26 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 256 | 449.720 ns | 1.9807 ns | 1.7558 ns | 449.356 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 256 | 949.606 ns | 2.7887 ns | 2.3287 ns | 949.125 ns | 2.11 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 512 | 884.885 ns | 2.4238 ns | 2.2672 ns | 883.987 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 512 | 1,882.112 ns | 6.2503 ns | 5.8466 ns | 1,880.750 ns | 2.13 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 1024 | 1,755.925 ns | 6.0778 ns | 5.3878 ns | 1,754.101 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 1024 | 3,757.980 ns | 7.7449 ns | 6.8656 ns | 3,759.209 ns | 2.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 2048 | 3,489.102 ns | 4.7328 ns | 3.6951 ns | 3,488.493 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 2048 | 7,465.174 ns | 14.6889 ns | 13.7400 ns | 7,465.691 ns | 2.14 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 4096 | 6,964.136 ns | 9.7275 ns | 8.1229 ns | 6,963.749 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 4096 | 14,998.377 ns | 34.8706 ns | 32.6179 ns | 15,003.624 ns | 2.15 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 8192 | 13,989.232 ns | 37.1075 ns | 34.7104 ns | 13,992.447 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 8192 | 29,963.563 ns | 70.8338 ns | 66.2579 ns | 29,977.522 ns | 2.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 16384 | 27,921.346 ns | 78.0018 ns | 69.1466 ns | 27,926.756 ns | 1.00 | 0.00 | - | NA | -| Actual | ForEach | List | RecyclableLongList | 16384 | 52,494.696 ns | 100.1860 ns | 88.8123 ns | 52,480.118 ns | 1.88 | 0.01 | 1 B | NA | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 32768 | 56,019.953 ns | 186.8463 ns | 174.7761 ns | 56,023.074 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | ForEach | List | RecyclableLongList | 32768 | 104,678.256 ns | 170.7997 ns | 133.3492 ns | 104,692.169 ns | 1.87 | 0.01 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 65536 | 111,453.854 ns | 190.9286 ns | 169.2533 ns | 111,418.707 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | ForEach | List | RecyclableLongList | 65536 | 209,495.001 ns | 241.5080 ns | 201.6701 ns | 209,501.685 ns | 1.88 | 0.00 | 2 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | ForEach | List | RecyclableLongList | 131072 | 223,323.181 ns | 411.2504 ns | 321.0773 ns | 223,244.727 ns | 1.00 | 0.00 | 3 B | 1.00 | -| Actual | ForEach | List | RecyclableLongList | 131072 | 419,358.031 ns | 847.6060 ns | 792.8511 ns | 419,270.996 ns | 1.88 | 0.00 | 6 B | 2.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 0 | 3.459 ns | 0.0083 ns | 0.0074 ns | 3.458 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 0 | 3.414 ns | 0.0063 ns | 0.0049 ns | 3.415 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 1 | 5.598 ns | 0.0098 ns | 0.0087 ns | 5.597 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 1 | 4.159 ns | 0.0188 ns | 0.0166 ns | 4.150 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 2 | 7.322 ns | 0.0226 ns | 0.0211 ns | 7.323 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 2 | 5.397 ns | 0.0166 ns | 0.0156 ns | 5.403 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 3 | 9.622 ns | 0.2214 ns | 0.3992 ns | 9.909 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 3 | 6.555 ns | 0.0123 ns | 0.0103 ns | 6.558 ns | 0.70 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 4 | 11.165 ns | 0.0420 ns | 0.0351 ns | 11.158 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 4 | 7.777 ns | 0.0215 ns | 0.0191 ns | 7.783 ns | 0.70 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 5 | 12.944 ns | 0.2631 ns | 0.2054 ns | 12.855 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 5 | 9.448 ns | 0.0127 ns | 0.0099 ns | 9.448 ns | 0.73 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 6 | 15.447 ns | 0.0263 ns | 0.0233 ns | 15.449 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 6 | 10.691 ns | 0.0227 ns | 0.0201 ns | 10.685 ns | 0.69 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 7 | 17.175 ns | 0.3306 ns | 0.2761 ns | 17.059 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 7 | 12.128 ns | 0.0218 ns | 0.0204 ns | 12.122 ns | 0.71 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 8 | 18.742 ns | 0.1322 ns | 0.1237 ns | 18.742 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 8 | 13.691 ns | 0.0573 ns | 0.0536 ns | 13.683 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 9 | 20.333 ns | 0.1336 ns | 0.1043 ns | 20.301 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 9 | 14.920 ns | 0.0419 ns | 0.0392 ns | 14.929 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 10 | 21.936 ns | 0.0668 ns | 0.0625 ns | 21.952 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 10 | 16.090 ns | 0.0328 ns | 0.0290 ns | 16.095 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 11 | 23.578 ns | 0.0768 ns | 0.0681 ns | 23.558 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 11 | 17.313 ns | 0.0652 ns | 0.0610 ns | 17.313 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 12 | 25.293 ns | 0.0790 ns | 0.0739 ns | 25.286 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 12 | 18.661 ns | 0.0953 ns | 0.0892 ns | 18.668 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 13 | 27.034 ns | 0.1284 ns | 0.1072 ns | 27.011 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 13 | 19.841 ns | 0.0598 ns | 0.0559 ns | 19.840 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 14 | 28.757 ns | 0.1096 ns | 0.1025 ns | 28.752 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 14 | 21.150 ns | 0.1013 ns | 0.0948 ns | 21.159 ns | 0.74 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 15 | 32.964 ns | 0.8554 ns | 2.5222 ns | 32.617 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 15 | 22.282 ns | 0.0914 ns | 0.0810 ns | 22.287 ns | 0.66 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 16 | 32.237 ns | 0.1148 ns | 0.1074 ns | 32.206 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 16 | 23.180 ns | 0.0366 ns | 0.0342 ns | 23.177 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 17 | 36.880 ns | 0.9614 ns | 2.8346 ns | 36.745 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 17 | 24.494 ns | 0.0758 ns | 0.0709 ns | 24.478 ns | 0.66 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 18 | 35.417 ns | 0.0485 ns | 0.0405 ns | 35.428 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 18 | 25.609 ns | 0.0434 ns | 0.0385 ns | 25.594 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 19 | 37.214 ns | 0.1201 ns | 0.1124 ns | 37.197 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 19 | 26.810 ns | 0.0352 ns | 0.0312 ns | 26.811 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 20 | 38.848 ns | 0.0831 ns | 0.0777 ns | 38.813 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 20 | 28.030 ns | 0.0600 ns | 0.0501 ns | 28.020 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 30 | 62.232 ns | 0.1485 ns | 0.1240 ns | 62.264 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 30 | 40.197 ns | 0.1378 ns | 0.1289 ns | 40.184 ns | 0.65 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 32 | 66.695 ns | 0.2586 ns | 0.2292 ns | 66.676 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 32 | 49.723 ns | 0.4063 ns | 0.3801 ns | 49.735 ns | 0.74 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 36 | 74.231 ns | 1.3120 ns | 2.0810 ns | 73.333 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 36 | 53.480 ns | 0.1465 ns | 0.1298 ns | 53.422 ns | 0.72 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 37 | 75.223 ns | 0.3723 ns | 0.2906 ns | 75.211 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 37 | 54.955 ns | 0.0965 ns | 0.0805 ns | 54.949 ns | 0.73 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 40 | 80.632 ns | 0.2132 ns | 0.1665 ns | 80.611 ns | 1.00 | 0.00 | - | NA | -| Baseline | VersionedForEach | List | Array | 40 | 80.928 ns | 0.3209 ns | 0.2845 ns | 81.016 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 40 | 57.571 ns | 0.1620 ns | 0.1516 ns | 57.550 ns | 0.71 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 40 | 57.567 ns | 0.2715 ns | 0.2540 ns | 57.480 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 50 | 98.337 ns | 0.4607 ns | 0.3847 ns | 98.234 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 50 | 69.918 ns | 0.3088 ns | 0.2888 ns | 69.902 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 60 | 114.727 ns | 0.3872 ns | 0.3432 ns | 114.731 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 60 | 82.549 ns | 0.2423 ns | 0.2266 ns | 82.606 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 70 | 131.907 ns | 0.3786 ns | 0.3161 ns | 131.899 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 70 | 94.562 ns | 0.2713 ns | 0.2538 ns | 94.563 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 80 | 148.123 ns | 0.4904 ns | 0.4347 ns | 148.048 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 80 | 105.933 ns | 0.2151 ns | 0.1797 ns | 105.988 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 90 | 164.847 ns | 0.5387 ns | 0.5039 ns | 164.889 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 90 | 117.819 ns | 0.3778 ns | 0.3534 ns | 117.754 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 100 | 182.306 ns | 0.5262 ns | 0.4108 ns | 182.398 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 100 | 129.732 ns | 0.1857 ns | 0.1737 ns | 129.709 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 128 | 229.294 ns | 0.5763 ns | 0.5109 ns | 229.472 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 128 | 163.568 ns | 0.4130 ns | 0.3661 ns | 163.544 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 256 | 447.474 ns | 1.0745 ns | 1.0050 ns | 447.656 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 256 | 317.788 ns | 0.7944 ns | 0.7431 ns | 317.833 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 512 | 879.350 ns | 2.0729 ns | 1.8375 ns | 878.595 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 512 | 626.624 ns | 1.5525 ns | 1.4522 ns | 626.585 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 1024 | 1,750.301 ns | 3.1932 ns | 2.9869 ns | 1,750.540 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 1024 | 1,244.438 ns | 2.3394 ns | 2.0739 ns | 1,244.519 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 2048 | 3,480.663 ns | 8.0170 ns | 6.6946 ns | 3,479.336 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 2048 | 2,486.001 ns | 3.2825 ns | 2.7410 ns | 2,485.112 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 4096 | 6,960.781 ns | 18.3644 ns | 17.1781 ns | 6,958.032 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 4096 | 4,968.435 ns | 9.0030 ns | 8.4214 ns | 4,967.094 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 8192 | 13,906.199 ns | 39.5137 ns | 36.9612 ns | 13,891.061 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 8192 | 9,922.030 ns | 16.2379 ns | 15.1890 ns | 9,917.949 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 16384 | 27,826.960 ns | 74.5928 ns | 69.7741 ns | 27,804.218 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 16384 | 19,859.062 ns | 41.2759 ns | 38.6095 ns | 19,862.294 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 32768 | 55,708.288 ns | 123.8257 ns | 96.6750 ns | 55,745.242 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 32768 | 39,844.087 ns | 89.7389 ns | 83.9418 ns | 39,847.931 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 65536 | 111,636.830 ns | 295.5719 ns | 276.4781 ns | 111,597.668 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 65536 | 79,441.596 ns | 126.6409 ns | 112.2638 ns | 79,425.519 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 131072 | 223,460.151 ns | 552.9382 ns | 490.1653 ns | 223,465.381 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | Array | 131072 | 159,437.563 ns | 498.6698 ns | 466.4560 ns | 159,408.081 ns | 0.71 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | Array | 850000 | 1,573,075.240 ns | 3,515.9662 ns | 2,935.9910 ns | 1,572,922.656 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | VersionedForEach | List | Array | 850000 | 1,112,052.201 ns | 4,512.3840 ns | 4,220.8868 ns | 1,111,925.391 ns | 0.71 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 0 | 3.605 ns | 0.0999 ns | 0.1367 ns | 3.547 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 0 | 3.387 ns | 0.0478 ns | 0.0447 ns | 3.375 ns | 0.94 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 1 | 5.572 ns | 0.0273 ns | 0.0256 ns | 5.562 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 1 | 5.754 ns | 0.0797 ns | 0.0622 ns | 5.742 ns | 1.03 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 2 | 7.342 ns | 0.0333 ns | 0.0296 ns | 7.343 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 2 | 7.338 ns | 0.0370 ns | 0.0328 ns | 7.330 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 3 | 9.520 ns | 0.2201 ns | 0.3678 ns | 9.441 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 3 | 9.495 ns | 0.2189 ns | 0.4712 ns | 9.249 ns | 1.01 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 4 | 11.648 ns | 0.1662 ns | 0.1474 ns | 11.676 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 4 | 11.274 ns | 0.1642 ns | 0.1371 ns | 11.240 ns | 0.97 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 5 | 13.066 ns | 0.2624 ns | 0.2326 ns | 12.992 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 5 | 13.068 ns | 0.1415 ns | 0.1105 ns | 13.038 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 6 | 16.836 ns | 0.4463 ns | 1.2805 ns | 16.484 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 6 | 15.372 ns | 0.0496 ns | 0.0439 ns | 15.366 ns | 0.90 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 7 | 17.412 ns | 0.3740 ns | 0.6249 ns | 17.154 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 7 | 17.030 ns | 0.1402 ns | 0.1311 ns | 17.057 ns | 0.97 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 8 | 19.288 ns | 0.3984 ns | 1.0839 ns | 18.725 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 8 | 18.846 ns | 0.1664 ns | 0.1389 ns | 18.807 ns | 0.97 | 0.07 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 9 | 20.307 ns | 0.1793 ns | 0.1498 ns | 20.339 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 9 | 20.516 ns | 0.1498 ns | 0.1169 ns | 20.501 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 10 | 22.189 ns | 0.1822 ns | 0.1422 ns | 22.153 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 10 | 22.166 ns | 0.1267 ns | 0.1058 ns | 22.165 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 11 | 23.817 ns | 0.1630 ns | 0.1273 ns | 23.791 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 11 | 24.184 ns | 0.5098 ns | 0.5870 ns | 23.968 ns | 1.01 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 12 | 26.862 ns | 0.6210 ns | 1.7515 ns | 26.071 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 12 | 26.073 ns | 0.5135 ns | 0.9390 ns | 25.633 ns | 0.96 | 0.07 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 13 | 27.434 ns | 0.5770 ns | 0.4818 ns | 27.261 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 13 | 27.357 ns | 0.1410 ns | 0.1178 ns | 27.379 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 14 | 29.172 ns | 0.6069 ns | 0.5961 ns | 28.998 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 14 | 29.223 ns | 0.1778 ns | 0.1664 ns | 29.209 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 15 | 31.018 ns | 0.2327 ns | 0.2063 ns | 30.959 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 15 | 30.791 ns | 0.1933 ns | 0.1808 ns | 30.722 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 16 | 32.697 ns | 0.4948 ns | 0.5499 ns | 32.438 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 16 | 32.477 ns | 0.3344 ns | 0.2792 ns | 32.395 ns | 0.99 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 17 | 34.414 ns | 0.5702 ns | 0.5855 ns | 34.231 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 17 | 34.495 ns | 0.6197 ns | 0.7837 ns | 34.140 ns | 1.01 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 18 | 35.883 ns | 0.3110 ns | 0.2428 ns | 35.813 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 18 | 35.834 ns | 0.2171 ns | 0.1813 ns | 35.837 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 19 | 37.951 ns | 0.6024 ns | 0.5030 ns | 37.717 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 19 | 37.936 ns | 0.3289 ns | 0.2916 ns | 37.852 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 20 | 39.294 ns | 0.1403 ns | 0.1243 ns | 39.267 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 20 | 39.747 ns | 0.3799 ns | 0.3368 ns | 39.767 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 30 | 63.651 ns | 1.2614 ns | 1.1182 ns | 63.192 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 30 | 64.080 ns | 0.2043 ns | 0.1911 ns | 64.072 ns | 1.01 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 32 | 76.701 ns | 1.5564 ns | 1.9683 ns | 76.991 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 32 | 75.454 ns | 1.6036 ns | 4.7283 ns | 77.656 ns | 0.97 | 0.07 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 36 | 73.477 ns | 0.4009 ns | 0.3130 ns | 73.432 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 36 | 73.728 ns | 0.3577 ns | 0.3346 ns | 73.750 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 37 | 77.769 ns | 1.5771 ns | 2.1053 ns | 77.206 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 37 | 76.266 ns | 0.2876 ns | 0.2402 ns | 76.303 ns | 0.98 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 40 | 82.670 ns | 1.0862 ns | 0.9070 ns | 82.414 ns | 1.00 | 0.00 | - | NA | -| Baseline | VersionedForEach | List | PooledList | 40 | 81.617 ns | 0.8529 ns | 0.7122 ns | 81.854 ns | 0.99 | 0.01 | - | NA | -| Actual | VersionedForEach | List | PooledList | 40 | 81.777 ns | 0.2407 ns | 0.2133 ns | 81.772 ns | 0.99 | 0.01 | - | NA | -| Actual | VersionedForEach | List | PooledList | 40 | 81.803 ns | 0.7038 ns | 0.6239 ns | 81.637 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 50 | 100.467 ns | 1.6927 ns | 1.5005 ns | 99.658 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 50 | 99.949 ns | 0.8722 ns | 0.6810 ns | 100.174 ns | 0.99 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 60 | 116.896 ns | 1.1950 ns | 1.0593 ns | 117.067 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 60 | 116.487 ns | 0.9138 ns | 0.8101 ns | 116.381 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 70 | 132.761 ns | 0.7028 ns | 0.6230 ns | 132.723 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 70 | 133.131 ns | 0.8565 ns | 0.8012 ns | 133.131 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 80 | 150.716 ns | 1.4505 ns | 1.1324 ns | 150.515 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 80 | 153.492 ns | 2.9405 ns | 7.1575 ns | 150.261 ns | 1.06 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 90 | 167.783 ns | 0.4266 ns | 0.3562 ns | 167.768 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 90 | 166.777 ns | 0.5967 ns | 0.5290 ns | 166.843 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 100 | 188.789 ns | 3.5107 ns | 6.9297 ns | 186.205 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 100 | 194.927 ns | 3.9297 ns | 10.8892 ns | 190.716 ns | 1.02 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 128 | 233.435 ns | 3.2857 ns | 2.5653 ns | 232.631 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 128 | 231.886 ns | 2.1358 ns | 1.7835 ns | 231.022 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 256 | 458.486 ns | 8.3274 ns | 9.9132 ns | 453.806 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 256 | 456.333 ns | 8.9321 ns | 8.7725 ns | 451.573 ns | 0.99 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 512 | 894.050 ns | 12.9499 ns | 11.4797 ns | 891.104 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 512 | 894.210 ns | 9.5158 ns | 7.9461 ns | 893.481 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 1024 | 1,794.834 ns | 32.5101 ns | 45.5747 ns | 1,776.326 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 1024 | 1,825.100 ns | 36.4056 ns | 68.3786 ns | 1,792.576 ns | 1.03 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 2048 | 3,532.782 ns | 15.0793 ns | 13.3674 ns | 3,533.941 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 2048 | 4,264.741 ns | 85.1196 ns | 207.1929 ns | 4,304.190 ns | 1.18 | 0.07 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 4096 | 7,293.178 ns | 144.5093 ns | 307.9610 ns | 7,130.396 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 4096 | 8,783.656 ns | 252.4283 ns | 744.2904 ns | 8,849.936 ns | 1.18 | 0.10 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 8192 | 14,100.054 ns | 51.6807 ns | 48.3422 ns | 14,090.756 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 8192 | 14,046.596 ns | 51.0810 ns | 42.6550 ns | 14,043.178 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 16384 | 28,099.603 ns | 173.2258 ns | 162.0355 ns | 28,026.727 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 16384 | 28,120.424 ns | 185.9701 ns | 145.1932 ns | 28,132.475 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 32768 | 56,662.055 ns | 777.0712 ns | 606.6861 ns | 56,564.575 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 32768 | 56,011.725 ns | 350.9919 ns | 293.0941 ns | 55,856.506 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 65536 | 113,660.577 ns | 1,531.6562 ns | 2,559.0534 ns | 112,542.786 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 65536 | 112,241.287 ns | 243.4347 ns | 227.7089 ns | 112,286.365 ns | 0.97 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 131072 | 225,908.205 ns | 599.1738 ns | 467.7955 ns | 225,927.820 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | PooledList | 131072 | 227,601.839 ns | 4,023.6698 ns | 3,763.7432 ns | 226,865.747 ns | 1.01 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | PooledList | 850000 | 1,582,789.760 ns | 21,303.7920 ns | 18,885.2567 ns | 1,577,323.242 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | VersionedForEach | List | PooledList | 850000 | 1,664,077.398 ns | 42,919.4063 ns | 124,516.9800 ns | 1,599,284.570 ns | 1.12 | 0.08 | 2 B | 2.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 0 | 3.970 ns | 0.0621 ns | 0.0580 ns | 3.950 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 0 | 3.698 ns | 0.0247 ns | 0.0231 ns | 3.691 ns | 0.93 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 1 | 5.259 ns | 0.0353 ns | 0.0295 ns | 5.255 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 1 | 5.039 ns | 0.0851 ns | 0.0796 ns | 5.020 ns | 0.96 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 2 | 6.904 ns | 0.0501 ns | 0.0419 ns | 6.911 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 2 | 6.440 ns | 0.1260 ns | 0.0984 ns | 6.430 ns | 0.93 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 3 | 8.567 ns | 0.0087 ns | 0.0073 ns | 8.568 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 3 | 8.208 ns | 0.1509 ns | 0.1260 ns | 8.158 ns | 0.96 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 4 | 11.028 ns | 0.1305 ns | 0.1221 ns | 10.974 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 4 | 10.133 ns | 0.1201 ns | 0.1065 ns | 10.182 ns | 0.92 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 5 | 12.580 ns | 0.0143 ns | 0.0127 ns | 12.576 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 5 | 11.299 ns | 0.1078 ns | 0.0842 ns | 11.272 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 6 | 14.986 ns | 0.0576 ns | 0.0539 ns | 15.006 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 6 | 12.754 ns | 0.0489 ns | 0.0457 ns | 12.745 ns | 0.85 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 7 | 16.643 ns | 0.0644 ns | 0.0602 ns | 16.635 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 7 | 14.213 ns | 0.0508 ns | 0.0451 ns | 14.201 ns | 0.85 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 8 | 18.626 ns | 0.2364 ns | 0.1845 ns | 18.583 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 8 | 17.240 ns | 0.3647 ns | 0.3233 ns | 17.230 ns | 0.93 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 9 | 21.199 ns | 0.3213 ns | 0.2683 ns | 21.155 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 9 | 17.922 ns | 0.0993 ns | 0.0929 ns | 17.913 ns | 0.85 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 10 | 21.629 ns | 0.0608 ns | 0.0568 ns | 21.619 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 10 | 19.547 ns | 0.1213 ns | 0.1134 ns | 19.529 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 11 | 23.106 ns | 0.0150 ns | 0.0133 ns | 23.105 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 11 | 20.744 ns | 0.1304 ns | 0.1156 ns | 20.712 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 12 | 25.102 ns | 0.1648 ns | 0.1461 ns | 25.053 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 12 | 22.379 ns | 0.0827 ns | 0.0646 ns | 22.389 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 13 | 26.654 ns | 0.0997 ns | 0.0884 ns | 26.643 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 13 | 23.560 ns | 0.0891 ns | 0.0833 ns | 23.543 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 14 | 28.335 ns | 0.1547 ns | 0.1447 ns | 28.326 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 14 | 25.344 ns | 0.1841 ns | 0.1722 ns | 25.330 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 15 | 30.100 ns | 0.1335 ns | 0.1249 ns | 30.060 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 15 | 26.750 ns | 0.2399 ns | 0.2244 ns | 26.862 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 16 | 31.844 ns | 0.1452 ns | 0.1213 ns | 31.829 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 16 | 28.104 ns | 0.0794 ns | 0.0743 ns | 28.124 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 17 | 33.357 ns | 0.0597 ns | 0.0529 ns | 33.336 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 17 | 29.440 ns | 0.1494 ns | 0.1324 ns | 29.417 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 18 | 35.044 ns | 0.0607 ns | 0.0568 ns | 35.030 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 18 | 30.911 ns | 0.1060 ns | 0.0992 ns | 30.916 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 19 | 37.121 ns | 0.7513 ns | 0.6273 ns | 36.931 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 19 | 32.346 ns | 0.0841 ns | 0.0746 ns | 32.317 ns | 0.87 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 20 | 38.447 ns | 0.0932 ns | 0.0871 ns | 38.450 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 20 | 34.287 ns | 0.2641 ns | 0.2342 ns | 34.184 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 30 | 61.889 ns | 0.1697 ns | 0.1505 ns | 61.884 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 30 | 49.046 ns | 0.0953 ns | 0.0845 ns | 49.051 ns | 0.79 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 32 | 65.466 ns | 0.4431 ns | 0.4145 ns | 65.319 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 32 | 60.715 ns | 0.4172 ns | 0.3902 ns | 60.708 ns | 0.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 36 | 72.866 ns | 0.3567 ns | 0.2978 ns | 72.726 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 36 | 65.051 ns | 0.1252 ns | 0.1046 ns | 65.020 ns | 0.89 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 37 | 75.597 ns | 0.3195 ns | 0.2494 ns | 75.523 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 37 | 66.475 ns | 0.2530 ns | 0.2366 ns | 66.528 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 40 | 80.759 ns | 0.3199 ns | 0.2671 ns | 80.718 ns | 1.00 | 0.00 | - | NA | -| Baseline | VersionedForEach | List | RecyclableList | 40 | 81.291 ns | 0.5024 ns | 0.4700 ns | 81.161 ns | 1.01 | 0.01 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 40 | 71.530 ns | 0.4066 ns | 0.3803 ns | 71.693 ns | 0.88 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 40 | 71.414 ns | 0.5790 ns | 0.5416 ns | 71.294 ns | 0.88 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 50 | 99.816 ns | 0.4537 ns | 0.3789 ns | 99.952 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 50 | 87.417 ns | 0.6406 ns | 0.5992 ns | 87.357 ns | 0.88 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 60 | 115.992 ns | 1.0125 ns | 0.8455 ns | 115.652 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 60 | 102.011 ns | 0.7450 ns | 0.6969 ns | 101.928 ns | 0.88 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 70 | 132.989 ns | 0.5903 ns | 0.5522 ns | 132.996 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 70 | 117.603 ns | 0.3780 ns | 0.3156 ns | 117.497 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 80 | 149.451 ns | 0.3851 ns | 0.3215 ns | 149.447 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 80 | 133.267 ns | 0.2987 ns | 0.2794 ns | 133.162 ns | 0.89 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 90 | 167.282 ns | 1.7481 ns | 1.4598 ns | 166.837 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 90 | 144.890 ns | 1.1595 ns | 1.0846 ns | 145.010 ns | 0.87 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 100 | 185.299 ns | 1.6608 ns | 1.5535 ns | 184.837 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 100 | 159.926 ns | 1.0142 ns | 0.8990 ns | 159.666 ns | 0.86 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 128 | 231.879 ns | 0.7997 ns | 0.7480 ns | 231.647 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 128 | 207.422 ns | 1.1795 ns | 1.0456 ns | 207.111 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 256 | 449.530 ns | 1.2971 ns | 1.0831 ns | 449.234 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 256 | 405.314 ns | 1.1871 ns | 0.9913 ns | 405.506 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 512 | 885.864 ns | 1.6311 ns | 1.4459 ns | 885.790 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 512 | 800.319 ns | 3.0087 ns | 2.8144 ns | 799.416 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 1024 | 1,756.501 ns | 6.5592 ns | 6.1355 ns | 1,754.186 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 1024 | 1,587.746 ns | 3.6591 ns | 3.0555 ns | 1,587.691 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 2048 | 3,500.671 ns | 10.6725 ns | 9.9830 ns | 3,498.656 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 2048 | 3,027.481 ns | 6.4349 ns | 5.7044 ns | 3,027.135 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 4096 | 7,005.156 ns | 21.9654 ns | 19.4717 ns | 6,999.719 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 4096 | 6,369.114 ns | 23.6503 ns | 22.1225 ns | 6,372.867 ns | 0.91 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 8192 | 14,029.178 ns | 57.5448 ns | 51.0119 ns | 14,022.577 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 8192 | 12,686.859 ns | 21.2945 ns | 18.8770 ns | 12,688.882 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 16384 | 28,901.182 ns | 535.1923 ns | 500.6192 ns | 29,047.418 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableList | 16384 | 24,076.728 ns | 55.7596 ns | 52.1575 ns | 24,056.700 ns | 0.83 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 32768 | 55,884.292 ns | 151.2645 ns | 141.4929 ns | 55,834.592 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableList | 32768 | 48,089.367 ns | 115.6123 ns | 108.1438 ns | 48,102.243 ns | 0.86 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 65536 | 111,826.643 ns | 298.9380 ns | 279.6268 ns | 111,823.712 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableList | 65536 | 96,053.915 ns | 304.9875 ns | 285.2855 ns | 96,019.458 ns | 0.86 | 0.00 | 1 B | 0.50 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 131072 | 222,706.154 ns | 228.2825 ns | 202.3665 ns | 222,666.797 ns | 1.00 | 0.00 | 3 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableList | 131072 | 201,764.692 ns | 366.2813 ns | 342.6197 ns | 201,802.710 ns | 0.91 | 0.00 | 3 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableList | 850000 | 1,548,234.675 ns | 3,936.0544 ns | 3,286.7837 ns | 1,547,516.992 ns | 1.00 | 0.00 | 13 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableList | 850000 | 1,391,042.746 ns | 3,695.1426 ns | 3,275.6477 ns | 1,390,745.801 ns | 0.90 | 0.00 | 13 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 0 | 3.892 ns | 0.0148 ns | 0.0138 ns | 3.887 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 0 | 9.195 ns | 0.0173 ns | 0.0144 ns | 9.192 ns | 2.36 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 1 | 5.705 ns | 0.1444 ns | 0.1827 ns | 5.598 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 1 | 13.761 ns | 0.1153 ns | 0.1022 ns | 13.743 ns | 2.38 | 0.08 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 2 | 7.425 ns | 0.1245 ns | 0.1103 ns | 7.397 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 2 | 18.689 ns | 0.3886 ns | 0.4772 ns | 18.674 ns | 2.51 | 0.08 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 3 | 9.111 ns | 0.0666 ns | 0.0556 ns | 9.087 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 3 | 21.205 ns | 0.2487 ns | 0.2077 ns | 21.150 ns | 2.33 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 4 | 11.537 ns | 0.2177 ns | 0.3258 ns | 11.430 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 4 | 26.664 ns | 0.5420 ns | 0.5070 ns | 26.367 ns | 2.32 | 0.09 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 5 | 12.928 ns | 0.0483 ns | 0.0429 ns | 12.929 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 5 | 28.802 ns | 0.4856 ns | 0.4055 ns | 28.648 ns | 2.23 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 6 | 15.460 ns | 0.0850 ns | 0.0710 ns | 15.460 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 6 | 32.974 ns | 0.5162 ns | 0.4310 ns | 32.935 ns | 2.13 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 7 | 17.443 ns | 0.3691 ns | 0.4394 ns | 17.203 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 7 | 36.249 ns | 0.1810 ns | 0.1605 ns | 36.207 ns | 2.06 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 8 | 18.841 ns | 0.0582 ns | 0.0545 ns | 18.821 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 8 | 42.655 ns | 0.0629 ns | 0.0557 ns | 42.640 ns | 2.26 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 9 | 20.517 ns | 0.0983 ns | 0.0821 ns | 20.526 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 9 | 43.668 ns | 0.2121 ns | 0.1656 ns | 43.622 ns | 2.13 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 10 | 22.881 ns | 0.4856 ns | 0.8245 ns | 22.553 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 10 | 48.475 ns | 0.7929 ns | 0.8143 ns | 48.224 ns | 2.10 | 0.10 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 11 | 23.744 ns | 0.2731 ns | 0.2280 ns | 23.666 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 11 | 52.220 ns | 1.0756 ns | 1.0061 ns | 51.834 ns | 2.20 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 12 | 25.488 ns | 0.1728 ns | 0.1349 ns | 25.474 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 12 | 55.805 ns | 1.1427 ns | 1.6019 ns | 55.199 ns | 2.19 | 0.07 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 13 | 27.620 ns | 0.5020 ns | 0.8248 ns | 27.260 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 13 | 59.417 ns | 1.1487 ns | 1.1281 ns | 59.065 ns | 2.13 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 14 | 29.092 ns | 0.4776 ns | 0.4690 ns | 28.971 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 14 | 62.957 ns | 0.5410 ns | 0.4517 ns | 62.894 ns | 2.16 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 15 | 30.958 ns | 0.2021 ns | 0.1578 ns | 30.915 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 15 | 74.870 ns | 0.2460 ns | 0.2181 ns | 74.813 ns | 2.42 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 16 | 32.522 ns | 0.1811 ns | 0.1694 ns | 32.450 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 16 | 84.531 ns | 0.2799 ns | 0.2337 ns | 84.556 ns | 2.60 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 17 | 34.320 ns | 0.3562 ns | 0.2974 ns | 34.276 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 17 | 82.366 ns | 0.1660 ns | 0.1386 ns | 82.364 ns | 2.40 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 18 | 36.846 ns | 0.7708 ns | 1.6920 ns | 35.953 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 18 | 87.370 ns | 1.1269 ns | 0.9989 ns | 87.418 ns | 2.34 | 0.12 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 19 | 38.133 ns | 0.7924 ns | 0.8479 ns | 37.688 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 19 | 91.029 ns | 1.0657 ns | 1.0944 ns | 90.832 ns | 2.39 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 20 | 38.930 ns | 0.2271 ns | 0.1773 ns | 38.943 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 20 | 93.896 ns | 0.2301 ns | 0.2152 ns | 93.971 ns | 2.41 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 30 | 64.492 ns | 1.0191 ns | 1.0009 ns | 64.187 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 30 | 131.506 ns | 0.2769 ns | 0.2455 ns | 131.484 ns | 2.04 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 32 | 66.829 ns | 0.3134 ns | 0.2446 ns | 66.740 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 32 | 150.896 ns | 0.4918 ns | 0.4360 ns | 150.773 ns | 2.26 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 36 | 73.890 ns | 0.1679 ns | 0.1311 ns | 73.896 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 36 | 161.593 ns | 1.8099 ns | 1.6044 ns | 161.146 ns | 2.19 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 37 | 76.400 ns | 1.4287 ns | 1.1930 ns | 75.961 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 37 | 166.064 ns | 1.3873 ns | 1.2298 ns | 166.015 ns | 2.17 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 40 | 81.358 ns | 1.6145 ns | 1.5857 ns | 80.539 ns | 1.00 | 0.00 | - | NA | -| Baseline | VersionedForEach | List | RecyclableLongList | 40 | 80.915 ns | 0.2279 ns | 0.2020 ns | 80.946 ns | 0.99 | 0.02 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 40 | 177.865 ns | 3.2432 ns | 3.4702 ns | 176.419 ns | 2.19 | 0.07 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 40 | 182.822 ns | 3.7111 ns | 9.0334 ns | 178.670 ns | 2.27 | 0.11 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 50 | 98.457 ns | 1.6879 ns | 1.4963 ns | 97.915 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 50 | 214.826 ns | 0.9471 ns | 0.7909 ns | 214.598 ns | 2.18 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 60 | 115.088 ns | 1.4579 ns | 1.2924 ns | 114.847 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 60 | 254.172 ns | 0.8529 ns | 0.7978 ns | 254.217 ns | 2.21 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 70 | 134.907 ns | 2.7435 ns | 4.2713 ns | 132.610 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 70 | 296.318 ns | 3.1690 ns | 2.6463 ns | 295.252 ns | 2.16 | 0.09 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 80 | 148.501 ns | 2.3051 ns | 1.9249 ns | 147.798 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 80 | 333.637 ns | 1.8319 ns | 1.6239 ns | 333.909 ns | 2.25 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 90 | 164.902 ns | 0.4841 ns | 0.4528 ns | 164.677 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 90 | 369.672 ns | 1.0978 ns | 1.0269 ns | 369.473 ns | 2.24 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 100 | 182.416 ns | 0.8974 ns | 0.8394 ns | 181.986 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 100 | 410.274 ns | 2.9707 ns | 2.4807 ns | 409.657 ns | 2.25 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 128 | 230.809 ns | 1.7505 ns | 1.4618 ns | 230.290 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 128 | 555.014 ns | 7.4810 ns | 6.6317 ns | 552.155 ns | 2.41 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 256 | 449.877 ns | 4.7384 ns | 3.9568 ns | 448.399 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 256 | 1,090.100 ns | 17.6323 ns | 13.7662 ns | 1,086.062 ns | 2.42 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 512 | 885.586 ns | 3.7142 ns | 3.1015 ns | 885.514 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 512 | 2,160.387 ns | 21.7008 ns | 19.2372 ns | 2,156.652 ns | 2.44 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 1024 | 1,773.035 ns | 8.2086 ns | 7.2767 ns | 1,772.021 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 1024 | 4,299.115 ns | 17.5837 ns | 16.4478 ns | 4,300.156 ns | 2.42 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 2048 | 3,513.094 ns | 9.0646 ns | 8.4790 ns | 3,511.880 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 2048 | 8,551.012 ns | 33.2680 ns | 31.1189 ns | 8,548.759 ns | 2.43 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 4096 | 7,080.465 ns | 63.2332 ns | 56.0546 ns | 7,079.928 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 4096 | 17,419.122 ns | 280.6403 ns | 402.4859 ns | 17,277.155 ns | 2.46 | 0.08 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 8192 | 14,297.834 ns | 169.8077 ns | 181.6923 ns | 14,285.627 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 8192 | 34,212.709 ns | 197.9302 ns | 154.5309 ns | 34,152.783 ns | 2.39 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 16384 | 27,984.034 ns | 65.8523 ns | 58.3764 ns | 27,978.502 ns | 1.00 | 0.00 | - | NA | -| Actual | VersionedForEach | List | RecyclableLongList | 16384 | 61,165.138 ns | 120.0942 ns | 106.4603 ns | 61,160.236 ns | 2.19 | 0.00 | 1 B | NA | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 32768 | 56,134.698 ns | 385.7995 ns | 322.1600 ns | 56,012.927 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableLongList | 32768 | 123,321.451 ns | 1,148.3178 ns | 1,017.9538 ns | 123,617.908 ns | 2.19 | 0.02 | 2 B | 2.00 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 65536 | 112,527.010 ns | 548.6837 ns | 486.3938 ns | 112,364.050 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableLongList | 65536 | 250,991.432 ns | 4,112.0996 ns | 5,200.4893 ns | 249,156.201 ns | 2.24 | 0.07 | 3 B | 1.50 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 131072 | 229,755.196 ns | 4,559.9314 ns | 4,879.0755 ns | 228,871.570 ns | 1.00 | 0.00 | 3 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableLongList | 131072 | 493,550.419 ns | 2,642.8752 ns | 2,342.8400 ns | 493,029.688 ns | 2.15 | 0.05 | 7 B | 2.33 | -| | | | | | | | | | | | | | -| Baseline | VersionedForEach | List | RecyclableLongList | 850000 | 1,569,324.137 ns | 8,203.2766 ns | 6,404.5788 ns | 1,568,688.574 ns | 1.00 | 0.00 | 13 B | 1.00 | -| Actual | VersionedForEach | List | RecyclableLongList | 850000 | 3,152,306.941 ns | 9,076.8563 ns | 7,579.5861 ns | 3,149,392.188 ns | 2.01 | 0.01 | 27 B | 2.08 | -
- -# `IndexOf` Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.1702) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.203 - [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 -``` -
-IndexOf Benchmark Results - click to expand - -| Method | TestCase | BaselineBenchmarkType | BenchmarkType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | -|--------- |--------------------- |---------------------- |------------------- |---------------- |----------------------:|---------------------:|-------------------:|----------------------:|------:|------------:|-----------:|------------:| -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 1 | 16.60 ns | 0.060 ns | 0.056 ns | 16.57 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 1 | 19.20 ns | 0.137 ns | 0.121 ns | 19.16 ns | 1.16 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 2 | 27.64 ns | 0.188 ns | 0.176 ns | 27.65 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 2 | 31.90 ns | 0.102 ns | 0.095 ns | 31.89 ns | 1.15 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 3 | 28.35 ns | 0.146 ns | 0.137 ns | 28.42 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 3 | 32.63 ns | 0.177 ns | 0.166 ns | 32.55 ns | 1.15 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 4 | 39.05 ns | 0.112 ns | 0.105 ns | 38.99 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 4 | 44.01 ns | 0.168 ns | 0.149 ns | 43.98 ns | 1.13 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 5 | 39.77 ns | 0.163 ns | 0.152 ns | 39.69 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 5 | 46.72 ns | 0.943 ns | 1.258 ns | 46.87 ns | 1.17 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 6 | 51.14 ns | 0.202 ns | 0.189 ns | 51.10 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 6 | 59.75 ns | 1.076 ns | 1.105 ns | 59.75 ns | 1.17 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 7 | 51.60 ns | 0.126 ns | 0.105 ns | 51.58 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 7 | 58.40 ns | 1.125 ns | 0.997 ns | 58.38 ns | 1.13 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 8 | 61.22 ns | 0.301 ns | 0.281 ns | 61.22 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 8 | 73.96 ns | 0.397 ns | 0.372 ns | 73.98 ns | 1.21 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 9 | 62.21 ns | 0.074 ns | 0.062 ns | 62.22 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 9 | 96.22 ns | 0.712 ns | 0.631 ns | 96.16 ns | 1.55 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 10 | 75.18 ns | 0.244 ns | 0.228 ns | 75.07 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 10 | 83.85 ns | 0.224 ns | 0.209 ns | 83.74 ns | 1.12 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 11 | 74.93 ns | 0.214 ns | 0.200 ns | 74.86 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 11 | 83.78 ns | 0.484 ns | 0.453 ns | 83.53 ns | 1.12 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 12 | 86.86 ns | 0.316 ns | 0.295 ns | 86.88 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 12 | 106.61 ns | 1.246 ns | 1.224 ns | 106.88 ns | 1.23 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 13 | 88.02 ns | 0.273 ns | 0.255 ns | 87.90 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 13 | 96.74 ns | 0.074 ns | 0.066 ns | 96.73 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 14 | 100.74 ns | 0.344 ns | 0.322 ns | 100.79 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 14 | 110.46 ns | 0.359 ns | 0.336 ns | 110.27 ns | 1.10 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 15 | 100.67 ns | 0.405 ns | 0.359 ns | 100.55 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 15 | 127.81 ns | 1.472 ns | 1.305 ns | 128.04 ns | 1.27 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 16 | 114.05 ns | 0.520 ns | 0.486 ns | 113.75 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 16 | 141.99 ns | 0.510 ns | 0.477 ns | 141.82 ns | 1.24 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 17 | 114.63 ns | 0.432 ns | 0.404 ns | 114.41 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 17 | 125.91 ns | 0.363 ns | 0.322 ns | 125.79 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 18 | 127.90 ns | 0.404 ns | 0.378 ns | 128.07 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 18 | 140.47 ns | 0.452 ns | 0.423 ns | 140.24 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 19 | 128.56 ns | 0.375 ns | 0.350 ns | 128.41 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 19 | 152.84 ns | 1.948 ns | 1.822 ns | 152.48 ns | 1.19 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 20 | 150.88 ns | 0.538 ns | 0.477 ns | 150.97 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 20 | 184.59 ns | 0.871 ns | 0.772 ns | 184.61 ns | 1.22 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 30 | 217.63 ns | 0.967 ns | 0.905 ns | 217.71 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 30 | 244.89 ns | 1.417 ns | 1.326 ns | 244.56 ns | 1.13 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 32 | 266.32 ns | 2.378 ns | 2.224 ns | 266.71 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 32 | 310.60 ns | 1.946 ns | 1.820 ns | 310.93 ns | 1.17 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 40 | 362.07 ns | 2.741 ns | 2.564 ns | 362.60 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 40 | 401.02 ns | 1.604 ns | 1.500 ns | 400.31 ns | 1.11 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 50 | 400.35 ns | 3.445 ns | 3.223 ns | 400.41 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 50 | 485.05 ns | 3.031 ns | 2.531 ns | 485.54 ns | 1.21 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 60 | 582.48 ns | 4.689 ns | 4.386 ns | 581.95 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 60 | 664.89 ns | 3.413 ns | 3.192 ns | 663.75 ns | 1.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 80 | 845.29 ns | 7.416 ns | 6.937 ns | 843.90 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 80 | 915.71 ns | 5.696 ns | 5.328 ns | 916.91 ns | 1.08 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 90 | 994.91 ns | 15.228 ns | 14.244 ns | 998.73 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 90 | 1,074.04 ns | 12.721 ns | 11.277 ns | 1,077.75 ns | 1.08 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 100 | 1,130.91 ns | 20.393 ns | 19.076 ns | 1,130.99 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 100 | 1,185.56 ns | 23.173 ns | 21.676 ns | 1,184.10 ns | 1.05 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 128 | 1,610.08 ns | 16.899 ns | 15.807 ns | 1,604.90 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 128 | 1,753.55 ns | 17.254 ns | 16.140 ns | 1,752.63 ns | 1.09 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 256 | 5,750.75 ns | 28.609 ns | 26.760 ns | 5,758.04 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 256 | 5,893.43 ns | 29.453 ns | 27.551 ns | 5,887.99 ns | 1.02 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 512 | 21,669.95 ns | 427.575 ns | 399.954 ns | 21,713.08 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 512 | 21,674.73 ns | 68.941 ns | 64.487 ns | 21,668.86 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 1024 | 69,740.31 ns | 838.846 ns | 932.375 ns | 69,475.32 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 1024 | 68,980.90 ns | 450.707 ns | 421.591 ns | 68,923.79 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 2048 | 244,266.95 ns | 2,449.277 ns | 2,045.257 ns | 243,462.06 ns | 1.00 | 0.00 | - | NA | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 2048 | 239,887.40 ns | 854.306 ns | 799.118 ns | 240,015.48 ns | 0.98 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 4096 | 904,644.52 ns | 3,379.464 ns | 2,638.463 ns | 904,380.27 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 4096 | 915,459.26 ns | 6,529.766 ns | 6,107.947 ns | 917,327.34 ns | 1.01 | 0.01 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 8192 | 3,513,716.89 ns | 62,893.465 ns | 90,199.928 ns | 3,474,476.56 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 8192 | 3,486,690.89 ns | 14,705.600 ns | 13,755.627 ns | 3,481,303.91 ns | 0.99 | 0.02 | 2 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 16384 | 13,736,865.85 ns | 120,702.128 ns | 106,999.292 ns | 13,714,744.53 ns | 1.00 | 0.00 | 9 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 16384 | 14,167,800.31 ns | 43,856.428 ns | 41,023.330 ns | 14,149,225.00 ns | 1.03 | 0.01 | 9 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 32768 | 53,875,332.00 ns | 245,220.180 ns | 229,379.108 ns | 53,809,450.00 ns | 1.00 | 0.00 | 60 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 32768 | 55,149,804.00 ns | 273,037.835 ns | 255,399.760 ns | 55,076,500.00 ns | 1.02 | 0.01 | 60 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 65536 | 218,431,663.33 ns | 4,265,864.273 ns | 4,912,575.640 ns | 214,920,550.00 ns | 1.00 | 0.00 | 200 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 65536 | 217,449,610.26 ns | 493,374.080 ns | 411,989.702 ns | 217,368,133.33 ns | 1.01 | 0.02 | 200 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 131072 | 936,350,615.38 ns | 2,290,617.990 ns | 1,912,769.764 ns | 936,031,100.00 ns | 1.00 | 0.00 | 600 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 131072 | 928,423,416.67 ns | 1,034,931.818 ns | 808,006.689 ns | 928,198,750.00 ns | 0.99 | 0.00 | 600 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 849999 | 99,588,892,028.57 ns | 998,348,445.797 ns | 885,009,893.256 ns | 99,218,977,100.00 ns | 1.00 | 0.00 | 600 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 849999 | 102,323,847,080.00 ns | 1,028,672,431.300 ns | 962,220,830.472 ns | 101,982,058,200.00 ns | 1.03 | 0.01 | 600 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 850000 | 113.8 s | 2.26 s | 2.69 s | | 1.00 | 0.00 | 600 B | 1.00 | -| Actual | Index(...)Cases [25] | List | RecyclableLongList | 850000 | 110.3 s | 2.11 s | 2.07 s | | 0.97 | 0.03 | 399750776 B | 666,251.29 | -
- -# `this[]` Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.306 - [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 -``` -
-this[] Getter Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | -|--------- |--------- |------------- |------------------- |---------------- |-----------------:|---------------:|---------------:|-----------------:|------:|--------:|----------:|------------:| -| Baseline | GetItem | List | Array | 0 | 5.087 ns | 0.0177 ns | 0.0157 ns | 5.085 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 0 | 4.232 ns | 0.0134 ns | 0.0125 ns | 4.232 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 1 | 5.814 ns | 0.0043 ns | 0.0034 ns | 5.814 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 1 | 7.195 ns | 0.1698 ns | 0.2789 ns | 7.262 ns | 1.23 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 2 | 7.122 ns | 0.1548 ns | 0.1373 ns | 7.046 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 2 | 8.713 ns | 0.2006 ns | 0.2878 ns | 8.817 ns | 1.21 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 3 | 8.253 ns | 0.0434 ns | 0.0362 ns | 8.235 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 3 | 7.972 ns | 0.0277 ns | 0.0231 ns | 7.960 ns | 0.97 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 4 | 9.629 ns | 0.0470 ns | 0.0439 ns | 9.612 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 4 | 9.416 ns | 0.0899 ns | 0.0702 ns | 9.398 ns | 0.98 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 5 | 11.944 ns | 0.1798 ns | 0.1682 ns | 11.949 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 5 | 12.661 ns | 0.2729 ns | 0.3352 ns | 12.701 ns | 1.06 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 6 | 13.660 ns | 0.2059 ns | 0.1926 ns | 13.606 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 6 | 14.335 ns | 0.3136 ns | 0.2780 ns | 14.320 ns | 1.05 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 7 | 15.777 ns | 0.1703 ns | 0.1593 ns | 15.740 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 7 | 16.908 ns | 0.3714 ns | 0.4562 ns | 16.826 ns | 1.07 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 8 | 18.534 ns | 0.2159 ns | 0.2020 ns | 18.550 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 8 | 17.109 ns | 0.1688 ns | 0.1497 ns | 17.061 ns | 0.92 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 9 | 16.745 ns | 0.0188 ns | 0.0157 ns | 16.744 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 9 | 16.313 ns | 0.0334 ns | 0.0279 ns | 16.319 ns | 0.97 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 10 | 18.750 ns | 0.2487 ns | 0.1942 ns | 18.733 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 10 | 19.209 ns | 0.2345 ns | 0.2193 ns | 19.172 ns | 1.02 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 11 | 19.802 ns | 0.0520 ns | 0.0406 ns | 19.791 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 11 | 20.647 ns | 0.1615 ns | 0.1511 ns | 20.655 ns | 1.04 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 12 | 21.204 ns | 0.0376 ns | 0.0333 ns | 21.200 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 12 | 21.812 ns | 0.1413 ns | 0.1322 ns | 21.879 ns | 1.03 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 13 | 22.591 ns | 0.0196 ns | 0.0153 ns | 22.594 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 13 | 20.918 ns | 0.0383 ns | 0.0320 ns | 20.906 ns | 0.93 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 14 | 24.049 ns | 0.0488 ns | 0.0433 ns | 24.038 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 14 | 23.721 ns | 0.2652 ns | 0.2481 ns | 23.762 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 15 | 25.572 ns | 0.0272 ns | 0.0254 ns | 25.573 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 15 | 24.800 ns | 0.2831 ns | 0.2648 ns | 24.774 ns | 0.97 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 16 | 26.961 ns | 0.0356 ns | 0.0316 ns | 26.949 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 16 | 24.586 ns | 0.0611 ns | 0.0541 ns | 24.577 ns | 0.91 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 17 | 28.492 ns | 0.0728 ns | 0.0681 ns | 28.482 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 17 | 27.441 ns | 0.3655 ns | 0.3419 ns | 27.516 ns | 0.96 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 18 | 29.978 ns | 0.2612 ns | 0.2443 ns | 29.972 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 18 | 28.647 ns | 0.1871 ns | 0.1751 ns | 28.674 ns | 0.96 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 19 | 31.480 ns | 0.1982 ns | 0.1854 ns | 31.510 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 19 | 28.104 ns | 0.1097 ns | 0.1026 ns | 28.054 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 20 | 32.807 ns | 0.0663 ns | 0.0621 ns | 32.789 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 20 | 29.494 ns | 0.1506 ns | 0.1408 ns | 29.467 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 30 | 47.366 ns | 0.0892 ns | 0.0745 ns | 47.352 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 30 | 43.030 ns | 0.1955 ns | 0.1829 ns | 42.994 ns | 0.91 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 32 | 57.594 ns | 0.6630 ns | 0.6201 ns | 57.568 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 32 | 53.214 ns | 0.2239 ns | 0.1870 ns | 53.207 ns | 0.92 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 36 | 62.153 ns | 0.0910 ns | 0.0710 ns | 62.142 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 36 | 57.604 ns | 0.4924 ns | 0.4606 ns | 57.458 ns | 0.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 37 | 63.696 ns | 0.2617 ns | 0.2448 ns | 63.735 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 37 | 59.404 ns | 0.1440 ns | 0.1276 ns | 59.410 ns | 0.93 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 40 | 68.221 ns | 0.1968 ns | 0.1841 ns | 68.141 ns | 1.00 | 0.00 | - | NA | -| Baseline | GetItem | List | Array | 40 | 68.066 ns | 0.0598 ns | 0.0499 ns | 68.045 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 40 | 63.406 ns | 0.6025 ns | 0.5341 ns | 63.211 ns | 0.93 | 0.01 | - | NA | -| Actual | GetItem | List | Array | 40 | 63.601 ns | 0.4482 ns | 0.4193 ns | 63.531 ns | 0.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 50 | 82.718 ns | 0.5956 ns | 0.5571 ns | 82.387 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 50 | 74.547 ns | 0.2905 ns | 0.2718 ns | 74.573 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 60 | 96.421 ns | 0.0519 ns | 0.0433 ns | 96.410 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 60 | 85.857 ns | 0.2068 ns | 0.1834 ns | 85.801 ns | 0.89 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 70 | 112.740 ns | 0.7200 ns | 0.6735 ns | 112.641 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 70 | 101.227 ns | 0.4075 ns | 0.3612 ns | 101.190 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 80 | 129.546 ns | 1.9844 ns | 1.7591 ns | 129.675 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 80 | 115.180 ns | 0.9878 ns | 0.9240 ns | 115.047 ns | 0.89 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 90 | 147.359 ns | 2.9076 ns | 2.7198 ns | 147.580 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 90 | 124.477 ns | 0.4122 ns | 0.3856 ns | 124.388 ns | 0.84 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 100 | 156.162 ns | 0.3327 ns | 0.3112 ns | 156.075 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 100 | 136.660 ns | 0.2034 ns | 0.1903 ns | 136.679 ns | 0.88 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 128 | 196.667 ns | 0.6222 ns | 0.5820 ns | 196.618 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 128 | 170.684 ns | 0.4582 ns | 0.4286 ns | 170.689 ns | 0.87 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 256 | 382.457 ns | 1.3733 ns | 1.2846 ns | 381.805 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 256 | 323.661 ns | 1.1383 ns | 1.0647 ns | 323.394 ns | 0.85 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 512 | 755.104 ns | 2.3256 ns | 2.1753 ns | 756.165 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 512 | 631.467 ns | 1.2068 ns | 1.0698 ns | 631.219 ns | 0.84 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 1024 | 1,498.234 ns | 2.7609 ns | 2.4475 ns | 1,497.659 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 1024 | 1,246.530 ns | 1.6971 ns | 1.5875 ns | 1,246.584 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 2048 | 2,981.924 ns | 7.2251 ns | 6.4049 ns | 2,979.765 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 2048 | 2,477.137 ns | 5.4560 ns | 4.8366 ns | 2,476.553 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 4096 | 5,954.708 ns | 9.8748 ns | 9.2369 ns | 5,954.871 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 4096 | 4,933.807 ns | 8.7286 ns | 8.1648 ns | 4,934.590 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 8192 | 11,904.955 ns | 36.3822 ns | 32.2519 ns | 11,905.228 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 8192 | 9,851.273 ns | 20.8854 ns | 19.5362 ns | 9,845.271 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 16384 | 23,781.046 ns | 43.5231 ns | 36.3438 ns | 23,769.757 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 16384 | 19,668.344 ns | 27.3351 ns | 22.8260 ns | 19,665.826 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 32768 | 47,508.092 ns | 87.7922 ns | 82.1209 ns | 47,492.511 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 32768 | 39,421.193 ns | 92.0761 ns | 86.1280 ns | 39,445.734 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 65536 | 95,220.745 ns | 156.8450 ns | 139.0390 ns | 95,246.021 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 65536 | 78,557.533 ns | 216.2659 ns | 191.7141 ns | 78,526.147 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 131072 | 190,923.184 ns | 652.4912 ns | 610.3407 ns | 190,601.953 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | Array | 131072 | 157,503.108 ns | 633.5713 ns | 561.6444 ns | 157,280.652 ns | 0.83 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | Array | 850000 | 1,312,717.285 ns | 4,791.6643 ns | 4,247.6856 ns | 1,311,580.078 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | GetItem | List | Array | 850000 | 1,019,788.542 ns | 3,424.5043 ns | 3,203.2835 ns | 1,017,995.508 ns | 0.78 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 0 | 4.117 ns | 0.0070 ns | 0.0066 ns | 4.115 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 0 | 4.119 ns | 0.0057 ns | 0.0048 ns | 4.119 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 1 | 5.825 ns | 0.0081 ns | 0.0076 ns | 5.821 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 1 | 5.825 ns | 0.0115 ns | 0.0096 ns | 5.827 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 2 | 7.168 ns | 0.1676 ns | 0.2119 ns | 7.072 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 2 | 7.480 ns | 0.1789 ns | 0.3735 ns | 7.391 ns | 1.03 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 3 | 8.307 ns | 0.0384 ns | 0.0340 ns | 8.303 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 3 | 8.340 ns | 0.1233 ns | 0.1093 ns | 8.285 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 4 | 10.137 ns | 0.2287 ns | 0.3423 ns | 10.359 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 4 | 9.653 ns | 0.0598 ns | 0.0499 ns | 9.635 ns | 0.95 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 5 | 11.171 ns | 0.0370 ns | 0.0289 ns | 11.158 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 5 | 11.174 ns | 0.0436 ns | 0.0364 ns | 11.157 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 6 | 12.544 ns | 0.0204 ns | 0.0191 ns | 12.544 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 6 | 12.538 ns | 0.0176 ns | 0.0156 ns | 12.543 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 7 | 13.975 ns | 0.0346 ns | 0.0324 ns | 13.968 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 7 | 13.980 ns | 0.0405 ns | 0.0338 ns | 13.964 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 8 | 15.676 ns | 0.1732 ns | 0.1620 ns | 15.616 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 8 | 15.500 ns | 0.1084 ns | 0.0961 ns | 15.459 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 9 | 16.861 ns | 0.0587 ns | 0.0520 ns | 16.855 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 9 | 16.850 ns | 0.0381 ns | 0.0297 ns | 16.842 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 10 | 18.294 ns | 0.0538 ns | 0.0477 ns | 18.297 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 10 | 18.267 ns | 0.0683 ns | 0.0605 ns | 18.235 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 11 | 19.683 ns | 0.0245 ns | 0.0191 ns | 19.680 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 11 | 19.666 ns | 0.0256 ns | 0.0214 ns | 19.661 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 12 | 21.111 ns | 0.0237 ns | 0.0198 ns | 21.107 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 12 | 21.213 ns | 0.0288 ns | 0.0269 ns | 21.205 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 13 | 22.598 ns | 0.0774 ns | 0.0724 ns | 22.640 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 13 | 22.572 ns | 0.0645 ns | 0.0572 ns | 22.547 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 14 | 23.998 ns | 0.0388 ns | 0.0324 ns | 23.994 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 14 | 24.114 ns | 0.1768 ns | 0.1654 ns | 23.989 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 15 | 25.598 ns | 0.1708 ns | 0.1598 ns | 25.679 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 15 | 25.522 ns | 0.0816 ns | 0.0763 ns | 25.531 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 16 | 26.972 ns | 0.0606 ns | 0.0567 ns | 26.975 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 16 | 26.907 ns | 0.0739 ns | 0.0655 ns | 26.877 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 17 | 28.509 ns | 0.1739 ns | 0.1627 ns | 28.462 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 17 | 28.473 ns | 0.0705 ns | 0.0625 ns | 28.461 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 18 | 29.861 ns | 0.0414 ns | 0.0367 ns | 29.849 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 18 | 29.962 ns | 0.0770 ns | 0.0683 ns | 29.977 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 19 | 31.301 ns | 0.0757 ns | 0.0671 ns | 31.294 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 19 | 31.314 ns | 0.0390 ns | 0.0326 ns | 31.311 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 20 | 32.772 ns | 0.0438 ns | 0.0366 ns | 32.775 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 20 | 32.755 ns | 0.0465 ns | 0.0412 ns | 32.742 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 30 | 47.182 ns | 0.0429 ns | 0.0381 ns | 47.183 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 30 | 47.291 ns | 0.1582 ns | 0.1480 ns | 47.246 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 32 | 57.025 ns | 0.8559 ns | 0.8006 ns | 56.924 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 32 | 57.772 ns | 0.5754 ns | 0.5382 ns | 57.897 ns | 1.01 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 36 | 61.567 ns | 0.0479 ns | 0.0374 ns | 61.573 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 36 | 62.487 ns | 0.0577 ns | 0.0540 ns | 62.475 ns | 1.01 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 37 | 63.278 ns | 0.1242 ns | 0.1101 ns | 63.273 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 37 | 63.194 ns | 0.0406 ns | 0.0339 ns | 63.190 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 40 | 68.423 ns | 0.1422 ns | 0.1260 ns | 68.409 ns | 1.00 | 0.00 | - | NA | -| Baseline | GetItem | List | PooledList | 40 | 67.996 ns | 0.1221 ns | 0.1083 ns | 67.986 ns | 0.99 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 40 | 67.655 ns | 0.1196 ns | 0.1119 ns | 67.650 ns | 0.99 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 40 | 68.598 ns | 0.0818 ns | 0.0725 ns | 68.575 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 50 | 82.089 ns | 0.3763 ns | 0.3520 ns | 81.961 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 50 | 81.547 ns | 0.1177 ns | 0.0983 ns | 81.516 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 60 | 95.908 ns | 0.0945 ns | 0.0789 ns | 95.912 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 60 | 96.614 ns | 0.0965 ns | 0.0806 ns | 96.602 ns | 1.01 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 70 | 110.347 ns | 0.0897 ns | 0.0839 ns | 110.350 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 70 | 110.410 ns | 0.1133 ns | 0.1060 ns | 110.399 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 80 | 124.762 ns | 0.1451 ns | 0.1287 ns | 124.716 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 80 | 125.374 ns | 0.8244 ns | 0.7711 ns | 124.923 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 850000 | 1,354,564.314 ns | 27,077.9151 ns | 24,003.8665 ns | 1,347,315.918 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | GetItem | List | PooledList | 850000 | 1,326,081.070 ns | 6,365.8240 ns | 5,315.7514 ns | 1,327,350.977 ns | 0.98 | 0.02 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 90 | 139.951 ns | 0.9460 ns | 0.8849 ns | 139.496 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 90 | 139.727 ns | 0.2896 ns | 0.2568 ns | 139.645 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 100 | 154.239 ns | 0.4053 ns | 0.3791 ns | 154.060 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 100 | 154.055 ns | 0.0729 ns | 0.0682 ns | 154.040 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 128 | 194.694 ns | 0.4205 ns | 0.3934 ns | 194.532 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 128 | 194.594 ns | 0.2835 ns | 0.2652 ns | 194.535 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 256 | 379.100 ns | 0.3344 ns | 0.2792 ns | 379.071 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 256 | 380.014 ns | 1.2398 ns | 1.1597 ns | 379.366 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 512 | 747.765 ns | 0.9277 ns | 0.7747 ns | 748.063 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 512 | 748.483 ns | 0.3634 ns | 0.2837 ns | 748.391 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 1024 | 1,488.274 ns | 8.3175 ns | 7.7802 ns | 1,486.584 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 1024 | 1,482.692 ns | 2.8880 ns | 2.5601 ns | 1,482.041 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 2048 | 2,950.451 ns | 2.8768 ns | 2.4022 ns | 2,949.803 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 2048 | 2,950.227 ns | 2.2722 ns | 1.8974 ns | 2,950.386 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 4096 | 5,915.946 ns | 28.4765 ns | 26.6369 ns | 5,898.267 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 4096 | 5,900.795 ns | 19.5014 ns | 17.2875 ns | 5,890.962 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 8192 | 11,780.438 ns | 15.4387 ns | 12.0535 ns | 11,775.958 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 8192 | 11,800.539 ns | 50.7679 ns | 45.0044 ns | 11,778.336 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 16384 | 23,558.218 ns | 39.3738 ns | 34.9038 ns | 23,547.809 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 16384 | 23,645.565 ns | 151.1512 ns | 141.3869 ns | 23,578.395 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 32768 | 47,322.243 ns | 281.7861 ns | 263.5829 ns | 47,229.657 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 32768 | 47,980.978 ns | 272.9394 ns | 255.3077 ns | 47,993.085 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 65536 | 95,987.704 ns | 330.8700 ns | 309.4960 ns | 95,971.948 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 65536 | 97,397.487 ns | 529.5201 ns | 495.3135 ns | 97,361.578 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | PooledList | 131072 | 198,227.028 ns | 3,922.3737 ns | 3,668.9908 ns | 196,667.847 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | PooledList | 131072 | 192,520.435 ns | 865.3927 ns | 809.4889 ns | 192,155.615 ns | 0.97 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 0 | 5.085 ns | 0.0236 ns | 0.0197 ns | 5.080 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 0 | 4.599 ns | 0.0061 ns | 0.0047 ns | 4.600 ns | 0.90 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 1 | 5.274 ns | 0.0054 ns | 0.0048 ns | 5.273 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 1 | 5.280 ns | 0.0305 ns | 0.0286 ns | 5.291 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 2 | 6.722 ns | 0.0140 ns | 0.0117 ns | 6.722 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 2 | 6.715 ns | 0.0227 ns | 0.0212 ns | 6.709 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 3 | 8.195 ns | 0.0120 ns | 0.0101 ns | 8.196 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 3 | 8.150 ns | 0.0181 ns | 0.0151 ns | 8.149 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 4 | 9.606 ns | 0.0201 ns | 0.0179 ns | 9.599 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 4 | 9.585 ns | 0.0228 ns | 0.0213 ns | 9.575 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 5 | 11.149 ns | 0.0717 ns | 0.0599 ns | 11.125 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 5 | 12.228 ns | 0.1114 ns | 0.1042 ns | 12.222 ns | 1.10 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 6 | 12.548 ns | 0.0161 ns | 0.0143 ns | 12.547 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 6 | 12.488 ns | 0.0234 ns | 0.0207 ns | 12.484 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 7 | 13.947 ns | 0.0128 ns | 0.0113 ns | 13.946 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 7 | 15.282 ns | 0.0590 ns | 0.0523 ns | 15.296 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 8 | 16.790 ns | 0.0271 ns | 0.0254 ns | 16.792 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 8 | 16.042 ns | 0.0416 ns | 0.0389 ns | 16.050 ns | 0.96 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 9 | 17.513 ns | 0.0537 ns | 0.0502 ns | 17.507 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 9 | 17.584 ns | 0.0616 ns | 0.0576 ns | 17.607 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 10 | 18.919 ns | 0.0365 ns | 0.0323 ns | 18.915 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 10 | 18.762 ns | 0.0227 ns | 0.0201 ns | 18.765 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 11 | 20.308 ns | 0.0576 ns | 0.0510 ns | 20.308 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 11 | 20.207 ns | 0.0531 ns | 0.0471 ns | 20.189 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 12 | 21.734 ns | 0.0816 ns | 0.0763 ns | 21.704 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 12 | 21.670 ns | 0.0323 ns | 0.0270 ns | 21.669 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 13 | 23.181 ns | 0.0650 ns | 0.0543 ns | 23.169 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 13 | 23.064 ns | 0.0344 ns | 0.0287 ns | 23.073 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 14 | 24.619 ns | 0.1182 ns | 0.1106 ns | 24.554 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 14 | 24.519 ns | 0.0463 ns | 0.0387 ns | 24.516 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 15 | 26.005 ns | 0.0487 ns | 0.0381 ns | 25.990 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 15 | 25.846 ns | 0.0358 ns | 0.0299 ns | 25.833 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 16 | 27.394 ns | 0.0714 ns | 0.0668 ns | 27.361 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 16 | 27.284 ns | 0.0207 ns | 0.0173 ns | 27.285 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 17 | 28.792 ns | 0.0231 ns | 0.0205 ns | 28.788 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 17 | 28.791 ns | 0.1407 ns | 0.1317 ns | 28.724 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 18 | 30.166 ns | 0.0363 ns | 0.0303 ns | 30.159 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 18 | 30.282 ns | 0.2122 ns | 0.1985 ns | 30.179 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 19 | 31.688 ns | 0.0499 ns | 0.0442 ns | 31.675 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 19 | 31.597 ns | 0.0369 ns | 0.0288 ns | 31.597 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 20 | 33.054 ns | 0.0457 ns | 0.0405 ns | 33.041 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 20 | 33.021 ns | 0.0292 ns | 0.0228 ns | 33.016 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 30 | 47.640 ns | 0.1029 ns | 0.0912 ns | 47.667 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 30 | 47.383 ns | 0.0397 ns | 0.0331 ns | 47.385 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 32 | 57.208 ns | 0.4838 ns | 0.4525 ns | 57.237 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 32 | 56.609 ns | 0.1218 ns | 0.1080 ns | 56.608 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 36 | 61.133 ns | 0.2587 ns | 0.2293 ns | 61.073 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 36 | 61.769 ns | 0.1004 ns | 0.0939 ns | 61.821 ns | 1.01 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 37 | 62.414 ns | 0.1317 ns | 0.1100 ns | 62.406 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 37 | 62.584 ns | 0.0700 ns | 0.0620 ns | 62.594 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 40 | 68.118 ns | 0.1447 ns | 0.1354 ns | 68.122 ns | 1.00 | 0.00 | - | NA | -| Baseline | GetItem | List | RecyclableList | 40 | 68.463 ns | 0.1350 ns | 0.1197 ns | 68.425 ns | 1.01 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 40 | 67.786 ns | 0.2085 ns | 0.1849 ns | 67.760 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 40 | 67.491 ns | 0.0914 ns | 0.0810 ns | 67.458 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 50 | 81.537 ns | 0.1361 ns | 0.1206 ns | 81.526 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 50 | 82.324 ns | 0.1428 ns | 0.1335 ns | 82.324 ns | 1.01 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 60 | 97.050 ns | 0.0760 ns | 0.0593 ns | 97.036 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 60 | 98.003 ns | 0.3562 ns | 0.3332 ns | 97.851 ns | 1.01 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 70 | 111.475 ns | 0.1881 ns | 0.1760 ns | 111.486 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 70 | 109.756 ns | 0.1914 ns | 0.1791 ns | 109.753 ns | 0.98 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 80 | 124.764 ns | 0.1937 ns | 0.1812 ns | 124.764 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 80 | 124.409 ns | 0.2905 ns | 0.2717 ns | 124.451 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 90 | 139.293 ns | 0.1760 ns | 0.1646 ns | 139.286 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 90 | 139.193 ns | 0.1773 ns | 0.1481 ns | 139.212 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 100 | 152.969 ns | 0.2109 ns | 0.1761 ns | 152.943 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 100 | 152.321 ns | 0.1998 ns | 0.1668 ns | 152.244 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 128 | 193.298 ns | 0.3859 ns | 0.3610 ns | 193.127 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 128 | 194.086 ns | 0.1932 ns | 0.1613 ns | 194.017 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 256 | 377.865 ns | 1.2921 ns | 1.2087 ns | 377.181 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 256 | 377.518 ns | 1.4666 ns | 1.3719 ns | 376.818 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 512 | 746.404 ns | 2.2184 ns | 2.0751 ns | 746.010 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 512 | 745.610 ns | 1.1743 ns | 0.9806 ns | 745.053 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 1024 | 1,479.600 ns | 1.2165 ns | 1.0158 ns | 1,479.302 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 1024 | 1,480.707 ns | 1.9632 ns | 1.7403 ns | 1,480.032 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 2048 | 2,958.204 ns | 10.9250 ns | 9.6847 ns | 2,954.479 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 2048 | 2,950.894 ns | 4.0534 ns | 3.5932 ns | 2,949.265 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 4096 | 5,894.618 ns | 4.8885 ns | 4.3335 ns | 5,893.645 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 4096 | 5,892.491 ns | 6.0143 ns | 4.6955 ns | 5,891.155 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 8192 | 11,778.814 ns | 13.8052 ns | 10.7782 ns | 11,773.432 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 8192 | 11,806.300 ns | 25.0434 ns | 23.4256 ns | 11,798.613 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 16384 | 23,686.530 ns | 51.3596 ns | 48.0418 ns | 23,661.995 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableList | 16384 | 23,757.159 ns | 158.5130 ns | 148.2732 ns | 23,694.806 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 32768 | 47,500.045 ns | 49.8326 ns | 46.6134 ns | 47,493.164 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | GetItem | List | RecyclableList | 32768 | 47,516.522 ns | 250.4994 ns | 234.3173 ns | 47,379.025 ns | 1.00 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 65536 | 94,967.463 ns | 437.7486 ns | 409.4703 ns | 94,752.344 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | GetItem | List | RecyclableList | 65536 | 94,393.466 ns | 153.9536 ns | 128.5582 ns | 94,378.235 ns | 0.99 | 0.01 | 2 B | 2.00 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 131072 | 189,674.316 ns | 614.7607 ns | 513.3531 ns | 189,466.650 ns | 1.00 | 0.00 | 3 B | 1.00 | -| Actual | GetItem | List | RecyclableList | 131072 | 189,207.023 ns | 327.4955 ns | 290.3162 ns | 189,054.089 ns | 1.00 | 0.00 | 2 B | 0.67 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableList | 850000 | 1,307,223.870 ns | 3,683.7814 ns | 3,265.5763 ns | 1,306,491.016 ns | 1.00 | 0.00 | 25 B | 1.00 | -| Actual | GetItem | List | RecyclableList | 850000 | 1,304,507.917 ns | 6,212.3585 ns | 5,811.0440 ns | 1,303,131.641 ns | 1.00 | 0.00 | 13 B | 0.52 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 0 | 4.112 ns | 0.0057 ns | 0.0045 ns | 4.112 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 0 | 4.223 ns | 0.0110 ns | 0.0103 ns | 4.226 ns | 1.03 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 1 | 5.266 ns | 0.0086 ns | 0.0081 ns | 5.265 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 1 | 5.521 ns | 0.0103 ns | 0.0097 ns | 5.519 ns | 1.05 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 2 | 6.753 ns | 0.0705 ns | 0.0625 ns | 6.750 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 2 | 7.217 ns | 0.0464 ns | 0.0411 ns | 7.193 ns | 1.07 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 3 | 8.137 ns | 0.0116 ns | 0.0097 ns | 8.137 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 3 | 8.903 ns | 0.0135 ns | 0.0105 ns | 8.903 ns | 1.09 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 4 | 9.820 ns | 0.2233 ns | 0.2193 ns | 9.685 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 4 | 10.604 ns | 0.0489 ns | 0.0434 ns | 10.606 ns | 1.08 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 5 | 11.133 ns | 0.0284 ns | 0.0237 ns | 11.129 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 5 | 12.244 ns | 0.0196 ns | 0.0163 ns | 12.245 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 6 | 12.677 ns | 0.1375 ns | 0.1286 ns | 12.715 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 6 | 13.930 ns | 0.0193 ns | 0.0161 ns | 13.930 ns | 1.10 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 7 | 14.129 ns | 0.1588 ns | 0.1485 ns | 14.125 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 7 | 15.614 ns | 0.0219 ns | 0.0194 ns | 15.606 ns | 1.11 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 8 | 16.617 ns | 0.2342 ns | 0.2190 ns | 16.638 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 8 | 17.294 ns | 0.0177 ns | 0.0165 ns | 17.293 ns | 1.04 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 9 | 17.509 ns | 0.0326 ns | 0.0272 ns | 17.517 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 9 | 19.082 ns | 0.0857 ns | 0.0802 ns | 19.090 ns | 1.09 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 10 | 18.892 ns | 0.0508 ns | 0.0450 ns | 18.888 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 10 | 20.767 ns | 0.0418 ns | 0.0391 ns | 20.775 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 11 | 20.391 ns | 0.0607 ns | 0.0568 ns | 20.379 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 11 | 22.497 ns | 0.0267 ns | 0.0237 ns | 22.502 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 12 | 21.825 ns | 0.0927 ns | 0.0867 ns | 21.798 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 12 | 24.147 ns | 0.1502 ns | 0.1405 ns | 24.095 ns | 1.11 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 13 | 23.246 ns | 0.0808 ns | 0.0716 ns | 23.267 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 13 | 25.689 ns | 0.0190 ns | 0.0159 ns | 25.681 ns | 1.10 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 14 | 24.643 ns | 0.0978 ns | 0.0915 ns | 24.653 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 14 | 27.515 ns | 0.1318 ns | 0.1233 ns | 27.472 ns | 1.12 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 15 | 25.970 ns | 0.0522 ns | 0.0436 ns | 25.953 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 15 | 29.022 ns | 0.0610 ns | 0.0509 ns | 29.024 ns | 1.12 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 16 | 27.393 ns | 0.0110 ns | 0.0098 ns | 27.395 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 16 | 30.788 ns | 0.0274 ns | 0.0229 ns | 30.794 ns | 1.12 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 17 | 28.958 ns | 0.0263 ns | 0.0246 ns | 28.950 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 17 | 32.607 ns | 0.0340 ns | 0.0284 ns | 32.608 ns | 1.13 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 18 | 30.409 ns | 0.0726 ns | 0.0679 ns | 30.382 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 18 | 34.341 ns | 0.0637 ns | 0.0565 ns | 34.325 ns | 1.13 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 19 | 31.874 ns | 0.0591 ns | 0.0494 ns | 31.878 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 19 | 36.036 ns | 0.2199 ns | 0.2057 ns | 35.994 ns | 1.13 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 20 | 33.260 ns | 0.1194 ns | 0.1116 ns | 33.276 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 20 | 37.555 ns | 0.1829 ns | 0.1527 ns | 37.509 ns | 1.13 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 30 | 47.583 ns | 0.1002 ns | 0.0782 ns | 47.549 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 30 | 54.365 ns | 0.1154 ns | 0.0963 ns | 54.343 ns | 1.14 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 32 | 58.103 ns | 0.5050 ns | 0.4723 ns | 57.943 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 32 | 64.688 ns | 0.4897 ns | 0.4581 ns | 64.627 ns | 1.11 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 36 | 61.619 ns | 0.3959 ns | 0.3703 ns | 61.606 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 36 | 70.398 ns | 0.1161 ns | 0.0969 ns | 70.421 ns | 1.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 37 | 63.308 ns | 0.1311 ns | 0.1162 ns | 63.293 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 37 | 71.494 ns | 0.1497 ns | 0.1400 ns | 71.492 ns | 1.13 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 40 | 67.560 ns | 0.3628 ns | 0.3216 ns | 67.570 ns | 1.00 | 0.00 | - | NA | -| Baseline | GetItem | List | RecyclableLongList | 40 | 67.491 ns | 0.3148 ns | 0.2791 ns | 67.545 ns | 1.00 | 0.01 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 40 | 77.774 ns | 0.0789 ns | 0.0659 ns | 77.765 ns | 1.15 | 0.01 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 40 | 77.104 ns | 0.3463 ns | 0.3240 ns | 76.935 ns | 1.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 50 | 81.792 ns | 0.2041 ns | 0.1593 ns | 81.743 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 50 | 93.817 ns | 0.4548 ns | 0.4254 ns | 93.567 ns | 1.15 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 60 | 97.014 ns | 0.6810 ns | 0.6370 ns | 96.785 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 60 | 110.467 ns | 0.2460 ns | 0.2180 ns | 110.366 ns | 1.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 70 | 110.847 ns | 0.3054 ns | 0.2857 ns | 110.753 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 70 | 127.364 ns | 0.1797 ns | 0.1501 ns | 127.334 ns | 1.15 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 80 | 125.678 ns | 0.7599 ns | 0.7108 ns | 125.640 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 80 | 144.256 ns | 0.6348 ns | 0.5938 ns | 143.939 ns | 1.15 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 850000 | 1,311,320.417 ns | 4,379.8630 ns | 4,096.9266 ns | 1,312,105.078 ns | 1.00 | 0.00 | 25 B | 1.00 | -| Actual | GetItem | List | RecyclableLongList | 850000 | 1,525,118.770 ns | 5,882.0910 ns | 5,502.1116 ns | 1,524,297.949 ns | 1.16 | 0.00 | 25 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 90 | 139.942 ns | 0.3684 ns | 0.3446 ns | 139.905 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 90 | 161.519 ns | 0.4139 ns | 0.3231 ns | 161.579 ns | 1.15 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 100 | 154.718 ns | 0.9467 ns | 0.8856 ns | 154.611 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 100 | 177.538 ns | 0.3023 ns | 0.2525 ns | 177.482 ns | 1.15 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 128 | 195.013 ns | 0.6922 ns | 0.6474 ns | 194.905 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 128 | 224.850 ns | 0.5712 ns | 0.4770 ns | 224.749 ns | 1.15 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 256 | 380.907 ns | 0.6343 ns | 0.5934 ns | 380.787 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 256 | 441.945 ns | 0.4077 ns | 0.3614 ns | 442.131 ns | 1.16 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 512 | 751.199 ns | 0.9536 ns | 0.8920 ns | 751.228 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 512 | 875.576 ns | 1.4739 ns | 1.3787 ns | 875.572 ns | 1.17 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 1024 | 1,492.466 ns | 2.5022 ns | 2.3406 ns | 1,491.752 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 1024 | 1,747.504 ns | 3.1965 ns | 2.9900 ns | 1,747.231 ns | 1.17 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 2048 | 2,969.723 ns | 6.2703 ns | 5.8652 ns | 2,967.258 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 2048 | 3,472.481 ns | 5.6621 ns | 5.2963 ns | 3,470.974 ns | 1.17 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 4096 | 5,940.363 ns | 7.1239 ns | 6.3151 ns | 5,939.664 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 4096 | 6,960.118 ns | 16.1488 ns | 15.1056 ns | 6,958.694 ns | 1.17 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 8192 | 11,866.370 ns | 18.7284 ns | 15.6391 ns | 11,867.043 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 8192 | 13,881.169 ns | 31.8584 ns | 29.8004 ns | 13,876.588 ns | 1.17 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 16384 | 23,727.698 ns | 115.5709 ns | 108.1051 ns | 23,667.245 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 16384 | 27,590.594 ns | 28.8522 ns | 22.5259 ns | 27,592.171 ns | 1.16 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 32768 | 47,279.877 ns | 74.6557 ns | 62.3409 ns | 47,266.443 ns | 1.00 | 0.00 | - | NA | -| Actual | GetItem | List | RecyclableLongList | 32768 | 55,343.465 ns | 263.3131 ns | 246.3032 ns | 55,241.559 ns | 1.17 | 0.00 | 1 B | NA | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 65536 | 95,354.230 ns | 324.4000 ns | 303.4440 ns | 95,391.040 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | GetItem | List | RecyclableLongList | 65536 | 111,175.301 ns | 711.9269 ns | 665.9368 ns | 110,790.015 ns | 1.17 | 0.01 | 2 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | GetItem | List | RecyclableLongList | 131072 | 190,302.858 ns | 259.6908 ns | 202.7495 ns | 190,348.962 ns | 1.00 | 0.00 | 3 B | 1.00 | -| Actual | GetItem | List | RecyclableLongList | 131072 | 221,654.380 ns | 593.1635 ns | 495.3184 ns | 221,454.614 ns | 1.16 | 0.00 | 3 B | 1.00 | - -
- -
-this[] Setter Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | -|--------- |--------- |------------- |------------------- |---------------- |-----------------:|---------------:|---------------:|-----------------:|------:|--------:|----------:|------------:| -| Baseline | SetItem | List | PooledList | 0 | 5.103 ns | 0.0171 ns | 0.0160 ns | 5.105 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 0 | 5.100 ns | 0.0237 ns | 0.0210 ns | 5.093 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 1 | 5.050 ns | 0.0284 ns | 0.0266 ns | 5.044 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 1 | 5.095 ns | 0.0802 ns | 0.0750 ns | 5.051 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 2 | 6.183 ns | 0.0384 ns | 0.0320 ns | 6.178 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 2 | 6.156 ns | 0.0085 ns | 0.0071 ns | 6.157 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 3 | 7.723 ns | 0.0139 ns | 0.0130 ns | 7.724 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 3 | 7.713 ns | 0.0390 ns | 0.0346 ns | 7.712 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 4 | 8.871 ns | 0.0244 ns | 0.0216 ns | 8.874 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 4 | 8.862 ns | 0.0164 ns | 0.0153 ns | 8.859 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 5 | 9.909 ns | 0.0681 ns | 0.0637 ns | 9.907 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 5 | 9.960 ns | 0.1300 ns | 0.1216 ns | 9.944 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 6 | 10.948 ns | 0.1666 ns | 0.1558 ns | 10.907 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 6 | 10.824 ns | 0.0642 ns | 0.0601 ns | 10.803 ns | 0.99 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 7 | 12.308 ns | 0.2760 ns | 0.4377 ns | 12.159 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 7 | 12.070 ns | 0.1569 ns | 0.1468 ns | 12.050 ns | 0.97 | 0.05 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 8 | 12.704 ns | 0.1175 ns | 0.1099 ns | 12.740 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 8 | 12.701 ns | 0.1207 ns | 0.1129 ns | 12.654 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 9 | 14.148 ns | 0.2327 ns | 0.2177 ns | 14.029 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 9 | 13.977 ns | 0.0509 ns | 0.0476 ns | 13.961 ns | 0.99 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 10 | 15.826 ns | 0.2243 ns | 0.1988 ns | 15.751 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 10 | 15.798 ns | 0.1065 ns | 0.0996 ns | 15.807 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 11 | 17.334 ns | 0.1308 ns | 0.1223 ns | 17.270 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 11 | 17.217 ns | 0.0460 ns | 0.0408 ns | 17.204 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 12 | 18.936 ns | 0.0664 ns | 0.0621 ns | 18.938 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 12 | 18.917 ns | 0.0310 ns | 0.0275 ns | 18.910 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 13 | 20.818 ns | 0.2407 ns | 0.2252 ns | 20.783 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 13 | 21.113 ns | 0.2407 ns | 0.2251 ns | 21.110 ns | 1.01 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 14 | 22.505 ns | 0.1524 ns | 0.1351 ns | 22.495 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 14 | 23.010 ns | 0.3177 ns | 0.2816 ns | 22.993 ns | 1.02 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 15 | 24.641 ns | 0.3720 ns | 0.3297 ns | 24.599 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 15 | 24.129 ns | 0.1323 ns | 0.1237 ns | 24.112 ns | 0.98 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 16 | 25.918 ns | 0.1618 ns | 0.1434 ns | 25.937 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 16 | 25.986 ns | 0.2334 ns | 0.2184 ns | 25.933 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 17 | 27.805 ns | 0.2277 ns | 0.2129 ns | 27.831 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 17 | 27.481 ns | 0.1161 ns | 0.1029 ns | 27.499 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 18 | 29.440 ns | 0.2658 ns | 0.2220 ns | 29.446 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 18 | 29.930 ns | 0.6224 ns | 0.6392 ns | 29.754 ns | 1.02 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 19 | 31.452 ns | 0.5389 ns | 0.4500 ns | 31.469 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 19 | 31.310 ns | 0.4873 ns | 0.4319 ns | 31.131 ns | 1.00 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 20 | 32.811 ns | 0.2576 ns | 0.2283 ns | 32.714 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 20 | 32.725 ns | 0.2172 ns | 0.2032 ns | 32.697 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 30 | 49.587 ns | 0.2819 ns | 0.2201 ns | 49.549 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 30 | 49.570 ns | 0.2785 ns | 0.2469 ns | 49.567 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 32 | 52.885 ns | 0.2549 ns | 0.2385 ns | 52.811 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 32 | 52.853 ns | 0.3732 ns | 0.3491 ns | 52.681 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 36 | 58.842 ns | 0.2818 ns | 0.2498 ns | 58.796 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 36 | 59.101 ns | 0.5022 ns | 0.4194 ns | 59.028 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 37 | 60.554 ns | 0.1693 ns | 0.1414 ns | 60.561 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 37 | 60.666 ns | 0.2363 ns | 0.2210 ns | 60.598 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 40 | 65.960 ns | 0.3043 ns | 0.2697 ns | 65.884 ns | 1.00 | 0.00 | - | NA | -| Baseline | SetItem | List | PooledList | 40 | 66.048 ns | 0.2830 ns | 0.2209 ns | 66.168 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 40 | 66.043 ns | 0.2166 ns | 0.1920 ns | 66.094 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 40 | 66.877 ns | 0.2354 ns | 0.2087 ns | 66.909 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 50 | 83.433 ns | 0.2620 ns | 0.2046 ns | 83.396 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 50 | 84.313 ns | 0.8985 ns | 0.8405 ns | 84.081 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 60 | 102.372 ns | 1.3392 ns | 1.1183 ns | 102.158 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 60 | 101.079 ns | 0.1732 ns | 0.1535 ns | 101.096 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 70 | 118.242 ns | 0.3427 ns | 0.3038 ns | 118.176 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 70 | 118.983 ns | 1.2317 ns | 1.0918 ns | 118.424 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 80 | 135.922 ns | 0.2631 ns | 0.2054 ns | 135.988 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 80 | 136.791 ns | 1.4803 ns | 1.3846 ns | 136.196 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 90 | 153.854 ns | 0.5985 ns | 0.5598 ns | 153.819 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 90 | 153.641 ns | 0.8821 ns | 0.7366 ns | 153.721 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 100 | 175.565 ns | 3.3769 ns | 4.1471 ns | 175.703 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 100 | 172.267 ns | 0.7617 ns | 0.6361 ns | 172.520 ns | 0.98 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 128 | 225.628 ns | 3.1487 ns | 2.9453 ns | 224.846 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 128 | 220.946 ns | 0.3092 ns | 0.2741 ns | 220.977 ns | 0.98 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 256 | 445.129 ns | 0.8922 ns | 0.8345 ns | 445.147 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 256 | 447.566 ns | 3.3103 ns | 2.9345 ns | 447.040 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 512 | 903.438 ns | 5.6756 ns | 4.7394 ns | 902.990 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 512 | 906.238 ns | 7.9669 ns | 7.0625 ns | 905.876 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 1024 | 1,814.556 ns | 14.5947 ns | 12.9378 ns | 1,813.487 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 1024 | 1,811.492 ns | 12.6903 ns | 11.2496 ns | 1,808.885 ns | 1.00 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 2048 | 3,602.719 ns | 17.9662 ns | 16.8056 ns | 3,594.394 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 2048 | 3,652.575 ns | 45.6346 ns | 42.6867 ns | 3,632.915 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 4096 | 7,198.960 ns | 15.2979 ns | 11.9436 ns | 7,198.082 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 4096 | 7,270.793 ns | 37.8028 ns | 33.5112 ns | 7,280.167 ns | 1.01 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 8192 | 14,484.956 ns | 69.2892 ns | 57.8596 ns | 14,481.416 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 8192 | 15,262.408 ns | 301.1303 ns | 721.4890 ns | 15,298.782 ns | 1.09 | 0.06 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 16384 | 29,742.475 ns | 589.9692 ns | 1,205.1507 ns | 29,057.147 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 16384 | 29,035.933 ns | 194.1147 ns | 172.0776 ns | 29,000.674 ns | 0.96 | 0.04 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 32768 | 58,708.778 ns | 260.4952 ns | 243.6674 ns | 58,758.472 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 32768 | 58,345.286 ns | 255.4219 ns | 226.4248 ns | 58,264.194 ns | 0.99 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 65536 | 117,017.933 ns | 370.1307 ns | 346.2205 ns | 116,882.086 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 65536 | 117,071.260 ns | 376.4902 ns | 314.3864 ns | 117,026.349 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 131072 | 239,911.071 ns | 4,723.9668 ns | 5,974.3055 ns | 235,766.846 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | PooledList | 131072 | 233,139.014 ns | 398.5584 ns | 372.8117 ns | 233,199.683 ns | 0.96 | 0.02 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | PooledList | 850000 | 1,614,054.311 ns | 1,881.5120 ns | 1,667.9114 ns | 1,614,055.957 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | SetItem | List | PooledList | 850000 | 1,636,356.362 ns | 1,904.0917 ns | 1,687.9277 ns | 1,635,736.133 ns | 1.01 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 0 | 4.156 ns | 0.0040 ns | 0.0033 ns | 4.156 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 0 | 4.161 ns | 0.0079 ns | 0.0062 ns | 4.162 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 1 | 5.042 ns | 0.0171 ns | 0.0143 ns | 5.035 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 1 | 4.720 ns | 0.0313 ns | 0.0293 ns | 4.701 ns | 0.94 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 2 | 6.141 ns | 0.0361 ns | 0.0338 ns | 6.131 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 2 | 5.807 ns | 0.0400 ns | 0.0375 ns | 5.819 ns | 0.95 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 3 | 7.664 ns | 0.0277 ns | 0.0259 ns | 7.656 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 3 | 7.001 ns | 0.0324 ns | 0.0303 ns | 6.992 ns | 0.91 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 4 | 8.861 ns | 0.0120 ns | 0.0113 ns | 8.862 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 4 | 8.193 ns | 0.0374 ns | 0.0350 ns | 8.175 ns | 0.92 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 5 | 9.823 ns | 0.0589 ns | 0.0551 ns | 9.817 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 5 | 8.929 ns | 0.0318 ns | 0.0298 ns | 8.935 ns | 0.91 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 6 | 10.710 ns | 0.0528 ns | 0.0494 ns | 10.690 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 6 | 9.779 ns | 0.0509 ns | 0.0476 ns | 9.797 ns | 0.91 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 7 | 11.510 ns | 0.0509 ns | 0.0477 ns | 11.537 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 7 | 10.224 ns | 0.0155 ns | 0.0129 ns | 10.224 ns | 0.89 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 8 | 12.455 ns | 0.1109 ns | 0.1038 ns | 12.464 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 8 | 11.120 ns | 0.0525 ns | 0.0491 ns | 11.120 ns | 0.89 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 9 | 13.854 ns | 0.0651 ns | 0.0609 ns | 13.864 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 9 | 11.899 ns | 0.0302 ns | 0.0283 ns | 11.888 ns | 0.86 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 10 | 15.569 ns | 0.0810 ns | 0.0758 ns | 15.537 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 10 | 12.573 ns | 0.0439 ns | 0.0410 ns | 12.567 ns | 0.81 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 11 | 17.148 ns | 0.0811 ns | 0.0758 ns | 17.151 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 11 | 13.365 ns | 0.0561 ns | 0.0525 ns | 13.377 ns | 0.78 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 12 | 18.848 ns | 0.0419 ns | 0.0372 ns | 18.854 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 12 | 14.158 ns | 0.0200 ns | 0.0187 ns | 14.151 ns | 0.75 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 13 | 20.596 ns | 0.0394 ns | 0.0369 ns | 20.600 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 13 | 14.823 ns | 0.0437 ns | 0.0409 ns | 14.826 ns | 0.72 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 14 | 22.222 ns | 0.0435 ns | 0.0407 ns | 22.226 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 14 | 15.547 ns | 0.0364 ns | 0.0323 ns | 15.545 ns | 0.70 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 15 | 23.967 ns | 0.1462 ns | 0.1367 ns | 23.979 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 15 | 16.288 ns | 0.0467 ns | 0.0390 ns | 16.288 ns | 0.68 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 16 | 25.516 ns | 0.0227 ns | 0.0190 ns | 25.518 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 16 | 17.142 ns | 0.1401 ns | 0.1311 ns | 17.076 ns | 0.67 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 17 | 27.208 ns | 0.0501 ns | 0.0418 ns | 27.207 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 17 | 17.746 ns | 0.1036 ns | 0.0969 ns | 17.727 ns | 0.65 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 18 | 28.856 ns | 0.1391 ns | 0.1301 ns | 28.818 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 18 | 18.452 ns | 0.0529 ns | 0.0469 ns | 18.440 ns | 0.64 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 19 | 30.485 ns | 0.1158 ns | 0.1083 ns | 30.439 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 19 | 19.228 ns | 0.0725 ns | 0.0679 ns | 19.238 ns | 0.63 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 20 | 32.198 ns | 0.1400 ns | 0.1309 ns | 32.177 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 20 | 20.006 ns | 0.0802 ns | 0.0750 ns | 19.984 ns | 0.62 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 30 | 48.866 ns | 0.1972 ns | 0.1844 ns | 48.786 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 30 | 27.271 ns | 0.1413 ns | 0.1322 ns | 27.330 ns | 0.56 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 32 | 52.267 ns | 0.1993 ns | 0.1865 ns | 52.185 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 32 | 28.790 ns | 0.1928 ns | 0.1804 ns | 28.730 ns | 0.55 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 36 | 59.086 ns | 0.1370 ns | 0.1069 ns | 59.062 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 36 | 32.022 ns | 0.1975 ns | 0.1751 ns | 32.011 ns | 0.54 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 37 | 60.990 ns | 0.1680 ns | 0.1571 ns | 60.938 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 37 | 32.277 ns | 0.2095 ns | 0.1960 ns | 32.182 ns | 0.53 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 40 | 66.020 ns | 0.3297 ns | 0.3084 ns | 65.898 ns | 1.00 | 0.00 | - | NA | -| Baseline | SetItem | List | RecyclableList | 40 | 65.355 ns | 0.2859 ns | 0.2674 ns | 65.212 ns | 0.99 | 0.01 | - | NA | -| Actual | SetItem | List | RecyclableList | 40 | 34.545 ns | 0.2373 ns | 0.2220 ns | 34.543 ns | 0.52 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 40 | 35.101 ns | 0.3045 ns | 0.2848 ns | 35.234 ns | 0.53 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 50 | 83.164 ns | 0.1985 ns | 0.1857 ns | 83.173 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 50 | 41.963 ns | 0.0545 ns | 0.0509 ns | 41.958 ns | 0.50 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 60 | 100.384 ns | 0.1905 ns | 0.1782 ns | 100.371 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 60 | 49.250 ns | 0.2741 ns | 0.2564 ns | 49.215 ns | 0.49 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 70 | 117.084 ns | 0.1740 ns | 0.1543 ns | 117.083 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 70 | 57.215 ns | 0.4810 ns | 0.4264 ns | 57.015 ns | 0.49 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 80 | 134.850 ns | 0.2508 ns | 0.2346 ns | 134.826 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 80 | 63.910 ns | 0.2125 ns | 0.1988 ns | 63.798 ns | 0.47 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 90 | 151.902 ns | 0.3191 ns | 0.2829 ns | 151.926 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 90 | 70.334 ns | 0.1558 ns | 0.1381 ns | 70.312 ns | 0.46 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 100 | 169.898 ns | 0.3010 ns | 0.2668 ns | 169.854 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 100 | 83.242 ns | 0.5769 ns | 0.5114 ns | 83.195 ns | 0.49 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 128 | 218.509 ns | 0.4452 ns | 0.4165 ns | 218.412 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 128 | 102.693 ns | 0.6832 ns | 0.6391 ns | 102.592 ns | 0.47 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 256 | 441.374 ns | 0.5467 ns | 0.4846 ns | 441.315 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 256 | 195.366 ns | 0.5711 ns | 0.4769 ns | 195.342 ns | 0.44 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 512 | 890.019 ns | 1.4326 ns | 1.3401 ns | 889.832 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 512 | 381.412 ns | 0.9534 ns | 0.8919 ns | 381.402 ns | 0.43 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 1024 | 1,784.926 ns | 3.5513 ns | 3.3219 ns | 1,783.905 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 1024 | 756.539 ns | 2.8184 ns | 2.6364 ns | 756.645 ns | 0.42 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 2048 | 3,560.123 ns | 5.8350 ns | 5.4580 ns | 3,559.407 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 2048 | 1,535.637 ns | 3.6021 ns | 3.3694 ns | 1,534.931 ns | 0.43 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 4096 | 7,106.307 ns | 8.0662 ns | 6.7356 ns | 7,104.748 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 4096 | 3,083.148 ns | 16.7197 ns | 14.8216 ns | 3,080.522 ns | 0.43 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 8192 | 14,244.027 ns | 38.1153 ns | 33.7882 ns | 14,224.635 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 8192 | 6,189.434 ns | 121.5271 ns | 153.6929 ns | 6,118.095 ns | 0.44 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 16384 | 28,373.944 ns | 63.4455 ns | 56.2427 ns | 28,378.809 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableList | 16384 | 12,253.457 ns | 41.7170 ns | 36.9810 ns | 12,240.319 ns | 0.43 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 32768 | 57,291.683 ns | 75.8897 ns | 70.9873 ns | 57,264.532 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | SetItem | List | RecyclableList | 32768 | 52,664.990 ns | 1,600.4152 ns | 4,718.8604 ns | 54,821.466 ns | 0.89 | 0.10 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 65536 | 114,542.764 ns | 131.5650 ns | 123.0660 ns | 114,604.321 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | SetItem | List | RecyclableList | 65536 | 104,949.636 ns | 3,246.2519 ns | 9,571.6470 ns | 110,177.533 ns | 0.90 | 0.10 | 2 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 131072 | 227,530.510 ns | 480.6588 ns | 401.3719 ns | 227,454.102 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | SetItem | List | RecyclableList | 131072 | 213,330.067 ns | 5,820.4604 ns | 16,793.3592 ns | 220,374.353 ns | 0.94 | 0.07 | 3 B | 1.50 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableList | 850000 | 1,635,076.510 ns | 12,454.8715 ns | 11,650.2945 ns | 1,630,901.758 ns | 1.00 | 0.00 | 25 B | 1.00 | -| Actual | SetItem | List | RecyclableList | 850000 | 1,558,273.837 ns | 29,608.9837 ns | 35,247.3888 ns | 1,565,659.570 ns | 0.95 | 0.02 | 25 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 0 | 6.542 ns | 0.2424 ns | 0.7148 ns | 6.693 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 0 | 4.594 ns | 0.0255 ns | 0.0239 ns | 4.589 ns | 0.72 | 0.11 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 1 | 5.025 ns | 0.0078 ns | 0.0069 ns | 5.028 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 1 | 5.659 ns | 0.0095 ns | 0.0088 ns | 5.662 ns | 1.13 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 2 | 6.099 ns | 0.0434 ns | 0.0385 ns | 6.109 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 2 | 8.196 ns | 0.0460 ns | 0.0430 ns | 8.200 ns | 1.34 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 3 | 7.644 ns | 0.0388 ns | 0.0344 ns | 7.642 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 3 | 9.213 ns | 0.0131 ns | 0.0109 ns | 9.212 ns | 1.21 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 4 | 8.841 ns | 0.0174 ns | 0.0136 ns | 8.847 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 4 | 10.723 ns | 0.0352 ns | 0.0330 ns | 10.724 ns | 1.21 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 5 | 9.781 ns | 0.0081 ns | 0.0071 ns | 9.781 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 5 | 12.036 ns | 0.0146 ns | 0.0114 ns | 12.035 ns | 1.23 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 6 | 10.708 ns | 0.0249 ns | 0.0233 ns | 10.693 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 6 | 13.773 ns | 0.0395 ns | 0.0350 ns | 13.784 ns | 1.29 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 7 | 11.528 ns | 0.0544 ns | 0.0509 ns | 11.502 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 7 | 14.909 ns | 0.0482 ns | 0.0428 ns | 14.912 ns | 1.29 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 8 | 12.412 ns | 0.0407 ns | 0.0340 ns | 12.421 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 8 | 16.475 ns | 0.0817 ns | 0.0765 ns | 16.487 ns | 1.33 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 9 | 13.806 ns | 0.0766 ns | 0.0717 ns | 13.784 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 9 | 18.070 ns | 0.1220 ns | 0.1141 ns | 18.047 ns | 1.31 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 10 | 15.496 ns | 0.0629 ns | 0.0588 ns | 15.475 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 10 | 19.438 ns | 0.0573 ns | 0.0536 ns | 19.433 ns | 1.25 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 11 | 17.066 ns | 0.0414 ns | 0.0346 ns | 17.053 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 11 | 20.802 ns | 0.1217 ns | 0.1139 ns | 20.796 ns | 1.22 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 12 | 18.804 ns | 0.0796 ns | 0.0744 ns | 18.775 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 12 | 22.465 ns | 0.0750 ns | 0.0702 ns | 22.487 ns | 1.19 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 13 | 20.438 ns | 0.0832 ns | 0.0779 ns | 20.416 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 13 | 23.807 ns | 0.1355 ns | 0.1267 ns | 23.854 ns | 1.16 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 14 | 22.115 ns | 0.0799 ns | 0.0747 ns | 22.076 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 14 | 25.292 ns | 0.1482 ns | 0.1387 ns | 25.347 ns | 1.14 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 15 | 23.781 ns | 0.1056 ns | 0.0988 ns | 23.826 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 15 | 26.799 ns | 0.1866 ns | 0.1745 ns | 26.806 ns | 1.13 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 16 | 25.489 ns | 0.1171 ns | 0.1095 ns | 25.532 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 16 | 28.513 ns | 0.2027 ns | 0.1896 ns | 28.513 ns | 1.12 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 17 | 27.236 ns | 0.0628 ns | 0.0588 ns | 27.210 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 17 | 29.802 ns | 0.0698 ns | 0.0583 ns | 29.778 ns | 1.09 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 18 | 28.953 ns | 0.0871 ns | 0.0815 ns | 28.943 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 18 | 31.238 ns | 0.2010 ns | 0.1881 ns | 31.232 ns | 1.08 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 19 | 30.489 ns | 0.1496 ns | 0.1400 ns | 30.439 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 19 | 32.718 ns | 0.2164 ns | 0.2024 ns | 32.685 ns | 1.07 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 20 | 32.126 ns | 0.0849 ns | 0.0753 ns | 32.095 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 20 | 34.373 ns | 0.1937 ns | 0.1618 ns | 34.393 ns | 1.07 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 30 | 48.850 ns | 0.1431 ns | 0.1339 ns | 48.782 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 30 | 49.625 ns | 0.1209 ns | 0.1131 ns | 49.595 ns | 1.02 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 32 | 52.158 ns | 0.0960 ns | 0.0802 ns | 52.138 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 32 | 52.982 ns | 0.1951 ns | 0.1730 ns | 52.996 ns | 1.02 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 36 | 58.923 ns | 0.0680 ns | 0.0636 ns | 58.932 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 36 | 60.999 ns | 1.2144 ns | 1.4456 ns | 61.677 ns | 1.03 | 0.03 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 37 | 60.981 ns | 0.1422 ns | 0.1330 ns | 60.935 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 37 | 59.821 ns | 0.9038 ns | 0.8454 ns | 60.248 ns | 0.98 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 40 | 65.697 ns | 0.0664 ns | 0.0589 ns | 65.695 ns | 1.00 | 0.00 | - | NA | -| Baseline | SetItem | List | RecyclableLongList | 40 | 66.420 ns | 0.1375 ns | 0.1286 ns | 66.382 ns | 1.01 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 40 | 65.534 ns | 0.4883 ns | 0.4568 ns | 65.506 ns | 1.00 | 0.01 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 40 | 64.957 ns | 0.7585 ns | 0.7095 ns | 65.131 ns | 0.99 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 50 | 82.854 ns | 0.2000 ns | 0.1871 ns | 82.765 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 50 | 82.505 ns | 0.3937 ns | 0.3490 ns | 82.504 ns | 1.00 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 60 | 100.261 ns | 0.1607 ns | 0.1503 ns | 100.299 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 60 | 97.532 ns | 0.6003 ns | 0.5615 ns | 97.518 ns | 0.97 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 70 | 117.551 ns | 0.2649 ns | 0.2478 ns | 117.499 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 70 | 114.466 ns | 0.6859 ns | 0.6416 ns | 114.497 ns | 0.97 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 80 | 135.250 ns | 0.4412 ns | 0.4127 ns | 135.131 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 80 | 129.391 ns | 0.7980 ns | 0.7074 ns | 129.364 ns | 0.96 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 100 | 169.776 ns | 0.1301 ns | 0.1153 ns | 169.760 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 100 | 160.278 ns | 0.9019 ns | 0.8436 ns | 160.288 ns | 0.94 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 128 | 219.352 ns | 0.5782 ns | 0.5408 ns | 219.438 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 128 | 207.590 ns | 0.9508 ns | 0.8893 ns | 207.527 ns | 0.95 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 256 | 441.669 ns | 0.5803 ns | 0.5144 ns | 441.543 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 256 | 409.848 ns | 6.2375 ns | 5.8345 ns | 409.970 ns | 0.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 512 | 888.875 ns | 0.5806 ns | 0.4848 ns | 888.858 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 512 | 801.378 ns | 8.6206 ns | 7.6419 ns | 800.193 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 1024 | 1,781.131 ns | 1.0381 ns | 0.9710 ns | 1,780.862 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 1024 | 1,605.911 ns | 13.8722 ns | 11.5839 ns | 1,608.300 ns | 0.90 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 2048 | 3,569.133 ns | 6.7815 ns | 6.3435 ns | 3,571.936 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 2048 | 3,266.587 ns | 34.6037 ns | 28.8956 ns | 3,271.237 ns | 0.92 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 4096 | 7,109.312 ns | 9.8761 ns | 9.2381 ns | 7,105.371 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 4096 | 6,636.983 ns | 26.9146 ns | 25.1760 ns | 6,632.346 ns | 0.93 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 8192 | 14,233.875 ns | 13.8498 ns | 12.2775 ns | 14,234.982 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 8192 | 13,282.448 ns | 45.6999 ns | 42.7477 ns | 13,279.364 ns | 0.93 | 0.00 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 16384 | 28,503.933 ns | 81.9571 ns | 76.6627 ns | 28,487.123 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 16384 | 26,464.668 ns | 171.8065 ns | 160.7079 ns | 26,460.243 ns | 0.93 | 0.01 | - | NA | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 32768 | 57,326.667 ns | 242.8422 ns | 227.1547 ns | 57,222.314 ns | 1.00 | 0.00 | 1 B | 1.00 | -| Actual | SetItem | List | RecyclableLongList | 32768 | 55,355.616 ns | 93.1621 ns | 77.7946 ns | 55,332.666 ns | 0.97 | 0.00 | 1 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 65536 | 114,002.581 ns | 131.1817 ns | 122.7074 ns | 113,951.843 ns | 1.00 | 0.00 | 2 B | 1.00 | -| Actual | SetItem | List | RecyclableLongList | 65536 | 109,114.963 ns | 466.7859 ns | 389.7874 ns | 109,180.310 ns | 0.96 | 0.00 | 2 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 131072 | 227,937.367 ns | 282.4864 ns | 250.4168 ns | 227,909.534 ns | 1.00 | 0.00 | 3 B | 1.00 | -| Actual | SetItem | List | RecyclableLongList | 131072 | 221,966.255 ns | 644.8796 ns | 603.2207 ns | 222,073.511 ns | 0.97 | 0.00 | 3 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 850000 | 1,626,362.142 ns | 5,010.4787 ns | 3,911.8522 ns | 1,625,986.523 ns | 1.00 | 0.00 | 25 B | 1.00 | -| Actual | SetItem | List | RecyclableLongList | 850000 | 1,584,812.005 ns | 12,789.2487 ns | 11,963.0712 ns | 1,585,505.859 ns | 0.98 | 0.01 | 25 B | 1.00 | -| | | | | | | | | | | | | | -| Baseline | SetItem | List | RecyclableLongList | 90 | 152.769 ns | 0.3186 ns | 0.2980 ns | 152.770 ns | 1.00 | 0.00 | - | NA | -| Actual | SetItem | List | RecyclableLongList | 90 | 145.514 ns | 1.2202 ns | 1.1413 ns | 145.627 ns | 0.95 | 0.01 | - | NA | -
- -# `RemoveAt` Benchmarks -## Environment -```csharp -BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) -AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores -.NET SDK=7.0.306 - [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 - DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 -``` -
-RemoveAt from the Beginning Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |-------------------- |------------- |------------------- |---------------- |---------------------:|---------------------:|---------------------:|------:|--------:|--------:|--------:|--------:|----------:|------------:| -| Baseline | RemoveAt_FirstItems | List | PooledList | 0 | 20.54 ns | 0.331 ns | 0.310 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 0 | 14.75 ns | 0.321 ns | 0.450 ns | 0.73 | 0.02 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 1 | 29.39 ns | 0.406 ns | 0.380 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 1 | 37.53 ns | 0.599 ns | 0.531 ns | 1.28 | 0.02 | 0.0268 | - | - | 56 B | 0.88 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 2 | 33.15 ns | 0.122 ns | 0.102 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 2 | 44.17 ns | 0.421 ns | 0.373 ns | 1.33 | 0.01 | 0.0268 | - | - | 56 B | 0.78 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 3 | 44.53 ns | 0.102 ns | 0.080 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 3 | 59.26 ns | 0.606 ns | 0.566 ns | 1.33 | 0.01 | 0.0267 | - | - | 56 B | 0.70 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 4 | 56.17 ns | 0.601 ns | 0.533 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 4 | 74.16 ns | 0.136 ns | 0.121 ns | 1.32 | 0.01 | 0.0267 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 5 | 67.14 ns | 0.642 ns | 0.569 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 5 | 78.28 ns | 1.345 ns | 1.192 ns | 1.17 | 0.02 | 0.0267 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 6 | 85.15 ns | 0.483 ns | 0.377 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 6 | 92.33 ns | 1.503 ns | 1.406 ns | 1.09 | 0.01 | 0.0267 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 7 | 98.55 ns | 0.819 ns | 0.766 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 7 | 103.13 ns | 0.838 ns | 0.784 ns | 1.05 | 0.01 | 0.0267 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 8 | 110.61 ns | 0.934 ns | 0.828 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 8 | 116.73 ns | 1.129 ns | 1.056 ns | 1.05 | 0.01 | 0.0267 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 9 | 123.14 ns | 2.086 ns | 1.952 ns | 1.00 | 0.00 | 0.0610 | - | - | 128 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 9 | 129.70 ns | 1.832 ns | 1.713 ns | 1.05 | 0.02 | 0.0267 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 10 | 44.05 ns | 0.732 ns | 0.685 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 10 | 56.53 ns | 0.516 ns | 0.483 ns | 1.28 | 0.02 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 11 | 46.15 ns | 0.848 ns | 0.793 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 11 | 58.43 ns | 0.815 ns | 0.763 ns | 1.27 | 0.03 | 0.0267 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 12 | 45.24 ns | 0.899 ns | 0.999 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 12 | 58.93 ns | 0.689 ns | 0.644 ns | 1.30 | 0.03 | 0.0267 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 13 | 44.88 ns | 0.444 ns | 0.415 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 13 | 59.15 ns | 0.405 ns | 0.379 ns | 1.32 | 0.01 | 0.0267 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 14 | 46.35 ns | 0.820 ns | 0.727 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 14 | 58.81 ns | 0.530 ns | 0.496 ns | 1.27 | 0.02 | 0.0267 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 15 | 45.22 ns | 0.324 ns | 0.287 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 15 | 58.03 ns | 0.434 ns | 0.406 ns | 1.28 | 0.01 | 0.0267 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 16 | 45.02 ns | 0.251 ns | 0.209 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 16 | 57.13 ns | 0.960 ns | 0.898 ns | 1.27 | 0.02 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 17 | 45.24 ns | 0.222 ns | 0.197 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 17 | 56.26 ns | 0.504 ns | 0.472 ns | 1.24 | 0.01 | 0.0267 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 18 | 45.94 ns | 0.320 ns | 0.299 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 18 | 56.00 ns | 0.630 ns | 0.590 ns | 1.22 | 0.02 | 0.0267 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 19 | 48.61 ns | 0.886 ns | 0.829 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 19 | 59.62 ns | 0.745 ns | 0.660 ns | 1.22 | 0.03 | 0.0267 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 20 | 60.56 ns | 0.767 ns | 0.718 ns | 1.00 | 0.00 | 0.1032 | - | - | 216 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 20 | 71.13 ns | 0.618 ns | 0.578 ns | 1.17 | 0.02 | 0.0267 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 30 | 76.45 ns | 0.373 ns | 0.312 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 30 | 82.42 ns | 0.363 ns | 0.339 ns | 1.08 | 0.01 | 0.0267 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 32 | 77.01 ns | 0.423 ns | 0.395 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 32 | 83.92 ns | 0.335 ns | 0.314 ns | 1.09 | 0.01 | 0.0267 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 36 | 84.65 ns | 0.705 ns | 0.659 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 36 | 85.05 ns | 0.736 ns | 0.689 ns | 1.00 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 37 | 85.21 ns | 0.191 ns | 0.159 ns | 1.00 | 0.00 | 0.1682 | - | - | 352 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 37 | 85.03 ns | 1.003 ns | 0.938 ns | 1.00 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 40 | 104.39 ns | 0.525 ns | 0.466 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | RemoveAt_FirstItems | List | PooledList | 40 | 105.55 ns | 0.391 ns | 0.326 ns | 1.01 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 40 | 100.92 ns | 0.479 ns | 0.448 ns | 0.97 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | -| Actual | RemoveAt_FirstItems | List | PooledList | 40 | 119.62 ns | 0.809 ns | 0.757 ns | 1.15 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 50 | 123.57 ns | 0.554 ns | 0.463 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 50 | 132.59 ns | 0.646 ns | 0.604 ns | 1.07 | 0.00 | 0.0267 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 60 | 154.68 ns | 0.337 ns | 0.281 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 60 | 153.93 ns | 1.432 ns | 1.340 ns | 0.99 | 0.01 | 0.0267 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 70 | 182.22 ns | 0.469 ns | 0.392 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 70 | 183.53 ns | 1.196 ns | 1.119 ns | 1.01 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 80 | 203.56 ns | 0.360 ns | 0.319 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 80 | 204.01 ns | 0.526 ns | 0.466 ns | 1.00 | 0.00 | 0.0267 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 90 | 231.01 ns | 0.448 ns | 0.374 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 90 | 219.95 ns | 0.722 ns | 0.640 ns | 0.95 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 100 | 257.73 ns | 0.503 ns | 0.393 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 100 | 250.36 ns | 1.081 ns | 1.011 ns | 0.97 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 128 | 312.63 ns | 0.663 ns | 0.588 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 128 | 299.55 ns | 1.075 ns | 0.898 ns | 0.96 | 0.00 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 256 | 787.59 ns | 2.441 ns | 2.164 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 256 | 725.06 ns | 1.121 ns | 0.936 ns | 0.92 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 512 | 2,338.01 ns | 27.678 ns | 23.112 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | PooledList | 512 | 2,164.00 ns | 8.623 ns | 8.066 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 1024 | 7,689.34 ns | 55.299 ns | 49.021 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 1024 | 7,251.25 ns | 30.736 ns | 28.750 ns | 0.94 | 0.01 | 0.0229 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 2048 | 27,949.04 ns | 175.224 ns | 163.905 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 2048 | 26,652.86 ns | 130.093 ns | 121.689 ns | 0.95 | 0.01 | - | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 4096 | 125,715.95 ns | 823.881 ns | 770.659 ns | 1.00 | 0.00 | 15.3809 | - | - | 32824 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 4096 | 125,496.41 ns | 442.949 ns | 392.663 ns | 1.00 | 0.01 | - | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 8192 | 669,019.36 ns | 1,260.304 ns | 1,178.889 ns | 1.00 | 0.00 | 30.2734 | - | - | 65593 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 8192 | 681,675.29 ns | 1,192.279 ns | 1,115.259 ns | 1.02 | 0.00 | - | - | - | 57 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 16384 | 2,662,326.12 ns | 6,344.067 ns | 5,934.244 ns | 1.00 | 0.00 | 39.0625 | 39.0625 | 39.0625 | 131143 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 16384 | 2,523,706.00 ns | 8,213.341 ns | 7,682.764 ns | 0.95 | 0.00 | - | - | - | 60 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 32768 | 10,347,766.35 ns | 26,245.960 ns | 24,550.487 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 262236 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 32768 | 10,063,751.79 ns | 21,485.615 ns | 19,046.438 ns | 0.97 | 0.00 | - | - | - | 71 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 65536 | 41,709,063.33 ns | 203,900.445 ns | 190,728.603 ns | 1.00 | 0.00 | 83.3333 | 83.3333 | 83.3333 | 524420 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 65536 | 41,409,102.22 ns | 114,026.208 ns | 106,660.186 ns | 0.99 | 0.01 | - | - | - | 134 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 131072 | 204,476,157.78 ns | 942,848.836 ns | 881,941.386 ns | 1.00 | 0.00 | - | - | - | 1048832 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 131072 | 205,948,921.43 ns | 327,370.598 ns | 290,205.508 ns | 1.01 | 0.00 | - | - | - | 4480 B | 0.004 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | PooledList | 850000 | 67,335,200,687.50 ns | 1,336,632,884.501 ns | 1,312,752,216.332 ns | 1.00 | 0.00 | - | - | - | 6812992 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | PooledList | 850000 | 62,856,219,026.67 ns | 76,330,093.100 ns | 71,399,216.444 ns | 0.93 | 0.02 | - | - | - | 992 B | 0.000 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 0 | 16.49 ns | 0.116 ns | 0.109 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 0 | 24.31 ns | 0.214 ns | 0.190 ns | 1.47 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 1 | 27.16 ns | 0.069 ns | 0.061 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 1 | 23.26 ns | 0.141 ns | 0.125 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 2 | 33.19 ns | 0.111 ns | 0.098 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 2 | 27.90 ns | 0.359 ns | 0.318 ns | 0.84 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 3 | 44.32 ns | 0.358 ns | 0.335 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 3 | 40.98 ns | 0.288 ns | 0.240 ns | 0.93 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 4 | 54.16 ns | 0.283 ns | 0.236 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 4 | 51.07 ns | 0.526 ns | 0.492 ns | 0.94 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 5 | 64.52 ns | 0.107 ns | 0.089 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 5 | 76.45 ns | 0.430 ns | 0.382 ns | 1.19 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 6 | 78.70 ns | 0.220 ns | 0.172 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 6 | 88.03 ns | 0.720 ns | 0.601 ns | 1.12 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 7 | 88.90 ns | 0.426 ns | 0.399 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 7 | 101.63 ns | 0.637 ns | 0.532 ns | 1.14 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 8 | 102.27 ns | 0.558 ns | 0.522 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 8 | 112.03 ns | 1.252 ns | 1.109 ns | 1.10 | 0.01 | 0.0918 | - | - | 192 B | 1.60 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 9 | 115.29 ns | 0.711 ns | 0.630 ns | 1.00 | 0.00 | 0.0610 | - | - | 128 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 9 | 129.07 ns | 0.600 ns | 0.501 ns | 1.12 | 0.01 | 0.1223 | - | - | 256 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 10 | 45.62 ns | 0.500 ns | 0.467 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 10 | 55.65 ns | 0.650 ns | 0.608 ns | 1.22 | 0.02 | 0.1224 | - | - | 256 B | 1.88 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 11 | 47.66 ns | 0.514 ns | 0.481 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 11 | 58.71 ns | 0.919 ns | 0.859 ns | 1.23 | 0.02 | 0.1223 | - | - | 256 B | 1.78 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 12 | 46.78 ns | 0.564 ns | 0.528 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 12 | 59.30 ns | 0.594 ns | 0.526 ns | 1.27 | 0.02 | 0.1223 | - | - | 256 B | 1.68 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 13 | 47.90 ns | 0.975 ns | 1.301 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 13 | 58.32 ns | 0.496 ns | 0.440 ns | 1.21 | 0.04 | 0.1224 | - | - | 256 B | 1.60 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 14 | 51.09 ns | 0.815 ns | 0.763 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 14 | 58.85 ns | 0.203 ns | 0.180 ns | 1.15 | 0.01 | 0.1223 | - | - | 256 B | 1.52 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 15 | 47.89 ns | 0.467 ns | 0.437 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 15 | 59.39 ns | 0.479 ns | 0.448 ns | 1.24 | 0.02 | 0.1224 | - | - | 256 B | 1.45 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 16 | 48.68 ns | 0.526 ns | 0.492 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 16 | 57.67 ns | 0.784 ns | 0.655 ns | 1.18 | 0.02 | 0.1223 | - | - | 256 B | 1.39 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 17 | 51.91 ns | 0.280 ns | 0.218 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 17 | 61.23 ns | 0.700 ns | 0.620 ns | 1.18 | 0.01 | 0.1836 | - | - | 384 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 18 | 48.68 ns | 0.585 ns | 0.519 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 18 | 60.21 ns | 0.734 ns | 0.651 ns | 1.24 | 0.02 | 0.1836 | - | - | 384 B | 1.92 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 19 | 50.32 ns | 0.648 ns | 0.606 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 19 | 63.19 ns | 0.454 ns | 0.403 ns | 1.26 | 0.02 | 0.1836 | - | - | 384 B | 1.85 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 20 | 60.28 ns | 0.734 ns | 0.687 ns | 1.00 | 0.00 | 0.1032 | - | - | 216 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 20 | 77.15 ns | 0.997 ns | 0.933 ns | 1.28 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 30 | 76.04 ns | 0.228 ns | 0.202 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 30 | 89.09 ns | 0.988 ns | 0.924 ns | 1.17 | 0.01 | 0.1836 | - | - | 384 B | 1.30 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 32 | 76.76 ns | 0.346 ns | 0.306 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 32 | 87.77 ns | 0.624 ns | 0.553 ns | 1.14 | 0.01 | 0.1836 | - | - | 384 B | 1.23 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 36 | 86.35 ns | 0.164 ns | 0.137 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 36 | 102.67 ns | 1.176 ns | 1.100 ns | 1.19 | 0.01 | 0.0650 | - | - | 136 B | 0.40 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 37 | 91.87 ns | 0.627 ns | 0.587 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 37 | 102.46 ns | 1.315 ns | 1.230 ns | 1.12 | 0.01 | 0.0650 | - | - | 136 B | 0.39 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 40 | 113.53 ns | 0.908 ns | 0.805 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 40 | 112.12 ns | 0.686 ns | 0.608 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 40 | 114.40 ns | 0.692 ns | 0.614 ns | 1.01 | 0.01 | 0.0648 | - | - | 136 B | 0.36 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 40 | 111.12 ns | 0.417 ns | 0.370 ns | 0.98 | 0.01 | 0.0648 | - | - | 136 B | 0.36 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 50 | 132.92 ns | 0.811 ns | 0.758 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 50 | 140.08 ns | 0.682 ns | 0.569 ns | 1.05 | 0.01 | 0.0648 | - | - | 136 B | 0.30 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 60 | 167.12 ns | 0.886 ns | 0.740 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 60 | 166.17 ns | 0.704 ns | 0.624 ns | 0.99 | 0.01 | 0.0648 | - | - | 136 B | 0.25 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 70 | 195.01 ns | 0.881 ns | 0.824 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 70 | 192.99 ns | 1.186 ns | 1.109 ns | 0.99 | 0.00 | 0.0648 | - | - | 136 B | 0.22 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 80 | 221.29 ns | 1.077 ns | 1.007 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 80 | 204.62 ns | 1.354 ns | 1.267 ns | 0.92 | 0.01 | 0.0648 | - | - | 136 B | 0.20 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 90 | 237.83 ns | 1.258 ns | 1.176 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 90 | 232.92 ns | 1.936 ns | 1.811 ns | 0.98 | 0.01 | 0.0648 | - | - | 136 B | 0.18 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 100 | 274.31 ns | 2.015 ns | 1.884 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 100 | 258.88 ns | 1.294 ns | 1.210 ns | 0.94 | 0.01 | 0.0648 | - | - | 136 B | 0.16 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 128 | 335.24 ns | 3.328 ns | 3.113 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 128 | 348.36 ns | 1.878 ns | 1.757 ns | 1.04 | 0.01 | 0.0648 | - | - | 136 B | 0.13 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 256 | 823.69 ns | 2.406 ns | 2.250 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 256 | 764.18 ns | 3.541 ns | 3.312 ns | 0.93 | 0.01 | 0.0648 | - | - | 136 B | 0.06 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 512 | 2,453.39 ns | 13.102 ns | 12.256 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 512 | 2,206.74 ns | 8.093 ns | 7.570 ns | 0.90 | 0.01 | 0.0648 | - | - | 136 B | 0.03 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 1024 | 7,810.05 ns | 42.727 ns | 39.966 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 1024 | 7,341.87 ns | 6.905 ns | 5.766 ns | 0.94 | 0.00 | 0.0610 | - | - | 136 B | 0.02 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 2048 | 28,144.76 ns | 92.303 ns | 86.340 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 2048 | 26,939.35 ns | 22.774 ns | 19.017 ns | 0.96 | 0.00 | 0.0610 | - | - | 136 B | 0.008 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 4096 | 130,086.90 ns | 503.516 ns | 470.989 ns | 1.00 | 0.00 | 15.3809 | - | - | 32826 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 4096 | 125,616.33 ns | 105.599 ns | 88.180 ns | 0.97 | 0.00 | - | - | - | 138 B | 0.004 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 8192 | 667,235.60 ns | 690.763 ns | 612.343 ns | 1.00 | 0.00 | 30.2734 | - | - | 65605 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 8192 | 683,043.94 ns | 1,371.615 ns | 1,283.009 ns | 1.02 | 0.00 | - | - | - | 149 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 16384 | 2,669,847.42 ns | 5,232.231 ns | 4,894.232 ns | 1.00 | 0.00 | 39.0625 | 39.0625 | 39.0625 | 131203 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 16384 | 2,534,213.39 ns | 5,021.415 ns | 4,451.353 ns | 0.95 | 0.00 | - | - | - | 186 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 32768 | 10,386,386.98 ns | 30,952.968 ns | 28,953.426 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 262356 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 32768 | 10,063,918.86 ns | 13,067.487 ns | 11,583.987 ns | 0.97 | 0.00 | - | - | - | 244 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 65536 | 41,688,266.67 ns | 145,170.307 ns | 135,792.395 ns | 1.00 | 0.00 | 83.3333 | 83.3333 | 83.3333 | 524968 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 65536 | 41,149,598.97 ns | 144,489.377 ns | 135,155.453 ns | 0.99 | 0.00 | - | - | - | 666 B | 0.001 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 131072 | 206,102,964.29 ns | 230,933.127 ns | 204,716.202 ns | 1.00 | 0.00 | - | - | - | 1052928 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 131072 | 206,404,678.57 ns | 196,925.921 ns | 174,569.699 ns | 1.00 | 0.00 | - | - | - | 2432 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableList | 850000 | 66,051,090,160.00 ns | 544,519,587.722 ns | 509,343,960.200 ns | 1.00 | 0.00 | - | - | - | 7576840 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableList | 850000 | 66,377,580,123.08 ns | 41,315,966.182 ns | 34,500,702.972 ns | 1.01 | 0.01 | - | - | - | 781968 B | 0.10 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 0 | 19.44 ns | 0.302 ns | 0.282 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 0 | 22.87 ns | 0.122 ns | 0.102 ns | 1.17 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 1 | 27.58 ns | 0.120 ns | 0.106 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 1 | 51.00 ns | 0.497 ns | 0.465 ns | 1.85 | 0.02 | 0.0727 | - | - | 152 B | 2.38 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 2 | 35.05 ns | 0.206 ns | 0.192 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 2 | 59.35 ns | 0.483 ns | 0.429 ns | 1.69 | 0.01 | 0.0764 | - | - | 160 B | 2.22 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 3 | 46.23 ns | 0.218 ns | 0.194 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 3 | 85.63 ns | 1.432 ns | 1.339 ns | 1.85 | 0.03 | 0.0842 | - | - | 176 B | 2.20 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 4 | 54.75 ns | 0.776 ns | 0.726 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 4 | 102.85 ns | 0.869 ns | 0.813 ns | 1.88 | 0.03 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 5 | 65.06 ns | 0.921 ns | 0.862 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 5 | 121.38 ns | 1.511 ns | 1.414 ns | 1.87 | 0.03 | 0.0994 | - | - | 208 B | 2.17 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 6 | 79.32 ns | 0.699 ns | 0.654 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 6 | 144.06 ns | 2.069 ns | 1.935 ns | 1.82 | 0.03 | 0.0994 | - | - | 208 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 7 | 93.20 ns | 0.756 ns | 0.707 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 7 | 161.66 ns | 1.740 ns | 1.627 ns | 1.73 | 0.02 | 0.0994 | - | - | 208 B | 1.86 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 8 | 105.79 ns | 0.934 ns | 0.874 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 8 | 176.25 ns | 2.240 ns | 2.096 ns | 1.67 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 9 | 114.85 ns | 0.872 ns | 0.773 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 9 | 197.10 ns | 0.655 ns | 0.613 ns | 1.72 | 0.01 | 0.1299 | - | - | 272 B | 2.12 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 10 | 45.17 ns | 0.522 ns | 0.489 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 10 | 96.80 ns | 0.873 ns | 0.774 ns | 2.14 | 0.03 | 0.1301 | - | - | 272 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 11 | 48.63 ns | 0.764 ns | 0.750 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 11 | 99.36 ns | 1.184 ns | 1.108 ns | 2.04 | 0.03 | 0.1301 | - | - | 272 B | 1.89 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 12 | 51.14 ns | 0.702 ns | 0.656 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 12 | 101.62 ns | 0.854 ns | 0.799 ns | 1.99 | 0.03 | 0.1301 | - | - | 272 B | 1.79 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 13 | 50.43 ns | 0.598 ns | 0.530 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 13 | 101.25 ns | 1.477 ns | 1.382 ns | 2.01 | 0.03 | 0.1301 | - | - | 272 B | 1.70 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 14 | 51.34 ns | 0.589 ns | 0.551 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 14 | 101.89 ns | 1.198 ns | 1.121 ns | 1.99 | 0.03 | 0.1301 | - | - | 272 B | 1.62 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 15 | 49.64 ns | 0.602 ns | 0.503 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 15 | 99.81 ns | 0.820 ns | 0.767 ns | 2.01 | 0.02 | 0.1301 | - | - | 272 B | 1.55 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 16 | 47.50 ns | 0.398 ns | 0.353 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 16 | 98.18 ns | 1.208 ns | 1.130 ns | 2.07 | 0.03 | 0.1301 | - | - | 272 B | 1.48 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 17 | 48.09 ns | 0.486 ns | 0.431 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 17 | 101.76 ns | 0.898 ns | 0.840 ns | 2.12 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 18 | 48.17 ns | 0.505 ns | 0.448 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 18 | 102.41 ns | 0.672 ns | 0.629 ns | 2.13 | 0.03 | 0.1912 | - | - | 400 B | 2.00 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 19 | 55.02 ns | 1.109 ns | 2.111 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 19 | 113.62 ns | 0.692 ns | 0.647 ns | 2.10 | 0.08 | 0.1912 | - | - | 400 B | 1.92 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 20 | 63.44 ns | 0.610 ns | 0.570 ns | 1.00 | 0.00 | 0.1032 | - | - | 216 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 20 | 123.96 ns | 1.218 ns | 1.139 ns | 1.95 | 0.02 | 0.1912 | - | - | 400 B | 1.85 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 30 | 80.64 ns | 0.812 ns | 0.759 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 30 | 140.77 ns | 1.009 ns | 0.895 ns | 1.75 | 0.02 | 0.1912 | - | - | 400 B | 1.35 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 32 | 76.70 ns | 0.591 ns | 0.524 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 32 | 141.90 ns | 0.245 ns | 0.191 ns | 1.85 | 0.01 | 0.1912 | - | - | 400 B | 1.28 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 36 | 95.14 ns | 1.263 ns | 1.119 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 36 | 156.22 ns | 1.286 ns | 1.203 ns | 1.64 | 0.02 | 0.0725 | - | - | 152 B | 0.44 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 37 | 98.27 ns | 0.730 ns | 0.683 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 37 | 155.39 ns | 1.951 ns | 1.825 ns | 1.58 | 0.02 | 0.0725 | - | - | 152 B | 0.43 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 113.47 ns | 1.350 ns | 1.262 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 114.72 ns | 1.303 ns | 1.219 ns | 1.01 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 172.33 ns | 2.214 ns | 2.071 ns | 1.52 | 0.02 | 0.0725 | - | - | 152 B | 0.40 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 173.43 ns | 1.250 ns | 1.169 ns | 1.53 | 0.02 | 0.0725 | - | - | 152 B | 0.40 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 50 | 134.50 ns | 1.086 ns | 0.963 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 50 | 200.76 ns | 2.835 ns | 2.651 ns | 1.49 | 0.02 | 0.0725 | - | - | 152 B | 0.33 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 60 | 170.26 ns | 1.832 ns | 1.714 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 60 | 220.45 ns | 2.233 ns | 1.979 ns | 1.29 | 0.02 | 0.0725 | - | - | 152 B | 0.28 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 70 | 197.88 ns | 1.221 ns | 1.082 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 70 | 260.15 ns | 2.360 ns | 2.207 ns | 1.31 | 0.01 | 0.0725 | - | - | 152 B | 0.25 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 80 | 221.35 ns | 2.021 ns | 1.890 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 80 | 280.55 ns | 2.441 ns | 2.164 ns | 1.27 | 0.01 | 0.0725 | - | - | 152 B | 0.22 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 100 | 286.35 ns | 2.057 ns | 1.924 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 100 | 321.82 ns | 1.687 ns | 1.578 ns | 1.12 | 0.01 | 0.0725 | - | - | 152 B | 0.18 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 128 | 339.95 ns | 4.147 ns | 3.879 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 128 | 367.24 ns | 1.680 ns | 1.403 ns | 1.08 | 0.01 | 0.0725 | - | - | 152 B | 0.14 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 256 | 833.46 ns | 6.908 ns | 6.462 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 256 | 878.61 ns | 5.636 ns | 5.272 ns | 1.05 | 0.01 | 0.0725 | - | - | 152 B | 0.07 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 512 | 2,414.19 ns | 11.496 ns | 10.753 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 512 | 2,354.74 ns | 12.761 ns | 11.936 ns | 0.98 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 1024 | 7,872.55 ns | 47.373 ns | 44.313 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 1024 | 7,758.42 ns | 34.801 ns | 32.553 ns | 0.99 | 0.01 | 0.0610 | - | - | 152 B | 0.02 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 2048 | 28,202.10 ns | 81.798 ns | 76.514 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 2048 | 28,093.73 ns | 25.874 ns | 21.606 ns | 1.00 | 0.00 | 0.0610 | - | - | 152 B | 0.009 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 4096 | 128,999.20 ns | 325.944 ns | 304.888 ns | 1.00 | 0.00 | 15.6250 | - | - | 32826 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 4096 | 142,900.35 ns | 383.371 ns | 339.849 ns | 1.11 | 0.00 | - | - | - | 155 B | 0.005 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 8192 | 674,524.94 ns | 1,623.973 ns | 1,519.065 ns | 1.00 | 0.00 | 31.2500 | - | - | 65605 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 8192 | 719,250.57 ns | 1,493.373 ns | 1,396.902 ns | 1.07 | 0.00 | - | - | - | 165 B | 0.003 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 16384 | 2,681,106.67 ns | 5,678.145 ns | 5,311.340 ns | 1.00 | 0.00 | 39.0625 | 39.0625 | 39.0625 | 131203 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 16384 | 2,761,809.45 ns | 6,115.873 ns | 5,720.791 ns | 1.03 | 0.00 | - | - | - | 464 B | 0.004 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 32768 | 10,442,391.88 ns | 24,308.755 ns | 22,738.424 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 262450 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 32768 | 10,789,099.22 ns | 43,918.562 ns | 41,081.450 ns | 1.03 | 0.00 | - | - | - | 540 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 65536 | 42,255,784.52 ns | 261,200.473 ns | 231,547.415 ns | 1.00 | 0.00 | 83.3333 | 83.3333 | 83.3333 | 524968 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 65536 | 44,203,452.78 ns | 337,618.726 ns | 315,808.766 ns | 1.05 | 0.01 | - | - | - | 1006 B | 0.002 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 131072 | 207,955,243.59 ns | 653,379.017 ns | 545,601.071 ns | 1.00 | 0.00 | - | - | - | 1050928 B | 1.000 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 131072 | 212,360,097.44 ns | 514,818.130 ns | 429,896.455 ns | 1.02 | 0.00 | - | - | - | 8840 B | 0.008 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 850000 | 67,020,573,153.33 ns | 765,522,051.298 ns | 716,069,801.748 ns | 1.00 | 0.00 | - | - | - | 7582840 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 850000 | 61,351,466,257.14 ns | 321,621,594.596 ns | 285,109,166.344 ns | 0.92 | 0.01 | - | - | - | 724176 B | 0.10 | -| | | | | | | | | | | | | | | | -| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 90 | 242.32 ns | 1.436 ns | 1.273 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 90 | 300.40 ns | 2.440 ns | 2.283 ns | 1.24 | 0.01 | 0.0725 | - | - | 152 B | 0.20 | -
- -
-RemoveAt from the End Benchmark Results - click to expand - -| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | -|--------- |------------------- |------------- |------------------- |---------------- |----------------:|--------------:|--------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| -| Baseline | RemoveAt_LastItems | List | PooledList | 0 | 19.63 ns | 0.419 ns | 0.559 ns | 19.38 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 0 | 13.58 ns | 0.299 ns | 0.475 ns | 13.47 ns | 0.70 | 0.03 | 0.0268 | - | - | 56 B | 1.75 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 1 | 27.90 ns | 0.134 ns | 0.126 ns | 27.86 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 1 | 39.46 ns | 0.357 ns | 0.334 ns | 39.45 ns | 1.41 | 0.01 | 0.0268 | - | - | 56 B | 0.88 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 2 | 29.93 ns | 0.224 ns | 0.210 ns | 30.01 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 2 | 38.64 ns | 0.358 ns | 0.335 ns | 38.47 ns | 1.29 | 0.01 | 0.0268 | - | - | 56 B | 0.78 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 3 | 31.72 ns | 0.339 ns | 0.301 ns | 31.71 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 3 | 39.90 ns | 0.321 ns | 0.300 ns | 39.81 ns | 1.26 | 0.02 | 0.0268 | - | - | 56 B | 0.70 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 4 | 33.55 ns | 0.182 ns | 0.171 ns | 33.49 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 4 | 40.81 ns | 0.102 ns | 0.080 ns | 40.82 ns | 1.22 | 0.00 | 0.0268 | - | - | 56 B | 0.64 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 5 | 36.16 ns | 0.258 ns | 0.242 ns | 36.07 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 5 | 42.41 ns | 0.293 ns | 0.260 ns | 42.33 ns | 1.17 | 0.01 | 0.0268 | - | - | 56 B | 0.58 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 6 | 38.18 ns | 0.163 ns | 0.144 ns | 38.21 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 6 | 43.58 ns | 0.349 ns | 0.327 ns | 43.56 ns | 1.14 | 0.01 | 0.0268 | - | - | 56 B | 0.54 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 7 | 40.43 ns | 0.202 ns | 0.179 ns | 40.40 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 7 | 44.59 ns | 0.122 ns | 0.108 ns | 44.57 ns | 1.10 | 0.01 | 0.0268 | - | - | 56 B | 0.50 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 8 | 42.62 ns | 0.256 ns | 0.227 ns | 42.51 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 8 | 46.33 ns | 0.426 ns | 0.398 ns | 46.42 ns | 1.09 | 0.01 | 0.0268 | - | - | 56 B | 0.47 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 9 | 44.64 ns | 0.171 ns | 0.152 ns | 44.60 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 9 | 48.93 ns | 0.142 ns | 0.126 ns | 48.90 ns | 1.10 | 0.00 | 0.0268 | - | - | 56 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 10 | 31.07 ns | 0.086 ns | 0.071 ns | 31.07 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 10 | 37.66 ns | 0.333 ns | 0.312 ns | 37.70 ns | 1.21 | 0.01 | 0.0268 | - | - | 56 B | 0.41 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 11 | 32.63 ns | 0.270 ns | 0.239 ns | 32.65 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 11 | 40.36 ns | 0.145 ns | 0.128 ns | 40.35 ns | 1.24 | 0.01 | 0.0268 | - | - | 56 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 12 | 33.24 ns | 0.146 ns | 0.129 ns | 33.19 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 12 | 40.54 ns | 0.303 ns | 0.283 ns | 40.41 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.37 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 13 | 33.06 ns | 0.171 ns | 0.151 ns | 32.99 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 13 | 40.28 ns | 0.152 ns | 0.127 ns | 40.31 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.35 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 14 | 32.76 ns | 0.152 ns | 0.143 ns | 32.72 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 14 | 40.21 ns | 0.106 ns | 0.088 ns | 40.21 ns | 1.23 | 0.01 | 0.0268 | - | - | 56 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 15 | 33.14 ns | 0.105 ns | 0.093 ns | 33.16 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 15 | 38.40 ns | 0.142 ns | 0.119 ns | 38.35 ns | 1.16 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 16 | 33.42 ns | 0.138 ns | 0.122 ns | 33.43 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 16 | 39.01 ns | 0.125 ns | 0.105 ns | 38.96 ns | 1.17 | 0.00 | 0.0268 | - | - | 56 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 17 | 33.84 ns | 0.142 ns | 0.126 ns | 33.83 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 17 | 39.19 ns | 0.353 ns | 0.331 ns | 39.20 ns | 1.16 | 0.01 | 0.0268 | - | - | 56 B | 0.29 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 18 | 34.88 ns | 0.134 ns | 0.119 ns | 34.86 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 18 | 38.97 ns | 0.123 ns | 0.109 ns | 38.94 ns | 1.12 | 0.01 | 0.0268 | - | - | 56 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 19 | 34.74 ns | 0.101 ns | 0.089 ns | 34.73 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 19 | 42.35 ns | 0.193 ns | 0.180 ns | 42.33 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.27 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 20 | 36.64 ns | 0.105 ns | 0.093 ns | 36.62 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 20 | 45.56 ns | 0.110 ns | 0.097 ns | 45.56 ns | 1.24 | 0.00 | 0.0268 | - | - | 56 B | 0.26 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 30 | 41.64 ns | 0.084 ns | 0.070 ns | 41.64 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 30 | 45.33 ns | 0.167 ns | 0.148 ns | 45.31 ns | 1.09 | 0.00 | 0.0268 | - | - | 56 B | 0.19 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 32 | 42.67 ns | 0.302 ns | 0.282 ns | 42.64 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 32 | 43.02 ns | 0.224 ns | 0.209 ns | 42.91 ns | 1.01 | 0.01 | 0.0268 | - | - | 56 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 36 | 44.40 ns | 0.318 ns | 0.282 ns | 44.32 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 36 | 46.66 ns | 0.830 ns | 0.776 ns | 46.48 ns | 1.05 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 37 | 44.11 ns | 0.237 ns | 0.198 ns | 44.04 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 37 | 46.22 ns | 0.283 ns | 0.251 ns | 46.23 ns | 1.05 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 40 | 47.28 ns | 0.488 ns | 0.456 ns | 47.13 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | RemoveAt_LastItems | List | PooledList | 40 | 47.24 ns | 0.323 ns | 0.302 ns | 47.20 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 40 | 45.61 ns | 0.261 ns | 0.244 ns | 45.57 ns | 0.96 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | -| Actual | RemoveAt_LastItems | List | PooledList | 40 | 45.34 ns | 0.222 ns | 0.208 ns | 45.27 ns | 0.96 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 50 | 52.12 ns | 0.390 ns | 0.365 ns | 51.97 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 50 | 46.61 ns | 0.481 ns | 0.426 ns | 46.58 ns | 0.89 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 60 | 56.65 ns | 0.428 ns | 0.401 ns | 56.57 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 60 | 51.79 ns | 0.642 ns | 0.601 ns | 51.83 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.10 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 70 | 61.15 ns | 0.217 ns | 0.182 ns | 61.12 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 70 | 55.22 ns | 0.186 ns | 0.174 ns | 55.18 ns | 0.90 | 0.00 | 0.0268 | - | - | 56 B | 0.09 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 80 | 66.13 ns | 0.133 ns | 0.104 ns | 66.14 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 80 | 53.75 ns | 0.143 ns | 0.126 ns | 53.74 ns | 0.81 | 0.00 | 0.0268 | - | - | 56 B | 0.08 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 90 | 74.91 ns | 1.354 ns | 1.200 ns | 74.60 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 90 | 56.88 ns | 0.195 ns | 0.173 ns | 56.84 ns | 0.76 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 100 | 79.58 ns | 1.278 ns | 1.195 ns | 79.45 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 100 | 60.93 ns | 0.383 ns | 0.358 ns | 60.96 ns | 0.77 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 128 | 91.26 ns | 0.566 ns | 0.529 ns | 91.00 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 128 | 65.37 ns | 0.266 ns | 0.236 ns | 65.41 ns | 0.72 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 256 | 174.06 ns | 0.909 ns | 0.851 ns | 173.91 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 256 | 91.10 ns | 0.126 ns | 0.112 ns | 91.13 ns | 0.52 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 512 | 313.94 ns | 0.345 ns | 0.269 ns | 313.99 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | RemoveAt_LastItems | List | PooledList | 512 | 162.11 ns | 0.732 ns | 0.685 ns | 161.98 ns | 0.52 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 1024 | 597.12 ns | 0.854 ns | 0.713 ns | 597.16 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 1024 | 280.65 ns | 0.907 ns | 0.804 ns | 280.62 ns | 0.47 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 2048 | 1,188.74 ns | 17.942 ns | 16.783 ns | 1,179.87 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 2048 | 587.69 ns | 1.759 ns | 1.560 ns | 586.89 ns | 0.49 | 0.01 | 0.0267 | - | - | 56 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 4096 | 2,304.71 ns | 13.241 ns | 12.386 ns | 2,304.04 ns | 1.00 | 0.00 | 15.6212 | - | - | 32824 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 4096 | 1,265.18 ns | 7.788 ns | 7.285 ns | 1,261.62 ns | 0.55 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 8192 | 4,420.68 ns | 31.056 ns | 27.530 ns | 4,423.29 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 8192 | 2,469.12 ns | 4.122 ns | 3.442 ns | 2,468.88 ns | 0.56 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 16384 | 54,941.18 ns | 306.588 ns | 256.015 ns | 54,994.60 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 16384 | 5,167.73 ns | 1.826 ns | 1.425 ns | 5,167.62 ns | 0.09 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 32768 | 110,733.03 ns | 1,115.997 ns | 1,043.904 ns | 110,519.27 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 32768 | 10,742.88 ns | 11.943 ns | 9.973 ns | 10,740.05 ns | 0.10 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 65536 | 106,668.46 ns | 968.200 ns | 808.491 ns | 106,687.39 ns | 1.00 | 0.00 | 130.9814 | 129.7607 | 129.7607 | 524980 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 65536 | 22,882.30 ns | 41.822 ns | 39.120 ns | 22,886.88 ns | 0.21 | 0.00 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 131072 | 282,605.66 ns | 5,595.347 ns | 12,163.825 ns | 284,138.99 ns | 1.00 | 0.00 | 202.1484 | 200.6836 | 200.6836 | 1048872 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 131072 | 44,825.02 ns | 56.407 ns | 50.004 ns | 44,809.98 ns | 0.16 | 0.01 | - | - | - | 56 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | PooledList | 850000 | 2,810,937.44 ns | 10,160.388 ns | 8,484.384 ns | 2,810,179.30 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800115 B | 1.000 | -| Actual | RemoveAt_LastItems | List | PooledList | 850000 | 840,846.48 ns | 3,091.399 ns | 2,891.697 ns | 839,652.05 ns | 0.30 | 0.00 | - | - | - | 57 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 0 | 16.39 ns | 0.074 ns | 0.066 ns | 16.40 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 0 | 23.91 ns | 0.127 ns | 0.113 ns | 23.87 ns | 1.46 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 1 | 28.65 ns | 0.276 ns | 0.245 ns | 28.64 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 1 | 24.56 ns | 0.212 ns | 0.199 ns | 24.63 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 2 | 29.72 ns | 0.207 ns | 0.183 ns | 29.69 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 2 | 24.89 ns | 0.296 ns | 0.277 ns | 24.87 ns | 0.84 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 3 | 31.37 ns | 0.078 ns | 0.070 ns | 31.35 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 3 | 25.49 ns | 0.184 ns | 0.144 ns | 25.50 ns | 0.81 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 4 | 34.57 ns | 0.139 ns | 0.123 ns | 34.58 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 4 | 36.29 ns | 0.124 ns | 0.116 ns | 36.27 ns | 1.05 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 5 | 37.54 ns | 0.545 ns | 0.509 ns | 37.55 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 5 | 40.73 ns | 0.200 ns | 0.167 ns | 40.69 ns | 1.09 | 0.02 | 0.0918 | - | - | 192 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 6 | 38.43 ns | 0.222 ns | 0.207 ns | 38.44 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 6 | 41.59 ns | 0.310 ns | 0.290 ns | 41.61 ns | 1.08 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 7 | 40.19 ns | 0.252 ns | 0.223 ns | 40.22 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 7 | 42.13 ns | 0.161 ns | 0.126 ns | 42.10 ns | 1.05 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 8 | 42.94 ns | 0.379 ns | 0.336 ns | 42.83 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 8 | 43.04 ns | 0.115 ns | 0.102 ns | 43.01 ns | 1.00 | 0.01 | 0.0918 | - | - | 192 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 9 | 44.95 ns | 0.505 ns | 0.421 ns | 44.96 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 9 | 47.93 ns | 0.487 ns | 0.455 ns | 47.96 ns | 1.07 | 0.01 | 0.1224 | - | - | 256 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 10 | 31.47 ns | 0.189 ns | 0.158 ns | 31.45 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 10 | 38.10 ns | 0.275 ns | 0.244 ns | 38.05 ns | 1.21 | 0.01 | 0.1224 | - | - | 256 B | 1.88 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 11 | 32.54 ns | 0.451 ns | 0.421 ns | 32.55 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 11 | 39.87 ns | 0.230 ns | 0.215 ns | 39.82 ns | 1.23 | 0.02 | 0.1224 | - | - | 256 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 12 | 32.75 ns | 0.425 ns | 0.397 ns | 32.46 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 12 | 39.76 ns | 0.339 ns | 0.283 ns | 39.72 ns | 1.21 | 0.02 | 0.1224 | - | - | 256 B | 1.68 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 13 | 33.00 ns | 0.464 ns | 0.434 ns | 32.83 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 13 | 39.74 ns | 0.238 ns | 0.211 ns | 39.70 ns | 1.20 | 0.02 | 0.1224 | - | - | 256 B | 1.60 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 14 | 33.66 ns | 0.442 ns | 0.413 ns | 33.67 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 14 | 46.58 ns | 1.440 ns | 4.037 ns | 45.05 ns | 1.41 | 0.18 | 0.1224 | - | - | 256 B | 1.52 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 15 | 35.79 ns | 0.653 ns | 0.826 ns | 35.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 15 | 41.06 ns | 0.498 ns | 0.442 ns | 41.10 ns | 1.14 | 0.03 | 0.1224 | - | - | 256 B | 1.45 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 16 | 34.27 ns | 0.324 ns | 0.270 ns | 34.25 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 16 | 39.25 ns | 0.370 ns | 0.346 ns | 39.19 ns | 1.15 | 0.02 | 0.1224 | - | - | 256 B | 1.39 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 17 | 34.31 ns | 0.230 ns | 0.204 ns | 34.36 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 17 | 43.87 ns | 0.486 ns | 0.455 ns | 44.05 ns | 1.28 | 0.02 | 0.1836 | - | - | 384 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 18 | 36.35 ns | 0.663 ns | 0.620 ns | 36.55 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 18 | 43.72 ns | 0.484 ns | 0.453 ns | 43.86 ns | 1.20 | 0.03 | 0.1836 | - | - | 384 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 19 | 35.86 ns | 0.463 ns | 0.410 ns | 35.96 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 19 | 46.88 ns | 0.909 ns | 2.014 ns | 46.23 ns | 1.32 | 0.08 | 0.1836 | - | - | 384 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 20 | 41.42 ns | 0.763 ns | 0.714 ns | 41.27 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 20 | 45.83 ns | 0.483 ns | 0.452 ns | 45.78 ns | 1.11 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 30 | 41.99 ns | 0.456 ns | 0.427 ns | 41.84 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 30 | 48.37 ns | 0.870 ns | 0.814 ns | 48.34 ns | 1.15 | 0.02 | 0.1836 | - | - | 384 B | 1.30 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 32 | 42.76 ns | 0.847 ns | 0.793 ns | 42.61 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 32 | 46.90 ns | 0.574 ns | 0.537 ns | 46.78 ns | 1.10 | 0.02 | 0.1836 | - | - | 384 B | 1.23 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 36 | 43.87 ns | 0.553 ns | 0.517 ns | 43.87 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 36 | 62.59 ns | 0.976 ns | 0.913 ns | 62.81 ns | 1.43 | 0.03 | 0.0650 | - | - | 136 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 37 | 55.16 ns | 1.115 ns | 1.599 ns | 55.62 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 37 | 61.99 ns | 0.677 ns | 0.634 ns | 62.08 ns | 1.13 | 0.03 | 0.0650 | - | - | 136 B | 0.39 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 40 | 56.96 ns | 1.390 ns | 4.033 ns | 55.43 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 40 | 55.21 ns | 1.001 ns | 0.936 ns | 55.44 ns | 0.97 | 0.07 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 40 | 64.04 ns | 0.846 ns | 0.792 ns | 63.82 ns | 1.13 | 0.07 | 0.0650 | - | - | 136 B | 0.36 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 40 | 63.68 ns | 0.752 ns | 0.704 ns | 63.58 ns | 1.12 | 0.07 | 0.0650 | - | - | 136 B | 0.36 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 50 | 62.72 ns | 1.226 ns | 1.087 ns | 62.60 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 50 | 62.87 ns | 0.528 ns | 0.468 ns | 62.83 ns | 1.00 | 0.02 | 0.0650 | - | - | 136 B | 0.30 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 60 | 73.19 ns | 1.359 ns | 1.454 ns | 73.36 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 60 | 65.42 ns | 0.612 ns | 0.572 ns | 65.15 ns | 0.89 | 0.02 | 0.0650 | - | - | 136 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 70 | 78.48 ns | 1.344 ns | 1.257 ns | 78.62 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 70 | 72.48 ns | 0.786 ns | 0.735 ns | 72.37 ns | 0.92 | 0.01 | 0.0650 | - | - | 136 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 80 | 83.28 ns | 1.671 ns | 1.717 ns | 83.30 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 80 | 72.59 ns | 0.329 ns | 0.292 ns | 72.58 ns | 0.87 | 0.02 | 0.0650 | - | - | 136 B | 0.20 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 90 | 86.83 ns | 0.791 ns | 0.740 ns | 87.09 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 90 | 70.49 ns | 0.213 ns | 0.178 ns | 70.50 ns | 0.81 | 0.01 | 0.0650 | - | - | 136 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 100 | 96.64 ns | 0.833 ns | 0.779 ns | 96.82 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 100 | 74.23 ns | 0.933 ns | 0.827 ns | 74.51 ns | 0.77 | 0.01 | 0.0650 | - | - | 136 B | 0.16 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 128 | 112.73 ns | 2.176 ns | 2.035 ns | 112.84 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 128 | 80.13 ns | 1.005 ns | 0.940 ns | 79.65 ns | 0.71 | 0.02 | 0.0650 | - | - | 136 B | 0.13 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 256 | 216.01 ns | 2.897 ns | 2.710 ns | 216.20 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 256 | 110.32 ns | 0.809 ns | 0.717 ns | 110.17 ns | 0.51 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 512 | 401.14 ns | 5.992 ns | 5.605 ns | 399.05 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 512 | 185.44 ns | 1.254 ns | 1.173 ns | 185.18 ns | 0.46 | 0.01 | 0.0648 | - | - | 136 B | 0.03 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 1024 | 768.24 ns | 8.273 ns | 7.739 ns | 770.86 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 1024 | 319.17 ns | 1.900 ns | 1.777 ns | 319.94 ns | 0.42 | 0.01 | 0.0648 | - | - | 136 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 2048 | 1,494.97 ns | 23.946 ns | 21.227 ns | 1,495.44 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 2048 | 671.01 ns | 1.066 ns | 0.891 ns | 670.92 ns | 0.45 | 0.01 | 0.0648 | - | - | 136 B | 0.008 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 4096 | 3,010.29 ns | 37.376 ns | 34.961 ns | 3,005.18 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 4096 | 1,400.30 ns | 2.332 ns | 2.181 ns | 1,400.49 ns | 0.47 | 0.01 | 0.0648 | - | - | 136 B | 0.004 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 8192 | 5,781.71 ns | 55.335 ns | 49.053 ns | 5,790.07 ns | 1.00 | 0.00 | 31.2424 | 0.0076 | - | 65592 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 8192 | 2,681.21 ns | 6.085 ns | 5.692 ns | 2,681.77 ns | 0.46 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 16384 | 57,203.29 ns | 779.379 ns | 729.032 ns | 57,039.45 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 16384 | 5,637.76 ns | 40.108 ns | 37.517 ns | 5,639.82 ns | 0.10 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 32768 | 115,929.12 ns | 924.329 ns | 819.394 ns | 115,788.78 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 32768 | 11,658.34 ns | 48.855 ns | 45.699 ns | 11,649.20 ns | 0.10 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 65536 | 112,767.79 ns | 1,428.939 ns | 1,266.717 ns | 112,863.15 ns | 1.00 | 0.00 | 133.5449 | 132.4463 | 132.4463 | 524747 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 65536 | 24,224.18 ns | 116.595 ns | 109.063 ns | 24,198.04 ns | 0.21 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 131072 | 307,874.59 ns | 6,110.474 ns | 9,867.276 ns | 309,359.11 ns | 1.00 | 0.00 | 196.2891 | 194.8242 | 194.8242 | 1048949 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 131072 | 50,850.85 ns | 219.395 ns | 183.205 ns | 50,777.24 ns | 0.17 | 0.00 | 0.0610 | - | - | 137 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableList | 850000 | 2,914,678.89 ns | 57,800.734 ns | 82,896.086 ns | 2,883,095.90 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800191 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableList | 850000 | 871,047.68 ns | 5,867.027 ns | 5,200.967 ns | 873,933.30 ns | 0.30 | 0.01 | - | - | - | 149 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 0 | 19.36 ns | 0.312 ns | 0.276 ns | 19.38 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 0 | 24.25 ns | 0.214 ns | 0.201 ns | 24.28 ns | 1.25 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 1 | 31.02 ns | 0.644 ns | 1.591 ns | 30.78 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 1 | 51.60 ns | 0.385 ns | 0.360 ns | 51.55 ns | 1.63 | 0.09 | 0.0727 | - | - | 152 B | 2.38 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 2 | 31.17 ns | 0.647 ns | 0.864 ns | 31.14 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 2 | 54.26 ns | 0.303 ns | 0.253 ns | 54.28 ns | 1.74 | 0.05 | 0.0765 | - | - | 160 B | 2.22 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 3 | 32.78 ns | 0.658 ns | 0.550 ns | 32.78 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 3 | 56.86 ns | 0.640 ns | 0.567 ns | 57.05 ns | 1.73 | 0.03 | 0.0842 | - | - | 176 B | 2.20 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 4 | 36.32 ns | 0.735 ns | 1.054 ns | 36.55 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 4 | 59.95 ns | 1.070 ns | 1.001 ns | 59.57 ns | 1.63 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 5 | 39.45 ns | 0.809 ns | 1.211 ns | 39.34 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 5 | 61.57 ns | 1.193 ns | 1.116 ns | 61.49 ns | 1.57 | 0.07 | 0.0994 | - | - | 208 B | 2.17 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 6 | 41.28 ns | 0.855 ns | 1.687 ns | 40.85 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 6 | 64.12 ns | 1.186 ns | 1.701 ns | 64.50 ns | 1.54 | 0.07 | 0.0994 | - | - | 208 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 7 | 43.02 ns | 0.868 ns | 1.376 ns | 42.74 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 7 | 66.75 ns | 1.078 ns | 0.956 ns | 66.91 ns | 1.57 | 0.06 | 0.0994 | - | - | 208 B | 1.86 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 8 | 45.44 ns | 0.745 ns | 0.697 ns | 45.45 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 8 | 67.94 ns | 0.625 ns | 0.522 ns | 67.81 ns | 1.50 | 0.03 | 0.0994 | - | - | 208 B | 1.73 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 9 | 46.40 ns | 0.474 ns | 0.443 ns | 46.42 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 9 | 71.88 ns | 1.418 ns | 1.326 ns | 71.79 ns | 1.55 | 0.03 | 0.1301 | - | - | 272 B | 2.12 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 10 | 35.69 ns | 0.724 ns | 1.038 ns | 35.77 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 10 | 76.45 ns | 0.639 ns | 0.567 ns | 76.48 ns | 2.15 | 0.08 | 0.1301 | - | - | 272 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 11 | 38.58 ns | 0.793 ns | 1.689 ns | 38.83 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 11 | 78.25 ns | 0.954 ns | 0.892 ns | 78.26 ns | 2.05 | 0.09 | 0.1301 | - | - | 272 B | 1.89 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 12 | 39.04 ns | 0.810 ns | 1.691 ns | 38.85 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 12 | 79.01 ns | 0.946 ns | 0.885 ns | 78.86 ns | 2.04 | 0.12 | 0.1301 | - | - | 272 B | 1.79 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 13 | 36.20 ns | 0.722 ns | 0.741 ns | 36.47 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 13 | 79.09 ns | 1.335 ns | 1.249 ns | 78.81 ns | 2.19 | 0.05 | 0.1301 | - | - | 272 B | 1.70 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 14 | 38.25 ns | 0.786 ns | 1.742 ns | 38.31 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 14 | 78.40 ns | 1.351 ns | 1.264 ns | 78.65 ns | 2.03 | 0.11 | 0.1301 | - | - | 272 B | 1.62 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 15 | 37.54 ns | 0.777 ns | 1.439 ns | 37.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 15 | 77.39 ns | 0.958 ns | 0.896 ns | 77.18 ns | 2.06 | 0.09 | 0.1301 | - | - | 272 B | 1.55 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 16 | 35.21 ns | 0.610 ns | 0.570 ns | 35.14 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 16 | 78.80 ns | 0.844 ns | 0.789 ns | 78.33 ns | 2.24 | 0.03 | 0.1301 | - | - | 272 B | 1.48 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 17 | 35.47 ns | 0.413 ns | 0.323 ns | 35.52 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 17 | 78.16 ns | 0.438 ns | 0.410 ns | 78.08 ns | 2.20 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 18 | 36.88 ns | 0.751 ns | 0.950 ns | 37.26 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 18 | 79.26 ns | 0.388 ns | 0.324 ns | 79.29 ns | 2.15 | 0.06 | 0.1912 | - | - | 400 B | 2.00 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 19 | 41.37 ns | 0.851 ns | 2.022 ns | 41.08 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 19 | 81.18 ns | 0.956 ns | 0.894 ns | 81.49 ns | 1.93 | 0.11 | 0.1912 | - | - | 400 B | 1.92 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 20 | 40.59 ns | 0.836 ns | 1.173 ns | 40.15 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 20 | 85.73 ns | 1.084 ns | 1.014 ns | 85.61 ns | 2.12 | 0.06 | 0.1912 | - | - | 400 B | 1.85 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 30 | 46.09 ns | 0.937 ns | 1.539 ns | 46.30 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 30 | 85.33 ns | 0.548 ns | 0.512 ns | 85.38 ns | 1.84 | 0.06 | 0.1912 | - | - | 400 B | 1.35 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 32 | 44.97 ns | 0.876 ns | 0.860 ns | 45.22 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 32 | 89.36 ns | 0.734 ns | 0.687 ns | 89.23 ns | 1.99 | 0.04 | 0.1912 | - | - | 400 B | 1.28 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 36 | 53.30 ns | 0.688 ns | 0.610 ns | 53.39 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 36 | 100.23 ns | 0.836 ns | 0.782 ns | 100.23 ns | 1.88 | 0.02 | 0.0726 | - | - | 152 B | 0.44 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 37 | 53.14 ns | 0.933 ns | 0.873 ns | 53.22 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 37 | 101.60 ns | 1.218 ns | 1.139 ns | 101.61 ns | 1.91 | 0.04 | 0.0726 | - | - | 152 B | 0.43 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 40 | 54.79 ns | 0.496 ns | 0.464 ns | 54.74 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 40 | 54.12 ns | 0.362 ns | 0.339 ns | 54.23 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 40 | 102.62 ns | 1.264 ns | 1.183 ns | 102.24 ns | 1.87 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 40 | 102.78 ns | 1.032 ns | 0.965 ns | 102.97 ns | 1.88 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 50 | 61.11 ns | 0.821 ns | 0.768 ns | 61.15 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 50 | 108.00 ns | 0.780 ns | 0.730 ns | 108.12 ns | 1.77 | 0.02 | 0.0726 | - | - | 152 B | 0.33 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 60 | 67.26 ns | 1.139 ns | 1.066 ns | 66.94 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 60 | 108.40 ns | 0.763 ns | 0.637 ns | 108.49 ns | 1.62 | 0.02 | 0.0726 | - | - | 152 B | 0.28 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 70 | 75.85 ns | 1.419 ns | 1.327 ns | 76.33 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 70 | 110.94 ns | 2.154 ns | 2.015 ns | 111.14 ns | 1.46 | 0.04 | 0.0726 | - | - | 152 B | 0.25 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 80 | 82.34 ns | 1.678 ns | 2.061 ns | 82.55 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 80 | 113.45 ns | 1.438 ns | 1.345 ns | 113.05 ns | 1.38 | 0.05 | 0.0726 | - | - | 152 B | 0.22 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 100 | 95.29 ns | 1.439 ns | 1.346 ns | 95.70 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 100 | 121.43 ns | 0.979 ns | 0.868 ns | 121.37 ns | 1.27 | 0.02 | 0.0725 | - | - | 152 B | 0.18 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 128 | 109.93 ns | 1.290 ns | 1.207 ns | 110.26 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 128 | 139.27 ns | 1.368 ns | 1.280 ns | 139.49 ns | 1.27 | 0.02 | 0.0725 | - | - | 152 B | 0.14 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 256 | 207.92 ns | 3.506 ns | 6.321 ns | 207.30 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 256 | 179.97 ns | 2.038 ns | 1.807 ns | 179.85 ns | 0.85 | 0.03 | 0.0725 | - | - | 152 B | 0.07 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 512 | 408.13 ns | 5.017 ns | 4.693 ns | 409.24 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 512 | 250.80 ns | 1.396 ns | 1.166 ns | 250.95 ns | 0.61 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 1024 | 779.09 ns | 13.954 ns | 14.931 ns | 780.14 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 1024 | 403.41 ns | 1.731 ns | 1.535 ns | 403.96 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 2048 | 1,556.52 ns | 30.470 ns | 31.290 ns | 1,552.79 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 2048 | 812.19 ns | 6.380 ns | 5.968 ns | 809.64 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.009 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 4096 | 2,993.58 ns | 59.371 ns | 55.535 ns | 2,998.68 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 4096 | 1,570.40 ns | 5.188 ns | 4.599 ns | 1,568.30 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.005 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 8192 | 5,809.74 ns | 94.215 ns | 88.129 ns | 5,828.90 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 8192 | 3,044.36 ns | 12.921 ns | 12.086 ns | 3,040.69 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 16384 | 57,222.34 ns | 955.294 ns | 893.583 ns | 57,463.63 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 16384 | 6,074.85 ns | 37.308 ns | 34.898 ns | 6,063.49 ns | 0.11 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 32768 | 112,636.45 ns | 799.662 ns | 748.004 ns | 112,834.00 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 32768 | 11,814.92 ns | 125.494 ns | 117.387 ns | 11,848.72 ns | 0.10 | 0.00 | 0.1984 | - | - | 432 B | 0.002 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 65536 | 118,274.82 ns | 2,309.363 ns | 2,160.179 ns | 118,526.20 ns | 1.00 | 0.00 | 128.1738 | 127.1973 | 127.1973 | 524906 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 65536 | 25,508.82 ns | 159.093 ns | 148.816 ns | 25,508.43 ns | 0.22 | 0.00 | 0.1831 | - | - | 432 B | 0.001 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 131072 | 305,165.82 ns | 5,645.224 ns | 7,536.212 ns | 306,644.53 ns | 1.00 | 0.00 | 201.1719 | 199.7070 | 199.7070 | 1048966 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 131072 | 51,560.28 ns | 290.496 ns | 271.730 ns | 51,541.61 ns | 0.17 | 0.00 | 0.1831 | - | - | 433 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 850000 | 2,760,485.70 ns | 54,392.679 ns | 99,460.090 ns | 2,781,955.27 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800191 B | 1.000 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 850000 | 1,131,329.19 ns | 8,418.126 ns | 7,874.320 ns | 1,127,444.82 ns | 0.42 | 0.02 | - | - | - | 445 B | 0.000 | -| | | | | | | | | | | | | | | | | -| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 90 | 87.90 ns | 1.332 ns | 1.246 ns | 87.64 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | -| Actual | RemoveAt_LastItems | List | RecyclableLongList | 90 | 115.23 ns | 1.347 ns | 1.260 ns | 115.09 ns | 1.31 | 0.02 | 0.0725 | - | - | 152 B | 0.20 | -
+# Parameter-less `constructor` +```CSharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1848/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.305 + [Host] : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 +``` +
+Empty Collection Creation Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | Mean | Error | StdDev | Ratio | Gen0 | Allocated | Alloc Ratio | +|--------- |--------- |------------- |------------------- |----------:|----------:|----------:|------:|-------:|----------:|------------:| +| Baseline | Create | List | Array | 6.667 ns | 0.0216 ns | 0.0180 ns | 1.00 | 0.0153 | 32 B | 1.00 | +| Actual | Create | List | Array | 5.204 ns | 0.0343 ns | 0.0304 ns | 0.78 | 0.0115 | 24 B | 0.75 | +| | | | | | | | | | | | +| Baseline | Create | List | PooledList | 6.383 ns | 0.0141 ns | 0.0118 ns | 1.00 | 0.0153 | 32 B | 1.00 | +| Actual | Create | List | PooledList | 11.740 ns | 0.0815 ns | 0.0681 ns | 1.84 | 0.0268 | 56 B | 1.75 | +| | | | | | | | | | | | +| Baseline | Create | List | RecyclableList | 6.721 ns | 0.0632 ns | 0.0528 ns | 1.00 | 0.0153 | 32 B | 1.00 | +| Actual | Create | List | RecyclableList | 9.081 ns | 0.0232 ns | 0.0206 ns | 1.35 | 0.0229 | 48 B | 1.50 | +| | | | | | | | | | | | +| Baseline | Create | List | RecyclableLongList | 6.624 ns | 0.0146 ns | 0.0130 ns | 1.00 | 0.0153 | 32 B | 1.00 | +| Actual | Create | List | RecyclableLongList | 28.379 ns | 0.0283 ns | 0.0221 ns | 4.28 | 0.0497 | 104 B | 3.25 | +
+ +# `constructor` with capacity parameter +```CSharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.400 + [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 +``` +
+Empty Collection with Desired Capacity Creation Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |-------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | Create_WithCapacity | List | Array | 0 | 8.794 ns | 0.0973 ns | 0.0862 ns | 8.771 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 0 | 6.510 ns | 0.0360 ns | 0.0337 ns | 6.508 ns | 0.74 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 1 | 11.175 ns | 0.0565 ns | 0.0501 ns | 11.193 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 1 | 6.103 ns | 0.0167 ns | 0.0148 ns | 6.101 ns | 0.55 | 0.00 | 0.0153 | - | - | 32 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 2 | 11.317 ns | 0.0374 ns | 0.0292 ns | 11.321 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 2 | 6.439 ns | 0.1524 ns | 0.1426 ns | 6.369 ns | 0.57 | 0.01 | 0.0191 | - | - | 40 B | 0.56 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 3 | 11.561 ns | 0.0775 ns | 0.0647 ns | 11.575 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 3 | 12.728 ns | 0.0275 ns | 0.0229 ns | 12.722 ns | 1.10 | 0.01 | 0.0229 | - | - | 48 B | 0.60 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 4 | 11.798 ns | 0.0975 ns | 0.0865 ns | 11.782 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 4 | 6.793 ns | 0.0227 ns | 0.0213 ns | 6.792 ns | 0.58 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 5 | 12.220 ns | 0.0901 ns | 0.0799 ns | 12.229 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 5 | 7.094 ns | 0.0372 ns | 0.0330 ns | 7.088 ns | 0.58 | 0.00 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 6 | 12.426 ns | 0.0283 ns | 0.0236 ns | 12.421 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 6 | 7.348 ns | 0.0262 ns | 0.0245 ns | 7.338 ns | 0.59 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 7 | 12.654 ns | 0.0336 ns | 0.0281 ns | 12.647 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 7 | 7.540 ns | 0.0343 ns | 0.0304 ns | 7.524 ns | 0.60 | 0.00 | 0.0383 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 8 | 12.856 ns | 0.0567 ns | 0.0530 ns | 12.848 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 8 | 7.775 ns | 0.0314 ns | 0.0278 ns | 7.765 ns | 0.60 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 9 | 13.117 ns | 0.0616 ns | 0.0546 ns | 13.111 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 9 | 8.018 ns | 0.0645 ns | 0.0572 ns | 8.003 ns | 0.61 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 10 | 13.193 ns | 0.0396 ns | 0.0330 ns | 13.186 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 10 | 8.194 ns | 0.0215 ns | 0.0201 ns | 8.188 ns | 0.62 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 11 | 13.527 ns | 0.0391 ns | 0.0326 ns | 13.516 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 11 | 8.378 ns | 0.0193 ns | 0.0161 ns | 8.378 ns | 0.62 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 12 | 13.802 ns | 0.0655 ns | 0.0613 ns | 13.783 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 12 | 8.611 ns | 0.0272 ns | 0.0242 ns | 8.607 ns | 0.62 | 0.00 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 13 | 14.053 ns | 0.0271 ns | 0.0253 ns | 14.050 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 13 | 8.925 ns | 0.0454 ns | 0.0425 ns | 8.899 ns | 0.64 | 0.00 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 14 | 14.341 ns | 0.0406 ns | 0.0380 ns | 14.331 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 14 | 9.128 ns | 0.0112 ns | 0.0099 ns | 9.126 ns | 0.64 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 15 | 14.612 ns | 0.0142 ns | 0.0111 ns | 14.610 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 15 | 9.349 ns | 0.0174 ns | 0.0162 ns | 9.352 ns | 0.64 | 0.00 | 0.0689 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 16 | 14.773 ns | 0.2429 ns | 0.2272 ns | 14.659 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 16 | 9.645 ns | 0.0356 ns | 0.0333 ns | 9.634 ns | 0.65 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 17 | 15.141 ns | 0.0370 ns | 0.0346 ns | 15.138 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 17 | 9.898 ns | 0.0296 ns | 0.0231 ns | 9.894 ns | 0.65 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 18 | 15.646 ns | 0.0735 ns | 0.0651 ns | 15.641 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 18 | 10.111 ns | 0.0378 ns | 0.0335 ns | 10.113 ns | 0.65 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 19 | 15.664 ns | 0.1044 ns | 0.0925 ns | 15.635 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 19 | 10.336 ns | 0.0323 ns | 0.0302 ns | 10.331 ns | 0.66 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 20 | 15.911 ns | 0.0350 ns | 0.0327 ns | 15.908 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 20 | 10.563 ns | 0.0624 ns | 0.0584 ns | 10.564 ns | 0.66 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 30 | 18.589 ns | 0.3573 ns | 0.3167 ns | 18.419 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 30 | 12.730 ns | 0.0198 ns | 0.0176 ns | 12.724 ns | 0.68 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 32 | 18.854 ns | 0.0193 ns | 0.0151 ns | 18.857 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 32 | 13.159 ns | 0.0293 ns | 0.0274 ns | 13.150 ns | 0.70 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 36 | 19.684 ns | 0.0371 ns | 0.0347 ns | 19.680 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 36 | 14.243 ns | 0.0368 ns | 0.0326 ns | 14.253 ns | 0.72 | 0.00 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 37 | 20.062 ns | 0.0431 ns | 0.0360 ns | 20.056 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 37 | 14.508 ns | 0.0213 ns | 0.0199 ns | 14.508 ns | 0.72 | 0.00 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 40 | 20.657 ns | 0.0654 ns | 0.0580 ns | 20.633 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Create_WithCapacity | List | Array | 40 | 21.004 ns | 0.0672 ns | 0.0596 ns | 21.001 ns | 1.02 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 40 | 15.015 ns | 0.0484 ns | 0.0404 ns | 15.003 ns | 0.73 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| Actual | Create_WithCapacity | List | Array | 40 | 15.370 ns | 0.0691 ns | 0.0613 ns | 15.355 ns | 0.74 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 50 | 23.358 ns | 0.0493 ns | 0.0412 ns | 23.359 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 50 | 17.535 ns | 0.0862 ns | 0.0764 ns | 17.537 ns | 0.75 | 0.00 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 60 | 25.770 ns | 0.1931 ns | 0.1807 ns | 25.768 ns | 1.00 | 0.00 | 0.2563 | - | - | 536 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 60 | 19.931 ns | 0.0535 ns | 0.0501 ns | 19.924 ns | 0.77 | 0.00 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 70 | 28.588 ns | 0.3963 ns | 0.3707 ns | 28.514 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 70 | 22.296 ns | 0.1300 ns | 0.1216 ns | 22.284 ns | 0.78 | 0.01 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 80 | 30.929 ns | 0.1715 ns | 0.1521 ns | 30.923 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 80 | 24.510 ns | 0.1309 ns | 0.1160 ns | 24.566 ns | 0.79 | 0.01 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 90 | 33.452 ns | 0.1287 ns | 0.1141 ns | 33.507 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 90 | 26.897 ns | 0.1334 ns | 0.1248 ns | 26.882 ns | 0.80 | 0.00 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 100 | 35.406 ns | 0.1847 ns | 0.1728 ns | 35.363 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 100 | 28.708 ns | 0.2343 ns | 0.2192 ns | 28.736 ns | 0.81 | 0.01 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 128 | 42.206 ns | 0.0955 ns | 0.0893 ns | 42.224 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 128 | 35.495 ns | 0.0463 ns | 0.0387 ns | 35.499 ns | 0.84 | 0.00 | 0.5010 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 256 | 72.286 ns | 0.2765 ns | 0.2586 ns | 72.235 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 256 | 62.502 ns | 0.0647 ns | 0.0573 ns | 62.511 ns | 0.86 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 512 | 129.920 ns | 0.3823 ns | 0.3389 ns | 129.956 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 512 | 120.251 ns | 0.3007 ns | 0.2511 ns | 120.299 ns | 0.93 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 1024 | 264.760 ns | 2.8477 ns | 2.6637 ns | 264.704 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 1024 | 248.010 ns | 0.5264 ns | 0.4667 ns | 248.174 ns | 0.94 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 2048 | 453.531 ns | 0.7149 ns | 0.6687 ns | 453.496 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 2048 | 432.982 ns | 0.6459 ns | 0.5725 ns | 432.802 ns | 0.95 | 0.00 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 4096 | 857.799 ns | 2.7053 ns | 2.2590 ns | 857.170 ns | 1.00 | 0.00 | 15.6240 | - | - | 32824 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 4096 | 807.757 ns | 1.2454 ns | 1.1040 ns | 807.645 ns | 0.94 | 0.00 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 8192 | 1,606.336 ns | 7.5581 ns | 6.7001 ns | 1,605.795 ns | 1.00 | 0.00 | 31.2481 | - | - | 65592 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 8192 | 1,518.664 ns | 8.2983 ns | 7.3563 ns | 1,517.190 ns | 0.95 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 16384 | 5,150.667 ns | 38.2438 ns | 33.9021 ns | 5,143.017 ns | 1.00 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131142 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 16384 | 5,088.226 ns | 35.8742 ns | 31.8015 ns | 5,099.274 ns | 0.99 | 0.01 | 41.6641 | 41.6641 | 41.6641 | 131110 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 32768 | 8,580.747 ns | 68.6504 ns | 60.8568 ns | 8,567.583 ns | 1.00 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262227 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 32768 | 8,542.554 ns | 43.5994 ns | 38.6497 ns | 8,537.675 ns | 1.00 | 0.01 | 83.3282 | 83.3282 | 83.3282 | 262196 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 65536 | 57,482.508 ns | 1,140.3677 ns | 3,043.8722 ns | 57,183.252 ns | 1.00 | 0.00 | 26.1841 | 26.0010 | 26.0010 | 524477 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 65536 | 56,901.088 ns | 1,136.4487 ns | 2,295.6824 ns | 56,687.024 ns | 0.99 | 0.07 | 14.5874 | 14.5874 | 14.5874 | 524312 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 131072 | 112,239.721 ns | 1,974.9606 ns | 2,425.4289 ns | 111,705.103 ns | 1.00 | 0.00 | 21.2402 | 21.1182 | 21.1182 | 1048713 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 131072 | 115,821.163 ns | 1,102.8526 ns | 1,031.6090 ns | 115,916.626 ns | 1.03 | 0.03 | 17.7002 | 17.7002 | 17.7002 | 1048602 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | Array | 850000 | 913,490.789 ns | 21,890.5845 ns | 59,554.9497 ns | 906,929.297 ns | 1.00 | 0.00 | 121.0938 | 121.0938 | 121.0938 | 6800554 B | 1.00 | +| Actual | Create_WithCapacity | List | Array | 850000 | 1,174,344.692 ns | 32,539.7651 ns | 93,884.6623 ns | 1,176,002.734 ns | 1.30 | 0.13 | 119.1406 | 119.1406 | 119.1406 | 6800060 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 0 | 8.532 ns | 0.0333 ns | 0.0311 ns | 8.521 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 0 | 14.699 ns | 0.0596 ns | 0.0529 ns | 14.685 ns | 1.72 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 1 | 11.067 ns | 0.0248 ns | 0.0193 ns | 11.070 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 1 | 40.743 ns | 0.3081 ns | 0.2882 ns | 40.775 ns | 3.68 | 0.03 | 0.0268 | - | - | 56 B | 0.88 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 2 | 11.326 ns | 0.0226 ns | 0.0200 ns | 11.328 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 2 | 40.432 ns | 0.2894 ns | 0.2707 ns | 40.490 ns | 3.57 | 0.03 | 0.0268 | - | - | 56 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 3 | 11.585 ns | 0.0800 ns | 0.0668 ns | 11.603 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 3 | 40.659 ns | 0.2042 ns | 0.1910 ns | 40.653 ns | 3.51 | 0.02 | 0.0268 | - | - | 56 B | 0.70 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 4 | 11.779 ns | 0.0831 ns | 0.0777 ns | 11.777 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 4 | 40.823 ns | 0.2985 ns | 0.2792 ns | 40.841 ns | 3.47 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 5 | 12.048 ns | 0.0429 ns | 0.0380 ns | 12.051 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 5 | 40.487 ns | 0.3611 ns | 0.3378 ns | 40.616 ns | 3.36 | 0.03 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 6 | 12.279 ns | 0.0378 ns | 0.0335 ns | 12.270 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 6 | 40.674 ns | 0.2628 ns | 0.2459 ns | 40.678 ns | 3.31 | 0.02 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 7 | 12.515 ns | 0.0426 ns | 0.0398 ns | 12.498 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 7 | 40.836 ns | 0.2591 ns | 0.2423 ns | 40.781 ns | 3.26 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 8 | 12.719 ns | 0.0210 ns | 0.0186 ns | 12.716 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 8 | 40.566 ns | 0.3832 ns | 0.3584 ns | 40.615 ns | 3.19 | 0.02 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 9 | 12.997 ns | 0.0327 ns | 0.0306 ns | 12.995 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 9 | 40.818 ns | 0.3113 ns | 0.2760 ns | 40.799 ns | 3.14 | 0.02 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 10 | 13.281 ns | 0.0371 ns | 0.0329 ns | 13.275 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 10 | 40.470 ns | 0.4647 ns | 0.3881 ns | 40.484 ns | 3.05 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 11 | 13.548 ns | 0.0475 ns | 0.0444 ns | 13.544 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 11 | 40.590 ns | 0.2013 ns | 0.1883 ns | 40.551 ns | 3.00 | 0.01 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 12 | 13.839 ns | 0.0283 ns | 0.0236 ns | 13.836 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 12 | 40.733 ns | 0.2969 ns | 0.2632 ns | 40.737 ns | 2.94 | 0.02 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 13 | 14.030 ns | 0.0327 ns | 0.0306 ns | 14.026 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 13 | 40.675 ns | 0.3296 ns | 0.3083 ns | 40.684 ns | 2.90 | 0.02 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 14 | 14.333 ns | 0.0412 ns | 0.0365 ns | 14.323 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 14 | 40.426 ns | 0.2263 ns | 0.2117 ns | 40.341 ns | 2.82 | 0.02 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 15 | 14.610 ns | 0.0283 ns | 0.0265 ns | 14.604 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 15 | 40.578 ns | 0.3183 ns | 0.2977 ns | 40.560 ns | 2.78 | 0.02 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 16 | 14.835 ns | 0.1649 ns | 0.1462 ns | 14.894 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 16 | 40.774 ns | 0.2925 ns | 0.2736 ns | 40.816 ns | 2.75 | 0.03 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 17 | 15.023 ns | 0.0222 ns | 0.0185 ns | 15.029 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 17 | 40.819 ns | 0.2867 ns | 0.2542 ns | 40.797 ns | 2.72 | 0.02 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 18 | 15.334 ns | 0.0851 ns | 0.0755 ns | 15.320 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 18 | 40.838 ns | 0.2213 ns | 0.2070 ns | 40.822 ns | 2.66 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 19 | 15.947 ns | 0.3424 ns | 0.3035 ns | 15.979 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 19 | 40.376 ns | 0.4533 ns | 0.4240 ns | 40.441 ns | 2.53 | 0.06 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 20 | 15.810 ns | 0.0401 ns | 0.0376 ns | 15.805 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 20 | 40.753 ns | 0.4456 ns | 0.4168 ns | 40.809 ns | 2.58 | 0.03 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 30 | 18.330 ns | 0.0754 ns | 0.0705 ns | 18.318 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 30 | 40.625 ns | 0.2963 ns | 0.2772 ns | 40.555 ns | 2.22 | 0.02 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 32 | 18.891 ns | 0.0729 ns | 0.0569 ns | 18.896 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 32 | 40.729 ns | 0.4086 ns | 0.3822 ns | 40.761 ns | 2.16 | 0.02 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 36 | 19.793 ns | 0.0560 ns | 0.0524 ns | 19.794 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 36 | 41.021 ns | 0.3923 ns | 0.3478 ns | 40.892 ns | 2.07 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 37 | 20.130 ns | 0.0920 ns | 0.0861 ns | 20.137 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 37 | 40.652 ns | 0.3785 ns | 0.3540 ns | 40.723 ns | 2.02 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 40 | 20.649 ns | 0.0436 ns | 0.0364 ns | 20.639 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Create_WithCapacity | List | PooledList | 40 | 20.800 ns | 0.0654 ns | 0.0580 ns | 20.786 ns | 1.01 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 40 | 40.907 ns | 0.3172 ns | 0.2967 ns | 40.901 ns | 1.98 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | Create_WithCapacity | List | PooledList | 40 | 40.571 ns | 0.4134 ns | 0.3452 ns | 40.717 ns | 1.96 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 50 | 23.080 ns | 0.0363 ns | 0.0322 ns | 23.075 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 50 | 40.648 ns | 0.3675 ns | 0.3438 ns | 40.683 ns | 1.76 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 60 | 25.713 ns | 0.0907 ns | 0.0849 ns | 25.676 ns | 1.00 | 0.00 | 0.2563 | - | - | 536 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 60 | 40.615 ns | 0.3634 ns | 0.3035 ns | 40.597 ns | 1.58 | 0.01 | 0.0268 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 70 | 27.885 ns | 0.0836 ns | 0.0741 ns | 27.854 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 70 | 40.901 ns | 0.2351 ns | 0.2199 ns | 40.905 ns | 1.47 | 0.01 | 0.0268 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 80 | 30.178 ns | 0.0845 ns | 0.0749 ns | 30.167 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 80 | 40.782 ns | 0.2986 ns | 0.2794 ns | 40.858 ns | 1.35 | 0.01 | 0.0268 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 850000 | 766,087.349 ns | 22,990.2438 ns | 66,698.8659 ns | 760,261.914 ns | 1.000 | 0.00 | 158.2031 | 158.2031 | 158.2031 | 6800374 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 850000 | 35.102 ns | 0.1324 ns | 0.1238 ns | 35.141 ns | 0.000 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 90 | 33.140 ns | 0.0557 ns | 0.0465 ns | 33.145 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 90 | 40.570 ns | 0.6301 ns | 0.5894 ns | 40.715 ns | 1.22 | 0.02 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 100 | 34.926 ns | 0.1141 ns | 0.1012 ns | 34.925 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 100 | 41.164 ns | 0.2153 ns | 0.2014 ns | 41.141 ns | 1.18 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 128 | 42.094 ns | 0.0520 ns | 0.0406 ns | 42.090 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 128 | 40.753 ns | 0.3205 ns | 0.2841 ns | 40.779 ns | 0.97 | 0.01 | 0.0268 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 256 | 71.258 ns | 0.1568 ns | 0.1309 ns | 71.293 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 256 | 36.677 ns | 0.0875 ns | 0.0731 ns | 36.675 ns | 0.51 | 0.00 | 0.0268 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 512 | 128.119 ns | 0.2293 ns | 0.2032 ns | 128.130 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | Create_WithCapacity | List | PooledList | 512 | 36.798 ns | 0.0783 ns | 0.0733 ns | 36.783 ns | 0.29 | 0.00 | 0.0268 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 1024 | 264.816 ns | 1.3197 ns | 1.1699 ns | 264.277 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 1024 | 36.877 ns | 0.1768 ns | 0.1654 ns | 36.821 ns | 0.14 | 0.00 | 0.0268 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 2048 | 459.156 ns | 1.0573 ns | 0.9373 ns | 458.881 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 2048 | 36.719 ns | 0.0682 ns | 0.0569 ns | 36.730 ns | 0.08 | 0.00 | 0.0268 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 4096 | 861.708 ns | 3.0492 ns | 2.8522 ns | 860.754 ns | 1.00 | 0.00 | 15.6240 | - | - | 32824 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 4096 | 36.942 ns | 0.1813 ns | 0.1514 ns | 36.904 ns | 0.04 | 0.00 | 0.0268 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 8192 | 1,622.517 ns | 6.0965 ns | 5.4044 ns | 1,621.396 ns | 1.00 | 0.00 | 31.2481 | - | - | 65592 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 8192 | 37.130 ns | 0.2061 ns | 0.1827 ns | 37.124 ns | 0.02 | 0.00 | 0.0268 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 16384 | 5,179.041 ns | 43.2041 ns | 40.4132 ns | 5,164.414 ns | 1.000 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131142 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 16384 | 34.978 ns | 0.1481 ns | 0.1313 ns | 34.939 ns | 0.007 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 32768 | 8,650.943 ns | 44.3956 ns | 39.3556 ns | 8,651.624 ns | 1.000 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262228 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 32768 | 35.368 ns | 0.3100 ns | 0.2748 ns | 35.280 ns | 0.004 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 65536 | 57,316.758 ns | 1,143.6954 ns | 2,581.5111 ns | 57,381.525 ns | 1.000 | 0.00 | 20.7520 | 20.6299 | 20.6299 | 524437 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 65536 | 34.845 ns | 0.0610 ns | 0.0541 ns | 34.838 ns | 0.001 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | PooledList | 131072 | 115,216.456 ns | 2,240.4536 ns | 2,397.2603 ns | 115,155.756 ns | 1.000 | 0.00 | 21.4844 | 21.3623 | 21.3623 | 1048716 B | 1.000 | +| Actual | Create_WithCapacity | List | PooledList | 131072 | 34.654 ns | 0.0571 ns | 0.0506 ns | 34.657 ns | 0.000 | 0.00 | 0.0268 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 0 | 8.572 ns | 0.0362 ns | 0.0283 ns | 8.560 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 0 | 15.491 ns | 0.0393 ns | 0.0367 ns | 15.478 ns | 1.81 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 1 | 11.291 ns | 0.0663 ns | 0.0620 ns | 11.254 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 1 | 15.079 ns | 0.0994 ns | 0.0930 ns | 15.087 ns | 1.34 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 2 | 11.540 ns | 0.0748 ns | 0.0663 ns | 11.540 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 2 | 15.058 ns | 0.0966 ns | 0.0754 ns | 15.084 ns | 1.30 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 3 | 11.784 ns | 0.0681 ns | 0.0637 ns | 11.809 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 3 | 15.021 ns | 0.0457 ns | 0.0405 ns | 15.014 ns | 1.27 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 4 | 11.928 ns | 0.0155 ns | 0.0121 ns | 11.931 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 4 | 15.660 ns | 0.1204 ns | 0.1126 ns | 15.593 ns | 1.31 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 5 | 12.274 ns | 0.0716 ns | 0.0670 ns | 12.243 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 5 | 15.716 ns | 0.0260 ns | 0.0203 ns | 15.716 ns | 1.28 | 0.01 | 0.0536 | - | - | 112 B | 1.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 6 | 12.655 ns | 0.0843 ns | 0.0788 ns | 12.630 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 6 | 16.132 ns | 0.0405 ns | 0.0338 ns | 16.126 ns | 1.27 | 0.01 | 0.0574 | - | - | 120 B | 1.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 7 | 12.865 ns | 0.0880 ns | 0.0824 ns | 12.832 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 7 | 16.432 ns | 0.0837 ns | 0.0742 ns | 16.397 ns | 1.28 | 0.01 | 0.0612 | - | - | 128 B | 1.14 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 8 | 13.071 ns | 0.0490 ns | 0.0434 ns | 13.057 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 8 | 16.742 ns | 0.0843 ns | 0.0788 ns | 16.728 ns | 1.28 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 9 | 13.327 ns | 0.0606 ns | 0.0473 ns | 13.318 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 9 | 17.032 ns | 0.1103 ns | 0.0921 ns | 17.011 ns | 1.28 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 10 | 22.303 ns | 0.2637 ns | 0.2466 ns | 22.183 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 10 | 17.333 ns | 0.2533 ns | 0.2246 ns | 17.200 ns | 0.78 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 11 | 14.571 ns | 0.0288 ns | 0.0255 ns | 14.570 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 11 | 17.700 ns | 0.1704 ns | 0.1594 ns | 17.697 ns | 1.22 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 12 | 14.080 ns | 0.0500 ns | 0.0467 ns | 14.072 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 12 | 17.894 ns | 0.1682 ns | 0.1573 ns | 17.913 ns | 1.27 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 13 | 14.443 ns | 0.0596 ns | 0.0557 ns | 14.417 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 13 | 18.104 ns | 0.0554 ns | 0.0491 ns | 18.097 ns | 1.25 | 0.01 | 0.0842 | - | - | 176 B | 1.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 14 | 14.667 ns | 0.0484 ns | 0.0429 ns | 14.670 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 14 | 18.267 ns | 0.1232 ns | 0.1028 ns | 18.230 ns | 1.25 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 15 | 15.070 ns | 0.1371 ns | 0.1283 ns | 15.050 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 15 | 18.682 ns | 0.0388 ns | 0.0324 ns | 18.676 ns | 1.24 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 16 | 15.157 ns | 0.1678 ns | 0.1570 ns | 15.197 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 16 | 18.855 ns | 0.1278 ns | 0.1133 ns | 18.797 ns | 1.24 | 0.02 | 0.0956 | - | - | 200 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 17 | 15.600 ns | 0.1292 ns | 0.1145 ns | 15.574 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 17 | 19.510 ns | 0.3931 ns | 0.3282 ns | 19.417 ns | 1.25 | 0.02 | 0.0995 | - | - | 208 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 18 | 15.658 ns | 0.0641 ns | 0.0536 ns | 15.645 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 18 | 19.451 ns | 0.2090 ns | 0.1955 ns | 19.357 ns | 1.24 | 0.02 | 0.1033 | - | - | 216 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 19 | 15.841 ns | 0.0672 ns | 0.0629 ns | 15.826 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 19 | 19.854 ns | 0.1596 ns | 0.1333 ns | 19.855 ns | 1.25 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 20 | 16.223 ns | 0.0930 ns | 0.0870 ns | 16.217 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 20 | 19.784 ns | 0.0589 ns | 0.0492 ns | 19.772 ns | 1.22 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 30 | 18.746 ns | 0.0851 ns | 0.0755 ns | 18.745 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 30 | 23.656 ns | 0.4590 ns | 1.1260 ns | 23.077 ns | 1.28 | 0.06 | 0.1492 | - | - | 312 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 32 | 19.269 ns | 0.0728 ns | 0.0645 ns | 19.287 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 32 | 23.036 ns | 0.1317 ns | 0.1232 ns | 23.039 ns | 1.20 | 0.01 | 0.1568 | - | - | 328 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 36 | 20.292 ns | 0.0466 ns | 0.0364 ns | 20.302 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 36 | 24.311 ns | 0.1388 ns | 0.1299 ns | 24.275 ns | 1.20 | 0.01 | 0.1721 | - | - | 360 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 37 | 26.710 ns | 0.5518 ns | 0.7913 ns | 26.489 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 37 | 28.807 ns | 0.3520 ns | 0.3292 ns | 28.745 ns | 1.06 | 0.03 | 0.0382 | - | - | 80 B | 0.23 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 40 | 28.402 ns | 0.4691 ns | 0.4388 ns | 28.495 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Create_WithCapacity | List | RecyclableList | 40 | 28.804 ns | 0.3662 ns | 0.3426 ns | 28.891 ns | 1.01 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 40 | 28.496 ns | 0.1235 ns | 0.0964 ns | 28.516 ns | 1.00 | 0.01 | 0.0382 | - | - | 80 B | 0.21 | +| Actual | Create_WithCapacity | List | RecyclableList | 40 | 29.178 ns | 0.1820 ns | 0.1703 ns | 29.140 ns | 1.03 | 0.02 | 0.0382 | - | - | 80 B | 0.21 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 50 | 32.370 ns | 0.6696 ns | 0.6264 ns | 32.241 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 50 | 27.715 ns | 0.0843 ns | 0.0658 ns | 27.719 ns | 0.86 | 0.01 | 0.0382 | - | - | 80 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 60 | 36.875 ns | 0.5662 ns | 0.5296 ns | 36.914 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 60 | 28.580 ns | 0.1273 ns | 0.1191 ns | 28.583 ns | 0.78 | 0.01 | 0.0382 | - | - | 80 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 70 | 40.701 ns | 0.7455 ns | 0.6608 ns | 40.675 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 70 | 27.998 ns | 0.3049 ns | 0.2852 ns | 28.000 ns | 0.69 | 0.01 | 0.0382 | - | - | 80 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 80 | 46.181 ns | 0.5498 ns | 0.5143 ns | 46.283 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 80 | 28.905 ns | 0.1872 ns | 0.1751 ns | 28.906 ns | 0.63 | 0.01 | 0.0382 | - | - | 80 B | 0.11 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 90 | 48.275 ns | 0.5940 ns | 0.5265 ns | 48.186 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 90 | 28.154 ns | 0.5105 ns | 0.4775 ns | 28.004 ns | 0.58 | 0.01 | 0.0382 | - | - | 80 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 100 | 53.034 ns | 0.9229 ns | 0.8633 ns | 53.176 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 100 | 27.663 ns | 0.1570 ns | 0.1311 ns | 27.633 ns | 0.52 | 0.01 | 0.0382 | - | - | 80 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 128 | 60.282 ns | 0.9462 ns | 0.8851 ns | 60.049 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 128 | 28.745 ns | 0.5088 ns | 0.4759 ns | 28.494 ns | 0.48 | 0.01 | 0.0382 | - | - | 80 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 256 | 109.375 ns | 2.2369 ns | 3.3481 ns | 109.297 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 256 | 27.895 ns | 0.3189 ns | 0.2827 ns | 27.816 ns | 0.25 | 0.00 | 0.0382 | - | - | 80 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 512 | 209.704 ns | 4.0963 ns | 4.5530 ns | 208.877 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableList | 512 | 28.814 ns | 0.1983 ns | 0.1757 ns | 28.867 ns | 0.14 | 0.00 | 0.0382 | - | - | 80 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 1024 | 417.485 ns | 7.5967 ns | 7.1059 ns | 416.094 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 1024 | 27.821 ns | 0.1536 ns | 0.1362 ns | 27.817 ns | 0.07 | 0.00 | 0.0382 | - | - | 80 B | 0.010 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 2048 | 761.447 ns | 13.2713 ns | 11.7646 ns | 760.725 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 2048 | 28.788 ns | 0.1512 ns | 0.1262 ns | 28.789 ns | 0.04 | 0.00 | 0.0382 | - | - | 80 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 4096 | 1,504.779 ns | 29.8901 ns | 27.9593 ns | 1,498.650 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 4096 | 29.377 ns | 0.0983 ns | 0.0920 ns | 29.331 ns | 0.02 | 0.00 | 0.0382 | - | - | 80 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 8192 | 2,851.462 ns | 56.1910 ns | 55.1871 ns | 2,849.142 ns | 1.000 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 8192 | 27.906 ns | 0.2526 ns | 0.2363 ns | 27.907 ns | 0.010 | 0.00 | 0.0382 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 16384 | 7,021.374 ns | 136.5100 ns | 134.0711 ns | 7,048.221 ns | 1.000 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131154 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 16384 | 28.812 ns | 0.4457 ns | 0.4169 ns | 28.846 ns | 0.004 | 0.00 | 0.0382 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 32768 | 12,082.734 ns | 232.6650 ns | 217.6349 ns | 12,154.080 ns | 1.000 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262252 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 32768 | 28.093 ns | 0.0981 ns | 0.0917 ns | 28.094 ns | 0.002 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 65536 | 55,237.774 ns | 1,087.9834 ns | 3,086.4278 ns | 54,824.014 ns | 1.000 | 0.00 | 15.1978 | 15.0757 | 15.0757 | 524410 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 65536 | 28.349 ns | 0.3804 ns | 0.3559 ns | 28.364 ns | 0.001 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 131072 | 111,970.124 ns | 2,235.3755 ns | 2,484.6139 ns | 111,622.583 ns | 1.000 | 0.00 | 18.0664 | 18.0664 | 18.0664 | 1048668 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 131072 | 28.695 ns | 0.5393 ns | 0.5045 ns | 28.595 ns | 0.000 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableList | 850000 | 624,614.489 ns | 12,330.2167 ns | 30,246.2317 ns | 627,941.406 ns | 1.000 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800113 B | 1.000 | +| Actual | Create_WithCapacity | List | RecyclableList | 850000 | 28.988 ns | 0.0957 ns | 0.0848 ns | 28.985 ns | 0.000 | 0.00 | 0.0382 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 0 | 8.641 ns | 0.1799 ns | 0.1683 ns | 8.567 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 0 | 16.675 ns | 0.0816 ns | 0.0724 ns | 16.657 ns | 1.94 | 0.03 | 0.0382 | - | - | 80 B | 2.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 1 | 11.506 ns | 0.0147 ns | 0.0123 ns | 11.503 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 1 | 29.047 ns | 0.1217 ns | 0.1016 ns | 29.028 ns | 2.52 | 0.01 | 0.0688 | - | - | 144 B | 2.25 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 2 | 11.791 ns | 0.0239 ns | 0.0224 ns | 11.784 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 2 | 29.615 ns | 0.1361 ns | 0.1206 ns | 29.622 ns | 2.51 | 0.01 | 0.0727 | - | - | 152 B | 2.11 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 3 | 11.952 ns | 0.0637 ns | 0.0565 ns | 11.950 ns | 1.00 | 0.00 | 0.0383 | - | - | 80 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 3 | 30.131 ns | 0.2189 ns | 0.1940 ns | 30.117 ns | 2.52 | 0.02 | 0.0803 | - | - | 168 B | 2.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 4 | 12.282 ns | 0.0636 ns | 0.0595 ns | 12.248 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 4 | 30.828 ns | 0.2745 ns | 0.2567 ns | 30.743 ns | 2.51 | 0.03 | 0.0803 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 5 | 12.525 ns | 0.0186 ns | 0.0165 ns | 12.520 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 5 | 31.648 ns | 0.2236 ns | 0.2092 ns | 31.576 ns | 2.53 | 0.02 | 0.0956 | - | - | 200 B | 2.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 6 | 12.921 ns | 0.0307 ns | 0.0256 ns | 12.921 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 6 | 31.500 ns | 0.0995 ns | 0.0882 ns | 31.495 ns | 2.44 | 0.01 | 0.0956 | - | - | 200 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 7 | 13.165 ns | 0.0488 ns | 0.0407 ns | 13.154 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 7 | 31.508 ns | 0.2525 ns | 0.2238 ns | 31.529 ns | 2.39 | 0.02 | 0.0956 | - | - | 200 B | 1.79 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 8 | 13.364 ns | 0.0236 ns | 0.0209 ns | 13.366 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 8 | 32.238 ns | 0.2959 ns | 0.2471 ns | 32.220 ns | 2.41 | 0.02 | 0.0956 | - | - | 200 B | 1.67 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 9 | 13.484 ns | 0.0330 ns | 0.0309 ns | 13.482 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 9 | 33.752 ns | 0.5185 ns | 0.4850 ns | 33.546 ns | 2.50 | 0.03 | 0.1262 | - | - | 264 B | 2.06 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 10 | 13.865 ns | 0.0312 ns | 0.0277 ns | 13.857 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 10 | 33.121 ns | 0.5487 ns | 0.5133 ns | 33.074 ns | 2.39 | 0.04 | 0.1262 | - | - | 264 B | 1.94 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 11 | 14.326 ns | 0.0662 ns | 0.0587 ns | 14.309 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 11 | 33.160 ns | 0.5840 ns | 0.5463 ns | 32.932 ns | 2.32 | 0.04 | 0.1262 | - | - | 264 B | 1.83 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 12 | 14.550 ns | 0.0369 ns | 0.0327 ns | 14.540 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 12 | 33.213 ns | 0.5252 ns | 0.4913 ns | 33.228 ns | 2.28 | 0.03 | 0.1262 | - | - | 264 B | 1.74 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 13 | 14.884 ns | 0.0403 ns | 0.0337 ns | 14.873 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 13 | 34.242 ns | 0.7002 ns | 0.7783 ns | 34.615 ns | 2.29 | 0.05 | 0.1262 | - | - | 264 B | 1.65 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 14 | 15.208 ns | 0.0449 ns | 0.0398 ns | 15.204 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 14 | 33.231 ns | 0.6229 ns | 0.5826 ns | 33.077 ns | 2.19 | 0.04 | 0.1262 | - | - | 264 B | 1.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 15 | 15.484 ns | 0.0658 ns | 0.0514 ns | 15.493 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 15 | 33.510 ns | 0.5161 ns | 0.4575 ns | 33.307 ns | 2.17 | 0.03 | 0.1262 | - | - | 264 B | 1.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 16 | 15.512 ns | 0.1294 ns | 0.1210 ns | 15.574 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 16 | 34.181 ns | 0.7008 ns | 1.2990 ns | 33.818 ns | 2.22 | 0.11 | 0.1262 | - | - | 264 B | 1.43 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 17 | 16.013 ns | 0.0860 ns | 0.0762 ns | 15.992 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 17 | 37.798 ns | 0.1380 ns | 0.1223 ns | 37.818 ns | 2.36 | 0.01 | 0.1874 | - | - | 392 B | 2.04 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 18 | 16.060 ns | 0.0304 ns | 0.0270 ns | 16.059 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 18 | 38.251 ns | 0.4169 ns | 0.3900 ns | 38.144 ns | 2.38 | 0.02 | 0.1874 | - | - | 392 B | 1.96 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 19 | 16.508 ns | 0.0541 ns | 0.0423 ns | 16.502 ns | 1.00 | 0.00 | 0.0995 | - | - | 208 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 19 | 39.055 ns | 0.7917 ns | 0.8472 ns | 38.831 ns | 2.36 | 0.05 | 0.1874 | - | - | 392 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 20 | 16.729 ns | 0.0531 ns | 0.0471 ns | 16.725 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 20 | 38.159 ns | 0.3399 ns | 0.3179 ns | 38.146 ns | 2.28 | 0.02 | 0.1874 | - | - | 392 B | 1.81 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 30 | 19.820 ns | 0.2157 ns | 0.1912 ns | 19.733 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 30 | 38.634 ns | 0.2544 ns | 0.2255 ns | 38.687 ns | 1.95 | 0.02 | 0.1874 | - | - | 392 B | 1.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 32 | 20.022 ns | 0.0943 ns | 0.0836 ns | 20.034 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 32 | 38.758 ns | 0.2123 ns | 0.1882 ns | 38.774 ns | 1.94 | 0.01 | 0.1874 | - | - | 392 B | 1.26 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 36 | 27.208 ns | 0.2772 ns | 0.2457 ns | 27.279 ns | 1.00 | 0.00 | 0.1645 | - | - | 344 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 36 | 61.496 ns | 1.2087 ns | 1.1306 ns | 61.464 ns | 2.26 | 0.05 | 0.3098 | - | - | 648 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 37 | 27.537 ns | 0.3722 ns | 0.3482 ns | 27.531 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 37 | 61.433 ns | 0.9491 ns | 0.8878 ns | 61.194 ns | 2.23 | 0.05 | 0.3098 | - | - | 648 B | 1.84 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 40 | 28.330 ns | 0.5843 ns | 0.6955 ns | 28.032 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 40 | 28.585 ns | 0.5161 ns | 0.4827 ns | 28.796 ns | 1.00 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 40 | 61.108 ns | 0.6814 ns | 0.5690 ns | 60.823 ns | 2.14 | 0.07 | 0.3098 | - | - | 648 B | 1.72 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 40 | 62.167 ns | 1.2413 ns | 1.1611 ns | 62.343 ns | 2.18 | 0.05 | 0.3098 | - | - | 648 B | 1.72 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 50 | 33.311 ns | 0.6371 ns | 0.5959 ns | 33.070 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 50 | 61.894 ns | 1.1607 ns | 1.0857 ns | 61.574 ns | 1.86 | 0.05 | 0.3098 | - | - | 648 B | 1.42 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 60 | 37.306 ns | 0.4483 ns | 0.4193 ns | 37.300 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 60 | 62.291 ns | 0.9605 ns | 0.8985 ns | 62.322 ns | 1.67 | 0.03 | 0.3098 | - | - | 648 B | 1.21 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 70 | 41.206 ns | 0.7348 ns | 0.6873 ns | 41.165 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 70 | 91.764 ns | 1.2975 ns | 1.2137 ns | 91.984 ns | 2.23 | 0.06 | 0.5546 | - | - | 1160 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 80 | 45.392 ns | 0.8333 ns | 0.7795 ns | 45.526 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 80 | 90.164 ns | 1.0799 ns | 1.0102 ns | 90.655 ns | 1.99 | 0.05 | 0.5546 | - | - | 1160 B | 1.67 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 850000 | 656,947.360 ns | 17,787.5241 ns | 50,460.2454 ns | 636,222.461 ns | 1.00 | 0.00 | 123.0469 | 123.0469 | 123.0469 | 6800745 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 850000 | 1,496,298.889 ns | 43,206.4617 ns | 126,717.0728 ns | 1,494,900.391 ns | 2.27 | 0.25 | 119.1406 | 119.1406 | 119.1406 | 8389274 B | 1.23 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 90 | 48.629 ns | 0.6893 ns | 0.6448 ns | 48.563 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 90 | 88.859 ns | 1.1700 ns | 1.0944 ns | 89.597 ns | 1.83 | 0.04 | 0.5546 | - | - | 1160 B | 1.49 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 100 | 52.691 ns | 0.6591 ns | 0.6165 ns | 52.714 ns | 1.00 | 0.00 | 0.4093 | - | - | 856 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 100 | 92.634 ns | 1.3756 ns | 1.2867 ns | 92.696 ns | 1.76 | 0.03 | 0.5546 | - | - | 1160 B | 1.36 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 128 | 62.371 ns | 1.0562 ns | 0.9880 ns | 62.038 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 128 | 90.946 ns | 1.0812 ns | 1.0114 ns | 91.301 ns | 1.46 | 0.03 | 0.5546 | - | - | 1160 B | 1.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 256 | 114.528 ns | 1.9599 ns | 1.8333 ns | 115.153 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 256 | 140.498 ns | 2.7854 ns | 2.6055 ns | 140.287 ns | 1.23 | 0.03 | 1.0438 | - | - | 2184 B | 1.04 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 512 | 210.072 ns | 4.1622 ns | 5.1115 ns | 210.196 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 512 | 239.950 ns | 1.8626 ns | 1.6511 ns | 240.120 ns | 1.13 | 0.03 | 2.0199 | - | - | 4232 B | 1.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 1024 | 406.188 ns | 7.9887 ns | 11.9571 ns | 402.896 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 1024 | 455.595 ns | 9.0528 ns | 14.8740 ns | 454.604 ns | 1.13 | 0.03 | 3.9840 | - | - | 8328 B | 1.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 2048 | 755.290 ns | 14.8358 ns | 13.8774 ns | 760.330 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 2048 | 821.697 ns | 14.4337 ns | 13.5013 ns | 823.052 ns | 1.09 | 0.03 | 7.8735 | - | - | 16520 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 4096 | 1,521.324 ns | 29.2983 ns | 27.4056 ns | 1,519.864 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 4096 | 1,539.423 ns | 28.8659 ns | 29.6432 ns | 1,540.028 ns | 1.01 | 0.02 | 15.6250 | - | - | 32904 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 8192 | 2,889.058 ns | 56.5863 ns | 79.3261 ns | 2,877.317 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 8192 | 2,982.358 ns | 57.8507 ns | 64.3009 ns | 2,997.111 ns | 1.03 | 0.03 | 31.2462 | - | - | 65672 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 16384 | 6,967.153 ns | 130.2541 ns | 127.9270 ns | 7,000.579 ns | 1.00 | 0.00 | 41.6641 | 41.6641 | 41.6641 | 131154 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 16384 | 6,318.139 ns | 124.8858 ns | 246.5123 ns | 6,184.764 ns | 0.90 | 0.04 | 62.4847 | 0.0153 | - | 131432 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 32768 | 12,260.303 ns | 226.3066 ns | 222.2634 ns | 12,298.917 ns | 1.00 | 0.00 | 83.3282 | 83.3282 | 83.3282 | 262251 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 32768 | 23,504.992 ns | 1,276.0641 ns | 3,762.5039 ns | 24,730.835 ns | 1.88 | 0.34 | 83.2825 | 27.7405 | - | 262504 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 65536 | 56,509.341 ns | 1,127.7672 ns | 1,788.7583 ns | 56,217.896 ns | 1.00 | 0.00 | 16.9067 | 16.7847 | 16.7847 | 524409 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 65536 | 59,968.457 ns | 2,929.5848 ns | 8,637.9469 ns | 55,217.700 ns | 1.10 | 0.16 | 150.0244 | 49.9268 | - | 524649 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Create_WithCapacity | List | RecyclableLongList | 131072 | 114,768.456 ns | 1,955.0600 ns | 1,632.5637 ns | 114,705.005 ns | 1.00 | 0.00 | 17.7002 | 17.5781 | 17.5781 | 1048680 B | 1.00 | +| Actual | Create_WithCapacity | List | RecyclableLongList | 131072 | 129,203.260 ns | 2,555.1942 ns | 3,745.3706 ns | 130,198.633 ns | 1.12 | 0.03 | 144.5313 | 143.3105 | 143.3105 | 1049772 B | 1.00 | +
+ +# `Add` Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1848/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.305 + [Host] : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 +``` + +
+Add to the List by 1 Item Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------- |------------- |------------------- |---------------- |-----------------:|----------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|-----------:|------------:| +| Baseline | Add | List | Array | 0 | 8.033 ns | 0.0382 ns | 0.0339 ns | 8.023 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Add | List | Array | 0 | 6.741 ns | 0.0160 ns | 0.0142 ns | 6.741 ns | 0.84 | 0.00 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 1 | 17.455 ns | 0.0980 ns | 0.0916 ns | 17.423 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | Array | 1 | 7.369 ns | 0.0102 ns | 0.0090 ns | 7.370 ns | 0.42 | 0.00 | 0.0153 | - | - | 32 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 2 | 18.813 ns | 0.1189 ns | 0.1112 ns | 18.843 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | Array | 2 | 8.087 ns | 0.1802 ns | 0.1686 ns | 8.061 ns | 0.43 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 3 | 20.091 ns | 0.0246 ns | 0.0205 ns | 20.094 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | Array | 3 | 9.195 ns | 0.1377 ns | 0.1221 ns | 9.222 ns | 0.46 | 0.01 | 0.0229 | - | - | 48 B | 0.55 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 4 | 21.729 ns | 0.2308 ns | 0.2159 ns | 21.673 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | Array | 4 | 9.084 ns | 0.0479 ns | 0.0448 ns | 9.062 ns | 0.42 | 0.00 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 5 | 36.580 ns | 0.2406 ns | 0.2250 ns | 36.483 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | Array | 5 | 11.402 ns | 0.2552 ns | 0.5438 ns | 11.540 ns | 0.31 | 0.02 | 0.0306 | - | - | 64 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 6 | 37.636 ns | 0.3012 ns | 0.2670 ns | 37.529 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | Array | 6 | 11.036 ns | 0.2219 ns | 0.2076 ns | 10.944 ns | 0.29 | 0.01 | 0.0344 | - | - | 72 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 7 | 39.535 ns | 0.8012 ns | 1.0133 ns | 38.880 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | Array | 7 | 12.411 ns | 0.2758 ns | 0.4830 ns | 12.560 ns | 0.32 | 0.02 | 0.0383 | - | - | 80 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 8 | 40.353 ns | 0.0906 ns | 0.0803 ns | 40.361 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | Array | 8 | 11.993 ns | 0.0298 ns | 0.0264 ns | 11.995 ns | 0.30 | 0.00 | 0.0421 | - | - | 88 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 9 | 56.600 ns | 0.0942 ns | 0.0835 ns | 56.582 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 9 | 12.769 ns | 0.1302 ns | 0.1154 ns | 12.724 ns | 0.23 | 0.00 | 0.0459 | - | - | 96 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 10 | 57.839 ns | 0.0755 ns | 0.0589 ns | 57.832 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 10 | 13.175 ns | 0.0206 ns | 0.0161 ns | 13.177 ns | 0.23 | 0.00 | 0.0497 | - | - | 104 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 11 | 58.288 ns | 0.1512 ns | 0.1415 ns | 58.341 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 11 | 13.790 ns | 0.1009 ns | 0.0894 ns | 13.759 ns | 0.24 | 0.00 | 0.0536 | - | - | 112 B | 0.34 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 12 | 59.575 ns | 0.6993 ns | 0.5839 ns | 59.379 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 12 | 14.724 ns | 0.0201 ns | 0.0188 ns | 14.726 ns | 0.25 | 0.00 | 0.0574 | - | - | 120 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 13 | 60.561 ns | 0.1263 ns | 0.1181 ns | 60.518 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 13 | 14.858 ns | 0.0357 ns | 0.0316 ns | 14.855 ns | 0.25 | 0.00 | 0.0612 | - | - | 128 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 14 | 62.597 ns | 0.1452 ns | 0.1287 ns | 62.546 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 14 | 15.422 ns | 0.0164 ns | 0.0145 ns | 15.418 ns | 0.25 | 0.00 | 0.0650 | - | - | 136 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 15 | 62.490 ns | 0.1796 ns | 0.1592 ns | 62.422 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 15 | 16.053 ns | 0.0252 ns | 0.0223 ns | 16.050 ns | 0.26 | 0.00 | 0.0688 | - | - | 144 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 16 | 63.315 ns | 0.1435 ns | 0.1272 ns | 63.303 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | Array | 16 | 16.534 ns | 0.0716 ns | 0.0670 ns | 16.541 ns | 0.26 | 0.00 | 0.0727 | - | - | 152 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 17 | 87.500 ns | 0.2475 ns | 0.2315 ns | 87.514 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | Array | 17 | 17.084 ns | 0.1716 ns | 0.1606 ns | 17.092 ns | 0.20 | 0.00 | 0.0765 | - | - | 160 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 18 | 89.031 ns | 0.5091 ns | 0.4762 ns | 88.915 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | Array | 18 | 17.642 ns | 0.1828 ns | 0.1710 ns | 17.588 ns | 0.20 | 0.00 | 0.0803 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 19 | 89.654 ns | 0.7483 ns | 0.6999 ns | 89.320 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | Array | 19 | 18.101 ns | 0.0776 ns | 0.0688 ns | 18.088 ns | 0.20 | 0.00 | 0.0842 | - | - | 176 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 20 | 90.061 ns | 0.1295 ns | 0.1211 ns | 90.023 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | Array | 20 | 18.400 ns | 0.0403 ns | 0.0336 ns | 18.394 ns | 0.20 | 0.00 | 0.0880 | - | - | 184 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 30 | 104.068 ns | 0.0708 ns | 0.0627 ns | 104.084 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | Array | 30 | 25.608 ns | 0.1295 ns | 0.1148 ns | 25.633 ns | 0.25 | 0.00 | 0.1262 | - | - | 264 B | 0.43 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 32 | 108.695 ns | 0.1806 ns | 0.1601 ns | 108.655 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | Array | 32 | 24.860 ns | 0.1925 ns | 0.1801 ns | 24.795 ns | 0.23 | 0.00 | 0.1339 | - | - | 280 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 36 | 138.552 ns | 0.7358 ns | 0.6883 ns | 138.185 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | Array | 36 | 27.468 ns | 0.1945 ns | 0.1518 ns | 27.473 ns | 0.20 | 0.00 | 0.1492 | - | - | 312 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 37 | 142.248 ns | 0.2908 ns | 0.2578 ns | 142.181 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | Array | 37 | 27.628 ns | 0.0348 ns | 0.0309 ns | 27.627 ns | 0.19 | 0.00 | 0.1530 | - | - | 320 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 40 | 142.819 ns | 0.4148 ns | 0.3677 ns | 142.795 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Baseline | Add | List | Array | 40 | 146.721 ns | 0.2889 ns | 0.2412 ns | 146.835 ns | 1.03 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | Array | 40 | 29.512 ns | 0.1310 ns | 0.1161 ns | 29.535 ns | 0.21 | 0.00 | 0.1644 | - | - | 344 B | 0.30 | +| Actual | Add | List | Array | 40 | 29.541 ns | 0.0862 ns | 0.0764 ns | 29.555 ns | 0.21 | 0.00 | 0.1644 | - | - | 344 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 50 | 164.659 ns | 0.2573 ns | 0.2148 ns | 164.684 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | Array | 50 | 34.893 ns | 0.0448 ns | 0.0419 ns | 34.898 ns | 0.21 | 0.00 | 0.2027 | - | - | 424 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 60 | 180.790 ns | 0.2945 ns | 0.2299 ns | 180.719 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | Array | 60 | 40.447 ns | 0.1116 ns | 0.0932 ns | 40.417 ns | 0.22 | 0.00 | 0.2410 | - | - | 504 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 70 | 238.612 ns | 0.7258 ns | 0.6434 ns | 238.608 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | Array | 70 | 46.006 ns | 0.0326 ns | 0.0289 ns | 46.000 ns | 0.19 | 0.00 | 0.2792 | - | - | 584 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 80 | 259.791 ns | 0.6094 ns | 0.5700 ns | 259.671 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | Array | 80 | 51.788 ns | 0.0679 ns | 0.0602 ns | 51.788 ns | 0.20 | 0.00 | 0.3175 | - | - | 664 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 90 | 276.018 ns | 0.8256 ns | 0.7722 ns | 276.131 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | Array | 90 | 64.024 ns | 0.0708 ns | 0.0627 ns | 64.020 ns | 0.23 | 0.00 | 0.3557 | - | - | 744 B | 0.34 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 100 | 294.046 ns | 0.1864 ns | 0.1652 ns | 294.023 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | Array | 100 | 69.580 ns | 0.2511 ns | 0.2226 ns | 69.481 ns | 0.24 | 0.00 | 0.3940 | - | - | 824 B | 0.38 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 128 | 369.921 ns | 1.6578 ns | 1.5507 ns | 369.718 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | Array | 128 | 84.133 ns | 0.3742 ns | 0.3500 ns | 84.247 ns | 0.23 | 0.00 | 0.5009 | - | - | 1048 B | 0.48 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 256 | 658.121 ns | 8.3863 ns | 7.8445 ns | 657.285 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | +| Actual | Add | List | Array | 256 | 152.324 ns | 0.2058 ns | 0.1824 ns | 152.311 ns | 0.23 | 0.00 | 0.9899 | - | - | 2072 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 512 | 1,259.055 ns | 12.1079 ns | 11.3258 ns | 1,260.961 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.00 | +| Actual | Add | List | Array | 512 | 298.602 ns | 0.5479 ns | 0.5125 ns | 298.526 ns | 0.24 | 0.00 | 1.9684 | - | - | 4120 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 1024 | 2,447.643 ns | 4.3201 ns | 3.8297 ns | 2,447.211 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.00 | +| Actual | Add | List | Array | 1024 | 602.886 ns | 1.0941 ns | 0.9136 ns | 602.778 ns | 0.25 | 0.00 | 3.9215 | - | - | 8216 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 2048 | 4,773.429 ns | 12.5602 ns | 10.4883 ns | 4,769.400 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.00 | +| Actual | Add | List | Array | 2048 | 1,153.119 ns | 1.1908 ns | 0.9944 ns | 1,153.070 ns | 0.24 | 0.00 | 7.8125 | - | - | 16408 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 4096 | 9,643.209 ns | 150.8823 ns | 161.4424 ns | 9,608.025 ns | 1.00 | 0.00 | 31.2347 | - | - | 65800 B | 1.00 | +| Actual | Add | List | Array | 4096 | 2,308.915 ns | 12.9740 ns | 11.5011 ns | 2,310.650 ns | 0.24 | 0.00 | 15.6250 | - | - | 32792 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 8192 | 19,006.731 ns | 40.6787 ns | 33.9686 ns | 19,005.428 ns | 1.00 | 0.00 | 62.4695 | - | - | 131360 B | 1.00 | +| Actual | Add | List | Array | 8192 | 4,544.546 ns | 14.7264 ns | 13.0546 ns | 4,546.077 ns | 0.24 | 0.00 | 31.2500 | - | - | 65560 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 16384 | 99,432.122 ns | 1,226.6540 ns | 1,147.4129 ns | 99,493.298 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262470 B | 1.00 | +| Actual | Add | List | Array | 16384 | 53,846.916 ns | 1,052.7723 ns | 1,700.0310 ns | 54,590.524 ns | 0.54 | 0.02 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 32768 | 238,603.364 ns | 2,097.2235 ns | 1,961.7442 ns | 238,871.558 ns | 1.00 | 0.00 | 124.7559 | 124.7559 | 124.7559 | 524666 B | 1.00 | +| Actual | Add | List | Array | 32768 | 107,921.938 ns | 2,080.3387 ns | 2,395.7212 ns | 108,853.857 ns | 0.45 | 0.01 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 65536 | 331,843.094 ns | 4,004.7558 ns | 3,746.0510 ns | 332,202.710 ns | 1.00 | 0.00 | 303.7109 | 239.2578 | 239.2578 | 1049482 B | 1.00 | +| Actual | Add | List | Array | 65536 | 124,833.178 ns | 719.7578 ns | 638.0466 ns | 124,786.945 ns | 0.38 | 0.00 | 121.0938 | 120.7275 | 120.7275 | 524348 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 131072 | 681,620.501 ns | 9,832.4499 ns | 9,197.2798 ns | 681,824.316 ns | 1.00 | 0.00 | 554.6875 | 489.2578 | 488.2813 | 2097724 B | 1.00 | +| Actual | Add | List | Array | 131072 | 295,837.488 ns | 5,844.6224 ns | 9,924.6123 ns | 296,832.471 ns | 0.43 | 0.02 | 185.5469 | 185.0586 | 185.0586 | 1048657 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | Array | 850000 | 5,070,303.125 ns | 95,643.4469 ns | 89,464.9395 ns | 5,092,130.469 ns | 1.00 | 0.00 | 390.6250 | 328.1250 | 328.1250 | 16777783 B | 1.00 | +| Actual | Add | List | Array | 850000 | 2,145,544.347 ns | 42,532.6308 ns | 43,677.8803 ns | 2,156,411.719 ns | 0.42 | 0.01 | 132.8125 | 132.8125 | 132.8125 | 6800069 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 0 | 7.700 ns | 0.0518 ns | 0.0484 ns | 7.690 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Add | List | PooledList | 0 | 11.361 ns | 0.0867 ns | 0.0811 ns | 11.328 ns | 1.48 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 1 | 17.634 ns | 0.1149 ns | 0.1075 ns | 17.581 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | PooledList | 1 | 40.997 ns | 0.1620 ns | 0.1265 ns | 40.975 ns | 2.33 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 2 | 19.008 ns | 0.0482 ns | 0.0403 ns | 19.005 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | PooledList | 2 | 42.086 ns | 0.2286 ns | 0.2027 ns | 42.022 ns | 2.21 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 3 | 20.428 ns | 0.1225 ns | 0.1146 ns | 20.476 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | PooledList | 3 | 43.049 ns | 0.2538 ns | 0.2250 ns | 43.000 ns | 2.11 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 4 | 21.819 ns | 0.1039 ns | 0.0972 ns | 21.795 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | PooledList | 4 | 44.171 ns | 0.0466 ns | 0.0413 ns | 44.158 ns | 2.02 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 5 | 37.121 ns | 0.1254 ns | 0.1111 ns | 37.120 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | PooledList | 5 | 45.232 ns | 0.1245 ns | 0.1040 ns | 45.230 ns | 1.22 | 0.00 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 6 | 38.119 ns | 0.1733 ns | 0.1536 ns | 38.110 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | PooledList | 6 | 46.498 ns | 0.1169 ns | 0.0976 ns | 46.470 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 7 | 39.653 ns | 0.1233 ns | 0.1093 ns | 39.699 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | PooledList | 7 | 47.585 ns | 0.1474 ns | 0.1379 ns | 47.581 ns | 1.20 | 0.00 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 8 | 40.778 ns | 0.1488 ns | 0.1391 ns | 40.774 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | PooledList | 8 | 48.619 ns | 0.0815 ns | 0.0723 ns | 48.618 ns | 1.19 | 0.00 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 9 | 57.638 ns | 0.1614 ns | 0.1510 ns | 57.589 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 9 | 50.105 ns | 0.0790 ns | 0.0659 ns | 50.118 ns | 0.87 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 10 | 57.500 ns | 0.5174 ns | 0.4040 ns | 57.424 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 10 | 51.045 ns | 0.0697 ns | 0.0618 ns | 51.064 ns | 0.89 | 0.01 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 11 | 58.915 ns | 0.1539 ns | 0.1285 ns | 58.883 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 11 | 52.316 ns | 0.2133 ns | 0.1995 ns | 52.297 ns | 0.89 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 12 | 60.451 ns | 0.1910 ns | 0.1595 ns | 60.429 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 12 | 53.234 ns | 0.2026 ns | 0.1895 ns | 53.156 ns | 0.88 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 13 | 60.929 ns | 0.2336 ns | 0.1950 ns | 60.947 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 13 | 54.696 ns | 0.6139 ns | 0.5442 ns | 54.554 ns | 0.90 | 0.01 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 14 | 62.398 ns | 0.2811 ns | 0.2348 ns | 62.288 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 14 | 55.769 ns | 0.1017 ns | 0.0850 ns | 55.783 ns | 0.89 | 0.00 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 15 | 64.183 ns | 1.2920 ns | 1.3824 ns | 63.752 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 15 | 57.072 ns | 0.3578 ns | 0.3347 ns | 56.949 ns | 0.89 | 0.02 | 0.0268 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 16 | 65.284 ns | 0.6517 ns | 0.6096 ns | 64.837 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | PooledList | 16 | 57.888 ns | 0.5176 ns | 0.4841 ns | 57.652 ns | 0.89 | 0.01 | 0.0267 | - | - | 56 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 17 | 88.115 ns | 0.5236 ns | 0.4898 ns | 87.932 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | PooledList | 17 | 91.222 ns | 0.5085 ns | 0.4756 ns | 91.004 ns | 1.04 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 18 | 89.468 ns | 0.4826 ns | 0.4514 ns | 89.423 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | PooledList | 18 | 92.830 ns | 0.5198 ns | 0.4862 ns | 92.749 ns | 1.04 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 19 | 91.125 ns | 1.7199 ns | 1.5247 ns | 91.011 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | PooledList | 19 | 95.217 ns | 0.4741 ns | 0.3959 ns | 95.223 ns | 1.04 | 0.02 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 20 | 91.012 ns | 0.2337 ns | 0.2072 ns | 91.017 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | PooledList | 20 | 95.837 ns | 0.7139 ns | 0.6678 ns | 96.027 ns | 1.05 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 30 | 105.551 ns | 0.3321 ns | 0.2944 ns | 105.441 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | PooledList | 30 | 106.289 ns | 0.7819 ns | 0.7314 ns | 106.239 ns | 1.01 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 32 | 109.594 ns | 0.4618 ns | 0.4094 ns | 109.500 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | PooledList | 32 | 107.351 ns | 0.2386 ns | 0.2232 ns | 107.352 ns | 0.98 | 0.00 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 36 | 138.412 ns | 0.2950 ns | 0.2615 ns | 138.363 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | PooledList | 36 | 147.774 ns | 0.8643 ns | 0.6748 ns | 147.659 ns | 1.07 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 37 | 142.823 ns | 0.3153 ns | 0.2949 ns | 142.731 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | PooledList | 37 | 148.741 ns | 2.6124 ns | 2.1814 ns | 148.167 ns | 1.04 | 0.02 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 40 | 143.066 ns | 0.8261 ns | 0.7727 ns | 142.829 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Baseline | Add | List | PooledList | 40 | 143.745 ns | 0.7424 ns | 0.6945 ns | 143.494 ns | 1.00 | 0.01 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | PooledList | 40 | 151.610 ns | 0.5251 ns | 0.4100 ns | 151.646 ns | 1.06 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| Actual | Add | List | PooledList | 40 | 154.915 ns | 3.0876 ns | 4.7150 ns | 152.163 ns | 1.09 | 0.03 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 50 | 164.814 ns | 0.3968 ns | 0.3518 ns | 164.858 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | PooledList | 50 | 164.625 ns | 1.5734 ns | 1.2284 ns | 164.346 ns | 1.00 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 60 | 184.427 ns | 0.8978 ns | 0.8398 ns | 184.338 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | PooledList | 60 | 182.822 ns | 0.4111 ns | 0.3209 ns | 182.910 ns | 0.99 | 0.00 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 70 | 237.079 ns | 1.4282 ns | 1.1926 ns | 236.635 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | PooledList | 70 | 235.069 ns | 4.6215 ns | 5.5015 ns | 232.821 ns | 0.99 | 0.02 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 80 | 262.980 ns | 1.5282 ns | 1.3547 ns | 262.553 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | PooledList | 80 | 245.673 ns | 4.9301 ns | 4.6116 ns | 243.354 ns | 0.94 | 0.02 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 850000 | 5,502,952.108 ns | 109,243.5236 ns | 251,005.1623 ns | 5,454,132.031 ns | 1.00 | 0.00 | 539.0625 | 476.5625 | 476.5625 | 16777825 B | 1.000 | +| Actual | Add | List | PooledList | 850000 | 2,649,836.198 ns | 51,126.4933 ns | 60,862.4534 ns | 2,661,834.375 ns | 0.47 | 0.03 | - | - | - | 60 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 90 | 280.964 ns | 1.8658 ns | 1.7453 ns | 280.252 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | PooledList | 90 | 261.955 ns | 4.5450 ns | 4.2514 ns | 261.306 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 100 | 298.058 ns | 1.1116 ns | 0.9854 ns | 297.780 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | PooledList | 100 | 280.695 ns | 5.2956 ns | 4.9535 ns | 278.643 ns | 0.94 | 0.02 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 128 | 357.004 ns | 2.5621 ns | 2.2712 ns | 356.061 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | PooledList | 128 | 331.804 ns | 4.6908 ns | 4.3878 ns | 330.872 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 256 | 689.656 ns | 9.6686 ns | 8.5710 ns | 687.452 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | +| Actual | Add | List | PooledList | 256 | 583.558 ns | 8.5448 ns | 7.5748 ns | 582.324 ns | 0.85 | 0.02 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 512 | 1,297.035 ns | 6.9322 ns | 6.4844 ns | 1,297.570 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.000 | +| Actual | Add | List | PooledList | 512 | 1,061.203 ns | 6.0453 ns | 5.3590 ns | 1,061.295 ns | 0.82 | 0.01 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 1024 | 2,466.639 ns | 18.3824 ns | 17.1949 ns | 2,463.952 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.000 | +| Actual | Add | List | PooledList | 1024 | 1,990.787 ns | 7.5229 ns | 6.6688 ns | 1,988.413 ns | 0.81 | 0.01 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 2048 | 4,813.775 ns | 25.9190 ns | 22.9766 ns | 4,804.923 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.000 | +| Actual | Add | List | PooledList | 2048 | 3,888.997 ns | 27.9618 ns | 26.1555 ns | 3,876.038 ns | 0.81 | 0.01 | 0.0229 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 4096 | 9,600.058 ns | 45.5350 ns | 42.5934 ns | 9,583.844 ns | 1.00 | 0.00 | 31.2347 | - | - | 65800 B | 1.000 | +| Actual | Add | List | PooledList | 4096 | 7,635.909 ns | 35.6304 ns | 33.3287 ns | 7,642.136 ns | 0.80 | 0.00 | 0.0229 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 8192 | 19,131.735 ns | 121.6350 ns | 107.8262 ns | 19,122.871 ns | 1.00 | 0.00 | 62.4695 | - | - | 131360 B | 1.000 | +| Actual | Add | List | PooledList | 8192 | 15,130.284 ns | 45.8569 ns | 42.8945 ns | 15,143.172 ns | 0.79 | 0.01 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 16384 | 100,331.825 ns | 1,160.0969 ns | 1,085.1553 ns | 100,557.629 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262470 B | 1.000 | +| Actual | Add | List | PooledList | 16384 | 30,119.963 ns | 63.0163 ns | 55.8623 ns | 30,142.162 ns | 0.30 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 32768 | 241,285.522 ns | 1,233.0907 ns | 1,153.4338 ns | 241,714.429 ns | 1.00 | 0.00 | 124.7559 | 124.7559 | 124.7559 | 524666 B | 1.000 | +| Actual | Add | List | PooledList | 32768 | 60,602.320 ns | 178.4272 ns | 148.9948 ns | 60,550.781 ns | 0.25 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 65536 | 322,940.840 ns | 4,940.3438 ns | 4,621.2006 ns | 320,584.082 ns | 1.00 | 0.00 | 309.0820 | 244.6289 | 244.6289 | 1049281 B | 1.000 | +| Actual | Add | List | PooledList | 65536 | 123,522.166 ns | 626.4347 ns | 523.1014 ns | 123,385.669 ns | 0.38 | 0.01 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | PooledList | 131072 | 672,761.709 ns | 9,071.8768 ns | 8,485.8392 ns | 674,810.205 ns | 1.00 | 0.00 | 545.8984 | 480.4688 | 479.4922 | 2097698 B | 1.000 | +| Actual | Add | List | PooledList | 131072 | 252,269.259 ns | 3,874.8105 ns | 3,025.1971 ns | 251,411.523 ns | 0.38 | 0.01 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 0 | 8.018 ns | 0.0635 ns | 0.0594 ns | 8.041 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Add | List | RecyclableList | 0 | 15.321 ns | 0.1213 ns | 0.1075 ns | 15.313 ns | 1.91 | 0.02 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 1 | 17.505 ns | 0.1973 ns | 0.1846 ns | 17.392 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableList | 1 | 16.884 ns | 0.1091 ns | 0.1021 ns | 16.846 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 2 | 18.945 ns | 0.1441 ns | 0.1348 ns | 18.938 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableList | 2 | 18.200 ns | 0.1295 ns | 0.1148 ns | 18.167 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 3 | 20.424 ns | 0.2287 ns | 0.2027 ns | 20.416 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableList | 3 | 19.881 ns | 0.1207 ns | 0.1070 ns | 19.854 ns | 0.97 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 4 | 21.884 ns | 0.1471 ns | 0.1376 ns | 21.934 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableList | 4 | 21.007 ns | 0.1721 ns | 0.1610 ns | 21.013 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 5 | 36.817 ns | 0.0343 ns | 0.0268 ns | 36.825 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableList | 5 | 31.968 ns | 0.1603 ns | 0.1500 ns | 31.937 ns | 0.87 | 0.00 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 6 | 37.939 ns | 0.2612 ns | 0.2443 ns | 37.801 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableList | 6 | 33.506 ns | 0.1212 ns | 0.1134 ns | 33.501 ns | 0.88 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 7 | 39.472 ns | 0.3008 ns | 0.2512 ns | 39.405 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableList | 7 | 34.591 ns | 0.2516 ns | 0.2353 ns | 34.472 ns | 0.88 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 8 | 40.953 ns | 0.8000 ns | 0.9213 ns | 40.563 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableList | 8 | 35.592 ns | 0.1095 ns | 0.1024 ns | 35.617 ns | 0.87 | 0.02 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 9 | 57.107 ns | 0.1778 ns | 0.1485 ns | 57.045 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 9 | 49.302 ns | 0.1433 ns | 0.1197 ns | 49.311 ns | 0.86 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 10 | 58.241 ns | 0.1395 ns | 0.1165 ns | 58.278 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 10 | 50.815 ns | 0.2948 ns | 0.2757 ns | 50.779 ns | 0.87 | 0.01 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 11 | 59.210 ns | 0.1507 ns | 0.1259 ns | 59.211 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 11 | 51.965 ns | 0.1268 ns | 0.1059 ns | 51.959 ns | 0.88 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 12 | 60.599 ns | 0.2032 ns | 0.1696 ns | 60.592 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 12 | 52.909 ns | 0.1594 ns | 0.1331 ns | 52.903 ns | 0.87 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 13 | 61.049 ns | 0.0643 ns | 0.0570 ns | 61.036 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 13 | 54.339 ns | 0.0755 ns | 0.0669 ns | 54.331 ns | 0.89 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 14 | 62.358 ns | 0.1531 ns | 0.1357 ns | 62.400 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 14 | 56.144 ns | 0.1168 ns | 0.1036 ns | 56.163 ns | 0.90 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 15 | 63.530 ns | 0.0833 ns | 0.0779 ns | 63.521 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 15 | 57.851 ns | 0.1181 ns | 0.0986 ns | 57.847 ns | 0.91 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 16 | 65.093 ns | 0.1062 ns | 0.0942 ns | 65.074 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableList | 16 | 60.058 ns | 0.1210 ns | 0.1010 ns | 60.015 ns | 0.92 | 0.00 | 0.1645 | - | - | 344 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 17 | 87.710 ns | 0.1417 ns | 0.1106 ns | 87.716 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableList | 17 | 77.522 ns | 0.5277 ns | 0.4678 ns | 77.457 ns | 0.88 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 18 | 89.182 ns | 0.5988 ns | 0.5601 ns | 88.895 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableList | 18 | 79.010 ns | 0.5328 ns | 0.4984 ns | 78.897 ns | 0.89 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 19 | 90.497 ns | 0.1709 ns | 0.1515 ns | 90.499 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableList | 19 | 79.987 ns | 0.4227 ns | 0.3954 ns | 79.921 ns | 0.88 | 0.00 | 0.2984 | - | - | 624 B | 1.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 20 | 91.573 ns | 0.5269 ns | 0.4929 ns | 91.608 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableList | 20 | 81.727 ns | 0.3712 ns | 0.2898 ns | 81.655 ns | 0.89 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 30 | 106.617 ns | 0.8215 ns | 0.7282 ns | 106.293 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableList | 30 | 100.859 ns | 0.7713 ns | 0.7215 ns | 100.567 ns | 0.95 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 32 | 110.048 ns | 0.7183 ns | 0.6367 ns | 109.706 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableList | 32 | 104.524 ns | 0.7240 ns | 0.6418 ns | 104.221 ns | 0.95 | 0.01 | 0.2984 | - | - | 624 B | 1.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 36 | 140.719 ns | 0.9997 ns | 0.8862 ns | 140.767 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableList | 36 | 141.169 ns | 1.1777 ns | 1.0440 ns | 140.722 ns | 1.00 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 37 | 165.637 ns | 1.2722 ns | 1.1900 ns | 165.963 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableList | 37 | 144.659 ns | 1.0143 ns | 0.9488 ns | 144.322 ns | 0.87 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 40 | 165.237 ns | 1.3832 ns | 1.1550 ns | 165.132 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Baseline | Add | List | RecyclableList | 40 | 163.664 ns | 1.1046 ns | 1.0332 ns | 163.838 ns | 0.99 | 0.01 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableList | 40 | 146.470 ns | 0.7366 ns | 0.6891 ns | 146.541 ns | 0.89 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | +| Actual | Add | List | RecyclableList | 40 | 148.296 ns | 1.7024 ns | 1.5924 ns | 148.417 ns | 0.90 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 50 | 187.073 ns | 1.0599 ns | 0.9396 ns | 187.414 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableList | 50 | 166.848 ns | 1.1393 ns | 1.0657 ns | 166.792 ns | 0.89 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 60 | 206.552 ns | 1.3124 ns | 1.2276 ns | 206.420 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableList | 60 | 188.599 ns | 0.7523 ns | 0.6669 ns | 188.579 ns | 0.91 | 0.01 | 0.3135 | - | - | 656 B | 0.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 70 | 282.226 ns | 2.2872 ns | 2.1394 ns | 281.671 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableList | 70 | 233.285 ns | 0.9523 ns | 0.7952 ns | 233.157 ns | 0.83 | 0.01 | 0.3288 | - | - | 688 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 80 | 303.570 ns | 3.0719 ns | 2.8734 ns | 303.353 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableList | 80 | 252.410 ns | 0.6316 ns | 0.5274 ns | 252.398 ns | 0.83 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 90 | 323.372 ns | 3.8273 ns | 3.5801 ns | 323.331 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableList | 90 | 272.868 ns | 0.8681 ns | 0.7696 ns | 272.937 ns | 0.84 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 100 | 340.384 ns | 3.5274 ns | 3.2995 ns | 340.390 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableList | 100 | 295.380 ns | 0.7464 ns | 0.6982 ns | 295.373 ns | 0.87 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 128 | 413.742 ns | 3.3498 ns | 3.1334 ns | 413.403 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableList | 128 | 390.098 ns | 4.1294 ns | 3.8627 ns | 390.072 ns | 0.94 | 0.01 | 0.3285 | - | - | 688 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 256 | 769.715 ns | 6.5688 ns | 6.1445 ns | 772.426 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | +| Actual | Add | List | RecyclableList | 256 | 699.225 ns | 5.7090 ns | 5.3402 ns | 698.463 ns | 0.91 | 0.01 | 0.3443 | - | - | 720 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 512 | 1,454.110 ns | 9.5587 ns | 8.9412 ns | 1,455.582 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.00 | +| Actual | Add | List | RecyclableList | 512 | 1,319.050 ns | 6.4715 ns | 6.0535 ns | 1,319.357 ns | 0.91 | 0.01 | 0.3586 | - | - | 752 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 1024 | 2,790.613 ns | 23.3264 ns | 21.8195 ns | 2,791.224 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.00 | +| Actual | Add | List | RecyclableList | 1024 | 2,516.359 ns | 10.4172 ns | 9.7443 ns | 2,511.535 ns | 0.90 | 0.01 | 0.3738 | - | - | 784 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 2048 | 5,452.530 ns | 43.7569 ns | 40.9302 ns | 5,451.658 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.00 | +| Actual | Add | List | RecyclableList | 2048 | 4,858.333 ns | 6.0045 ns | 4.6879 ns | 4,858.583 ns | 0.89 | 0.01 | 0.3891 | - | - | 816 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 4096 | 10,978.421 ns | 133.3892 ns | 118.2461 ns | 10,949.155 ns | 1.00 | 0.00 | 31.2500 | - | - | 65800 B | 1.00 | +| Actual | Add | List | RecyclableList | 4096 | 9,442.868 ns | 27.8393 ns | 26.0409 ns | 9,437.257 ns | 0.86 | 0.01 | 0.3967 | - | - | 848 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 8192 | 21,623.674 ns | 203.4720 ns | 190.3278 ns | 21,642.752 ns | 1.00 | 0.00 | 62.4695 | - | - | 131360 B | 1.000 | +| Actual | Add | List | RecyclableList | 8192 | 18,582.662 ns | 11.4299 ns | 10.6916 ns | 18,582.411 ns | 0.86 | 0.01 | 0.3967 | - | - | 880 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 16384 | 107,337.902 ns | 773.4862 ns | 685.6754 ns | 107,384.119 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262484 B | 1.000 | +| Actual | Add | List | RecyclableList | 16384 | 36,961.097 ns | 80.2025 ns | 75.0215 ns | 36,943.439 ns | 0.34 | 0.00 | 0.4272 | - | - | 913 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 32768 | 251,240.365 ns | 4,851.9535 ns | 4,538.5203 ns | 252,014.453 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524705 B | 1.000 | +| Actual | Add | List | RecyclableList | 32768 | 74,149.835 ns | 64.1453 ns | 53.5643 ns | 74,154.578 ns | 0.30 | 0.01 | 0.3662 | - | - | 945 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 65536 | 349,929.362 ns | 6,402.9722 ns | 7,622.2829 ns | 347,623.926 ns | 1.00 | 0.00 | 301.2695 | 237.3047 | 236.8164 | 1049520 B | 1.000 | +| Actual | Add | List | RecyclableList | 65536 | 149,080.693 ns | 652.7460 ns | 610.5790 ns | 149,109.790 ns | 0.43 | 0.01 | 0.2441 | - | - | 978 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 131072 | 713,644.505 ns | 10,223.0035 ns | 9,562.6038 ns | 715,050.684 ns | 1.00 | 0.00 | 509.7656 | 443.3594 | 443.3594 | 2097844 B | 1.000 | +| Actual | Add | List | RecyclableList | 131072 | 305,267.419 ns | 1,794.1951 ns | 1,678.2912 ns | 304,732.324 ns | 0.43 | 0.01 | 0.4883 | - | - | 1011 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableList | 850000 | 5,691,174.211 ns | 123,156.7249 ns | 355,335.3105 ns | 5,633,410.547 ns | 1.00 | 0.00 | 492.1875 | 429.6875 | 429.6875 | 16778027 B | 1.000 | +| Actual | Add | List | RecyclableList | 850000 | 2,787,265.202 ns | 9,531.4846 ns | 7,441.5563 ns | 2,788,524.805 ns | 0.47 | 0.04 | - | - | - | 1131 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 0 | 8.384 ns | 0.0586 ns | 0.0548 ns | 8.385 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 0 | 20.286 ns | 0.1347 ns | 0.1260 ns | 20.329 ns | 2.42 | 0.02 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 1 | 19.945 ns | 0.0993 ns | 0.0880 ns | 19.927 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 1 | 75.415 ns | 0.7266 ns | 0.6441 ns | 75.418 ns | 3.78 | 0.03 | 0.0802 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 2 | 20.675 ns | 0.2710 ns | 0.2263 ns | 20.583 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 2 | 86.717 ns | 1.7452 ns | 3.6429 ns | 88.205 ns | 4.18 | 0.24 | 0.0802 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 3 | 22.080 ns | 0.1019 ns | 0.0903 ns | 22.083 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 3 | 81.541 ns | 0.5248 ns | 0.4909 ns | 81.553 ns | 3.69 | 0.02 | 0.0802 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 4 | 23.371 ns | 0.1231 ns | 0.1091 ns | 23.346 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 4 | 85.006 ns | 0.4883 ns | 0.4328 ns | 85.106 ns | 3.64 | 0.02 | 0.0802 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 5 | 39.838 ns | 0.3306 ns | 0.3092 ns | 39.769 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 5 | 86.063 ns | 0.4371 ns | 0.3875 ns | 86.100 ns | 2.16 | 0.02 | 0.0802 | - | - | 168 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 6 | 41.861 ns | 0.8162 ns | 0.7634 ns | 41.752 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 6 | 88.275 ns | 0.6796 ns | 0.6357 ns | 88.154 ns | 2.11 | 0.04 | 0.0802 | - | - | 168 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 7 | 42.661 ns | 0.3107 ns | 0.2755 ns | 42.653 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 7 | 88.562 ns | 0.8110 ns | 0.7586 ns | 88.311 ns | 2.08 | 0.02 | 0.0802 | - | - | 168 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 8 | 44.020 ns | 0.3425 ns | 0.3203 ns | 43.993 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 8 | 92.595 ns | 0.7985 ns | 0.7469 ns | 92.489 ns | 2.10 | 0.03 | 0.0802 | - | - | 168 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 9 | 63.325 ns | 0.4171 ns | 0.3483 ns | 63.263 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 9 | 94.618 ns | 0.8370 ns | 0.6989 ns | 94.378 ns | 1.49 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 10 | 63.525 ns | 0.5032 ns | 0.4707 ns | 63.491 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 10 | 95.573 ns | 1.2717 ns | 1.1273 ns | 95.691 ns | 1.50 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 11 | 65.088 ns | 0.2576 ns | 0.2284 ns | 65.136 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 11 | 97.291 ns | 1.2254 ns | 1.0863 ns | 97.596 ns | 1.49 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 12 | 65.883 ns | 0.4009 ns | 0.3750 ns | 65.677 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 12 | 99.850 ns | 1.4821 ns | 1.3863 ns | 99.570 ns | 1.52 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 13 | 67.287 ns | 0.5276 ns | 0.4935 ns | 67.157 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 13 | 96.432 ns | 1.4651 ns | 1.3704 ns | 96.270 ns | 1.43 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 14 | 68.172 ns | 0.5728 ns | 0.5358 ns | 67.977 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 14 | 103.185 ns | 0.9583 ns | 0.8496 ns | 103.187 ns | 1.51 | 0.02 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 15 | 69.322 ns | 0.5185 ns | 0.4850 ns | 69.103 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 15 | 105.456 ns | 1.5842 ns | 1.4819 ns | 104.964 ns | 1.52 | 0.03 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 16 | 73.778 ns | 0.3225 ns | 0.2693 ns | 73.839 ns | 1.00 | 0.00 | 0.1568 | - | - | 328 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 16 | 102.235 ns | 0.6084 ns | 0.5691 ns | 102.039 ns | 1.38 | 0.01 | 0.0802 | - | - | 168 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 17 | 101.380 ns | 0.5631 ns | 0.4992 ns | 101.314 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 17 | 107.447 ns | 0.9613 ns | 0.8522 ns | 107.407 ns | 1.06 | 0.01 | 0.0802 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 18 | 100.839 ns | 1.2064 ns | 1.1285 ns | 101.071 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 18 | 117.190 ns | 0.6547 ns | 0.5803 ns | 117.167 ns | 1.16 | 0.01 | 0.0801 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 19 | 102.415 ns | 0.7294 ns | 0.6823 ns | 102.515 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 19 | 112.592 ns | 1.8827 ns | 1.5721 ns | 112.661 ns | 1.10 | 0.01 | 0.0802 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 20 | 104.456 ns | 0.8894 ns | 0.7427 ns | 104.565 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 20 | 114.310 ns | 1.6334 ns | 1.5279 ns | 113.937 ns | 1.09 | 0.02 | 0.0802 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 30 | 116.928 ns | 1.2475 ns | 1.1059 ns | 117.115 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 30 | 136.558 ns | 1.4824 ns | 1.1574 ns | 136.480 ns | 1.17 | 0.01 | 0.0801 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 32 | 122.223 ns | 1.5140 ns | 1.4162 ns | 121.981 ns | 1.00 | 0.00 | 0.2906 | - | - | 608 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 32 | 140.096 ns | 1.5823 ns | 1.4800 ns | 139.502 ns | 1.15 | 0.02 | 0.0801 | - | - | 168 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 36 | 167.399 ns | 1.2763 ns | 1.1314 ns | 167.352 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 36 | 151.458 ns | 1.2939 ns | 1.0805 ns | 151.263 ns | 0.90 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 37 | 166.487 ns | 1.3446 ns | 1.2577 ns | 166.490 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 37 | 148.684 ns | 1.1163 ns | 1.0441 ns | 148.635 ns | 0.89 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 40 | 171.411 ns | 1.3932 ns | 1.3032 ns | 171.491 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Baseline | Add | List | RecyclableLongList | 40 | 170.678 ns | 1.0280 ns | 0.8584 ns | 170.616 ns | 0.99 | 0.01 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 40 | 160.982 ns | 3.1009 ns | 2.9006 ns | 160.767 ns | 0.94 | 0.02 | 0.0801 | - | - | 168 B | 0.15 | +| Actual | Add | List | RecyclableLongList | 40 | 158.266 ns | 1.3493 ns | 1.1961 ns | 157.868 ns | 0.92 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 50 | 190.604 ns | 1.6177 ns | 1.4340 ns | 190.519 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 50 | 176.708 ns | 0.7675 ns | 0.6803 ns | 176.419 ns | 0.93 | 0.01 | 0.0801 | - | - | 168 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 60 | 202.190 ns | 1.1529 ns | 1.0784 ns | 202.013 ns | 1.00 | 0.00 | 0.5469 | - | - | 1144 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 60 | 195.592 ns | 1.2406 ns | 1.1605 ns | 195.428 ns | 0.97 | 0.01 | 0.0803 | - | - | 168 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 70 | 307.900 ns | 2.7589 ns | 2.5806 ns | 307.326 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 70 | 225.753 ns | 4.3330 ns | 4.0531 ns | 227.051 ns | 0.73 | 0.01 | 0.0803 | - | - | 168 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 80 | 310.387 ns | 2.7944 ns | 2.6139 ns | 310.585 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 80 | 236.602 ns | 1.2262 ns | 1.1470 ns | 236.519 ns | 0.76 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 850000 | 6,072,369.318 ns | 131,841.0199 ns | 386,666.8889 ns | 5,984,771.875 ns | 1.00 | 0.00 | 429.6875 | 367.1875 | 367.1875 | 16777946 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 850000 | 1,873,637.614 ns | 4,899.0291 ns | 3,824.8396 ns | 1,874,461.719 ns | 0.31 | 0.02 | - | - | - | 2825 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 90 | 318.684 ns | 1.6344 ns | 1.4488 ns | 319.152 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 90 | 260.669 ns | 1.2020 ns | 1.0655 ns | 260.664 ns | 0.82 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 100 | 340.245 ns | 2.2885 ns | 2.0287 ns | 340.484 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 100 | 286.495 ns | 4.7764 ns | 4.4678 ns | 287.602 ns | 0.84 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 128 | 402.997 ns | 1.9360 ns | 1.7162 ns | 402.963 ns | 1.00 | 0.00 | 1.0481 | - | - | 2192 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 128 | 335.931 ns | 1.0648 ns | 0.9439 ns | 335.987 ns | 0.83 | 0.00 | 0.0801 | - | - | 168 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 256 | 749.888 ns | 4.1337 ns | 3.6644 ns | 750.326 ns | 1.00 | 0.00 | 2.0380 | - | - | 4264 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 256 | 598.397 ns | 2.7117 ns | 2.5365 ns | 597.495 ns | 0.80 | 0.01 | 0.0801 | - | - | 168 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 512 | 1,424.823 ns | 13.4170 ns | 12.5503 ns | 1,420.054 ns | 1.00 | 0.00 | 4.0035 | - | - | 8384 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 512 | 1,132.464 ns | 9.1077 ns | 8.5194 ns | 1,132.185 ns | 0.79 | 0.01 | 0.0801 | - | - | 168 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 1024 | 2,805.018 ns | 26.7196 ns | 24.9935 ns | 2,805.138 ns | 1.00 | 0.00 | 7.9346 | - | - | 16600 B | 1.00 | +| Actual | Add | List | RecyclableLongList | 1024 | 2,168.837 ns | 16.7577 ns | 15.6752 ns | 2,165.421 ns | 0.77 | 0.01 | 0.0801 | - | - | 168 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 2048 | 5,450.196 ns | 51.7338 ns | 48.3919 ns | 5,448.576 ns | 1.00 | 0.00 | 15.7471 | - | - | 33008 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 2048 | 4,262.713 ns | 21.8398 ns | 20.4290 ns | 4,257.209 ns | 0.78 | 0.01 | 0.0763 | - | - | 168 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 4096 | 10,931.953 ns | 104.4226 ns | 97.6769 ns | 10,917.020 ns | 1.00 | 0.00 | 31.2500 | - | - | 65800 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 4096 | 8,432.594 ns | 46.1496 ns | 43.1684 ns | 8,411.736 ns | 0.77 | 0.01 | 0.0763 | - | - | 168 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 8192 | 21,790.080 ns | 211.6645 ns | 176.7494 ns | 21,748.680 ns | 1.00 | 0.00 | 62.5000 | - | - | 131360 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 8192 | 16,723.234 ns | 64.9072 ns | 60.7142 ns | 16,709.587 ns | 0.77 | 0.01 | 0.0610 | - | - | 168 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 16384 | 106,955.108 ns | 476.2849 ns | 445.5172 ns | 106,953.467 ns | 1.00 | 0.00 | 83.2520 | 41.6260 | 41.6260 | 262484 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 16384 | 33,326.477 ns | 108.5087 ns | 90.6097 ns | 33,307.654 ns | 0.31 | 0.00 | 0.0610 | - | - | 168 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 32768 | 253,442.934 ns | 4,982.4340 ns | 5,116.5929 ns | 253,667.578 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524705 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 32768 | 66,746.580 ns | 172.8757 ns | 161.7081 ns | 66,713.220 ns | 0.26 | 0.01 | - | - | - | 241 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 65536 | 362,559.577 ns | 2,808.7409 ns | 2,627.2980 ns | 362,701.416 ns | 1.00 | 0.00 | 291.0156 | 226.5625 | 226.5625 | 1049747 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 65536 | 134,241.703 ns | 201.6205 ns | 178.7313 ns | 134,241.565 ns | 0.37 | 0.00 | - | - | - | 362 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add | List | RecyclableLongList | 131072 | 719,800.008 ns | 8,096.2811 ns | 6,760.7614 ns | 719,142.285 ns | 1.00 | 0.00 | 488.2813 | 422.8516 | 422.8516 | 2097801 B | 1.000 | +| Actual | Add | List | RecyclableLongList | 131072 | 268,224.823 ns | 656.9567 ns | 548.5886 ns | 268,183.203 ns | 0.37 | 0.00 | - | - | - | 579 B | 0.000 | +
+ +# `Add` with Pre-Initialized Capacity Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1848/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.305 + [Host] : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.8 (7.0.823.31807), X64 RyuJIT AVX2 +``` +
+Add to the List by 1 Item with Pre-Initialized Capacity Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |----------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | Add_WithCapacity | List | PooledList | 1 | 12.67 ns | 0.026 ns | 0.023 ns | 12.67 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 1 | 37.65 ns | 0.292 ns | 0.273 ns | 37.60 ns | 2.97 | 0.02 | 0.0268 | - | - | 56 B | 0.88 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 2 | 14.45 ns | 0.035 ns | 0.033 ns | 14.45 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 2 | 39.54 ns | 0.555 ns | 0.519 ns | 39.63 ns | 2.74 | 0.03 | 0.0268 | - | - | 56 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 3 | 16.02 ns | 0.077 ns | 0.060 ns | 16.04 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 3 | 40.50 ns | 0.524 ns | 0.490 ns | 40.47 ns | 2.53 | 0.03 | 0.0268 | - | - | 56 B | 0.70 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 4 | 17.76 ns | 0.114 ns | 0.107 ns | 17.80 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 4 | 41.85 ns | 0.338 ns | 0.316 ns | 41.84 ns | 2.36 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 5 | 19.49 ns | 0.066 ns | 0.055 ns | 19.48 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 5 | 41.90 ns | 0.592 ns | 0.554 ns | 41.96 ns | 2.15 | 0.03 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 6 | 21.47 ns | 0.127 ns | 0.113 ns | 21.43 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 6 | 42.98 ns | 0.539 ns | 0.478 ns | 43.01 ns | 2.00 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 7 | 23.45 ns | 0.033 ns | 0.031 ns | 23.44 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 7 | 44.22 ns | 0.419 ns | 0.392 ns | 44.23 ns | 1.89 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 8 | 25.30 ns | 0.064 ns | 0.060 ns | 25.30 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 8 | 45.81 ns | 0.236 ns | 0.209 ns | 45.85 ns | 1.81 | 0.01 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 9 | 27.25 ns | 0.140 ns | 0.124 ns | 27.19 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 9 | 49.55 ns | 0.451 ns | 0.422 ns | 49.50 ns | 1.82 | 0.02 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 10 | 29.59 ns | 0.254 ns | 0.225 ns | 29.46 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 10 | 48.08 ns | 0.499 ns | 0.467 ns | 48.03 ns | 1.62 | 0.02 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 11 | 31.51 ns | 0.162 ns | 0.152 ns | 31.47 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 11 | 49.47 ns | 0.590 ns | 0.552 ns | 49.33 ns | 1.57 | 0.02 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 12 | 33.37 ns | 0.054 ns | 0.042 ns | 33.37 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 12 | 50.03 ns | 0.551 ns | 0.515 ns | 50.12 ns | 1.50 | 0.02 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 13 | 35.41 ns | 0.044 ns | 0.034 ns | 35.41 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 13 | 51.51 ns | 0.224 ns | 0.198 ns | 51.43 ns | 1.45 | 0.01 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 14 | 37.66 ns | 0.403 ns | 0.377 ns | 37.69 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 14 | 52.62 ns | 0.285 ns | 0.266 ns | 52.61 ns | 1.40 | 0.02 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 15 | 39.57 ns | 0.330 ns | 0.309 ns | 39.37 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 15 | 53.29 ns | 0.229 ns | 0.203 ns | 53.33 ns | 1.35 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 16 | 41.55 ns | 0.286 ns | 0.268 ns | 41.67 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 16 | 54.97 ns | 0.209 ns | 0.195 ns | 54.93 ns | 1.32 | 0.01 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 17 | 43.49 ns | 0.227 ns | 0.212 ns | 43.38 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 17 | 56.32 ns | 0.323 ns | 0.287 ns | 56.27 ns | 1.30 | 0.01 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 18 | 45.51 ns | 0.182 ns | 0.162 ns | 45.44 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 18 | 57.42 ns | 0.204 ns | 0.191 ns | 57.42 ns | 1.26 | 0.01 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 19 | 47.61 ns | 0.064 ns | 0.060 ns | 47.60 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 19 | 58.55 ns | 0.109 ns | 0.096 ns | 58.53 ns | 1.23 | 0.00 | 0.0267 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 20 | 49.74 ns | 0.081 ns | 0.072 ns | 49.75 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 20 | 60.37 ns | 0.122 ns | 0.108 ns | 60.38 ns | 1.21 | 0.00 | 0.0267 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 30 | 68.35 ns | 0.479 ns | 0.425 ns | 68.24 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 30 | 77.23 ns | 0.073 ns | 0.065 ns | 77.22 ns | 1.13 | 0.01 | 0.0267 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 32 | 68.81 ns | 0.192 ns | 0.180 ns | 68.83 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 32 | 81.33 ns | 0.131 ns | 0.109 ns | 81.31 ns | 1.18 | 0.00 | 0.0267 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 36 | 76.04 ns | 0.461 ns | 0.385 ns | 76.06 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 36 | 87.76 ns | 0.515 ns | 0.482 ns | 87.42 ns | 1.15 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 37 | 73.83 ns | 0.411 ns | 0.343 ns | 73.95 ns | 1.00 | 0.00 | 0.1682 | - | - | 352 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 37 | 88.70 ns | 0.336 ns | 0.314 ns | 88.59 ns | 1.20 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 40 | 78.43 ns | 0.505 ns | 0.472 ns | 78.39 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Add_WithCapacity | List | PooledList | 40 | 80.36 ns | 1.215 ns | 1.137 ns | 79.94 ns | 1.02 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 40 | 93.59 ns | 0.330 ns | 0.308 ns | 93.47 ns | 1.19 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | +| Actual | Add_WithCapacity | List | PooledList | 40 | 93.78 ns | 0.230 ns | 0.215 ns | 93.69 ns | 1.20 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 50 | 110.72 ns | 0.235 ns | 0.209 ns | 110.63 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 50 | 112.70 ns | 0.769 ns | 0.719 ns | 112.81 ns | 1.02 | 0.01 | 0.0267 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 60 | 131.06 ns | 0.480 ns | 0.449 ns | 130.90 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 60 | 129.83 ns | 0.731 ns | 0.683 ns | 129.93 ns | 0.99 | 0.01 | 0.0267 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 70 | 151.98 ns | 0.697 ns | 0.652 ns | 151.85 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 70 | 146.91 ns | 0.654 ns | 0.612 ns | 146.91 ns | 0.97 | 0.00 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 80 | 171.90 ns | 0.276 ns | 0.216 ns | 171.80 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 80 | 163.55 ns | 0.797 ns | 0.707 ns | 163.70 ns | 0.95 | 0.00 | 0.0267 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 850000 | 2,824,662.89 ns | 55,813.884 ns | 121,334.790 ns | 2,814,725.00 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800089 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 850000 | 1,729,389.88 ns | 34,394.895 ns | 76,216.711 ns | 1,768,465.23 ns | 0.61 | 0.03 | - | - | - | 58 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 90 | 192.09 ns | 0.329 ns | 0.308 ns | 192.00 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 90 | 179.89 ns | 0.750 ns | 0.701 ns | 179.77 ns | 0.94 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 100 | 213.50 ns | 0.443 ns | 0.414 ns | 213.41 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 100 | 197.46 ns | 0.844 ns | 0.748 ns | 197.46 ns | 0.92 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 128 | 269.60 ns | 1.111 ns | 0.985 ns | 269.20 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 128 | 245.02 ns | 0.731 ns | 0.648 ns | 245.13 ns | 0.91 | 0.00 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 256 | 525.66 ns | 2.339 ns | 2.074 ns | 525.45 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 256 | 462.39 ns | 0.957 ns | 0.895 ns | 462.58 ns | 0.88 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 512 | 1,021.80 ns | 6.159 ns | 5.761 ns | 1,020.83 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | +| Actual | Add_WithCapacity | List | PooledList | 512 | 892.34 ns | 1.355 ns | 1.201 ns | 892.03 ns | 0.87 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 1024 | 1,995.80 ns | 3.614 ns | 3.018 ns | 1,995.45 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 1024 | 1,757.56 ns | 4.330 ns | 4.050 ns | 1,755.20 ns | 0.88 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 2048 | 3,933.57 ns | 4.570 ns | 4.051 ns | 3,932.97 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 2048 | 3,500.49 ns | 9.074 ns | 8.488 ns | 3,505.08 ns | 0.89 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 4096 | 7,829.70 ns | 24.545 ns | 20.496 ns | 7,825.35 ns | 1.00 | 0.00 | 15.6097 | - | - | 32824 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 4096 | 6,944.20 ns | 17.913 ns | 16.756 ns | 6,935.15 ns | 0.89 | 0.00 | 0.0229 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 8192 | 15,633.66 ns | 55.934 ns | 49.584 ns | 15,615.39 ns | 1.00 | 0.00 | 31.2195 | - | - | 65592 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 8192 | 13,838.48 ns | 34.360 ns | 32.140 ns | 13,817.06 ns | 0.89 | 0.00 | 0.0153 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 16384 | 74,944.83 ns | 1,484.571 ns | 1,930.362 ns | 74,679.98 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 16384 | 27,709.14 ns | 70.458 ns | 65.906 ns | 27,721.43 ns | 0.37 | 0.01 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 32768 | 151,145.93 ns | 3,015.407 ns | 3,813.524 ns | 151,471.66 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 32768 | 55,193.17 ns | 19.087 ns | 15.939 ns | 55,186.68 ns | 0.37 | 0.01 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 65536 | 223,298.15 ns | 1,275.960 ns | 1,065.484 ns | 223,143.09 ns | 1.00 | 0.00 | 137.2070 | 136.2305 | 136.2305 | 524483 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 65536 | 110,406.56 ns | 164.505 ns | 128.435 ns | 110,358.78 ns | 0.49 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | PooledList | 131072 | 483,247.10 ns | 5,993.907 ns | 5,606.704 ns | 482,216.21 ns | 1.00 | 0.00 | 213.3789 | 211.9141 | 211.9141 | 1048698 B | 1.000 | +| Actual | Add_WithCapacity | List | PooledList | 131072 | 221,421.92 ns | 611.385 ns | 477.329 ns | 221,254.47 ns | 0.46 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 1 | 12.80 ns | 0.016 ns | 0.014 ns | 12.80 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 1 | 17.43 ns | 0.030 ns | 0.025 ns | 17.42 ns | 1.36 | 0.00 | 0.0497 | - | - | 104 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 2 | 14.48 ns | 0.038 ns | 0.036 ns | 14.48 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 2 | 18.61 ns | 0.136 ns | 0.120 ns | 18.57 ns | 1.29 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 3 | 16.00 ns | 0.074 ns | 0.066 ns | 15.97 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 3 | 20.05 ns | 0.066 ns | 0.058 ns | 20.05 ns | 1.25 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 4 | 17.82 ns | 0.059 ns | 0.053 ns | 17.83 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 4 | 21.82 ns | 0.045 ns | 0.038 ns | 21.82 ns | 1.22 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 5 | 19.68 ns | 0.042 ns | 0.032 ns | 19.68 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 5 | 23.56 ns | 0.029 ns | 0.022 ns | 23.56 ns | 1.20 | 0.00 | 0.0536 | - | - | 112 B | 1.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 6 | 21.53 ns | 0.039 ns | 0.034 ns | 21.53 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 6 | 25.00 ns | 0.033 ns | 0.028 ns | 25.00 ns | 1.16 | 0.00 | 0.0574 | - | - | 120 B | 1.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 7 | 23.44 ns | 0.020 ns | 0.018 ns | 23.43 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 7 | 27.02 ns | 0.042 ns | 0.035 ns | 27.01 ns | 1.15 | 0.00 | 0.0612 | - | - | 128 B | 1.14 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 8 | 26.08 ns | 0.523 ns | 0.581 ns | 25.95 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 8 | 29.47 ns | 0.357 ns | 0.279 ns | 29.49 ns | 1.13 | 0.04 | 0.0650 | - | - | 136 B | 1.13 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 9 | 27.53 ns | 0.124 ns | 0.110 ns | 27.51 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 9 | 31.53 ns | 0.089 ns | 0.079 ns | 31.53 ns | 1.15 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 10 | 29.71 ns | 0.288 ns | 0.269 ns | 29.68 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 10 | 33.83 ns | 0.288 ns | 0.270 ns | 33.74 ns | 1.14 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 11 | 34.44 ns | 0.113 ns | 0.100 ns | 34.46 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 11 | 35.97 ns | 0.215 ns | 0.191 ns | 35.88 ns | 1.04 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 12 | 33.58 ns | 0.226 ns | 0.211 ns | 33.51 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 12 | 38.48 ns | 0.354 ns | 0.331 ns | 38.41 ns | 1.15 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 13 | 35.77 ns | 0.209 ns | 0.186 ns | 35.64 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 13 | 40.92 ns | 0.137 ns | 0.121 ns | 40.92 ns | 1.14 | 0.01 | 0.0842 | - | - | 176 B | 1.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 14 | 38.58 ns | 0.280 ns | 0.234 ns | 38.56 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 14 | 43.72 ns | 0.482 ns | 0.451 ns | 43.58 ns | 1.13 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 15 | 40.04 ns | 0.460 ns | 0.430 ns | 39.91 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 15 | 45.75 ns | 0.168 ns | 0.149 ns | 45.74 ns | 1.14 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 16 | 42.11 ns | 0.258 ns | 0.215 ns | 42.10 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 16 | 47.92 ns | 0.142 ns | 0.119 ns | 47.94 ns | 1.14 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 17 | 43.98 ns | 0.316 ns | 0.295 ns | 43.95 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 17 | 51.18 ns | 0.637 ns | 0.565 ns | 51.00 ns | 1.16 | 0.02 | 0.0994 | - | - | 208 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 18 | 45.72 ns | 0.409 ns | 0.382 ns | 45.59 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 18 | 53.26 ns | 0.498 ns | 0.466 ns | 53.05 ns | 1.17 | 0.01 | 0.1033 | - | - | 216 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 19 | 48.06 ns | 0.278 ns | 0.260 ns | 48.05 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 19 | 55.45 ns | 0.230 ns | 0.216 ns | 55.41 ns | 1.15 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 20 | 50.08 ns | 0.238 ns | 0.223 ns | 49.97 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 20 | 57.32 ns | 0.533 ns | 0.498 ns | 57.09 ns | 1.14 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 30 | 69.24 ns | 0.643 ns | 0.602 ns | 69.09 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 30 | 81.74 ns | 0.664 ns | 0.621 ns | 81.35 ns | 1.18 | 0.01 | 0.1491 | - | - | 312 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 32 | 72.81 ns | 0.378 ns | 0.316 ns | 72.81 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 32 | 87.48 ns | 0.212 ns | 0.198 ns | 87.53 ns | 1.20 | 0.01 | 0.1568 | - | - | 328 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 36 | 81.57 ns | 0.880 ns | 0.781 ns | 81.73 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 36 | 99.57 ns | 0.378 ns | 0.335 ns | 99.64 ns | 1.22 | 0.01 | 0.1721 | - | - | 360 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 37 | 89.11 ns | 1.630 ns | 1.273 ns | 89.50 ns | 1.00 | 0.00 | 0.1682 | - | - | 352 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 37 | 127.83 ns | 0.715 ns | 0.669 ns | 128.01 ns | 1.43 | 0.02 | 0.1721 | - | - | 360 B | 1.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 40 | 100.60 ns | 1.956 ns | 1.829 ns | 100.77 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Add_WithCapacity | List | RecyclableList | 40 | 96.93 ns | 1.901 ns | 1.952 ns | 97.31 ns | 0.96 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 40 | 132.87 ns | 0.305 ns | 0.270 ns | 132.88 ns | 1.32 | 0.03 | 0.1721 | - | - | 360 B | 0.96 | +| Actual | Add_WithCapacity | List | RecyclableList | 40 | 132.98 ns | 0.380 ns | 0.317 ns | 132.96 ns | 1.32 | 0.03 | 0.1721 | - | - | 360 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 50 | 122.19 ns | 0.858 ns | 0.716 ns | 122.23 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 50 | 153.66 ns | 0.269 ns | 0.239 ns | 153.67 ns | 1.26 | 0.01 | 0.1721 | - | - | 360 B | 0.79 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 60 | 142.67 ns | 0.584 ns | 0.547 ns | 142.66 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 60 | 175.78 ns | 0.770 ns | 0.721 ns | 175.90 ns | 1.23 | 0.01 | 0.1721 | - | - | 360 B | 0.67 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 70 | 169.94 ns | 3.440 ns | 4.709 ns | 170.87 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 70 | 214.05 ns | 1.535 ns | 1.436 ns | 213.30 ns | 1.26 | 0.03 | 0.0534 | - | - | 112 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 80 | 192.27 ns | 3.844 ns | 3.948 ns | 191.44 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 80 | 236.52 ns | 0.579 ns | 0.541 ns | 236.49 ns | 1.23 | 0.03 | 0.0534 | - | - | 112 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 90 | 218.31 ns | 4.248 ns | 4.546 ns | 219.57 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 90 | 257.85 ns | 1.160 ns | 0.969 ns | 257.73 ns | 1.18 | 0.03 | 0.0534 | - | - | 112 B | 0.14 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 100 | 244.71 ns | 4.644 ns | 4.344 ns | 245.77 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 100 | 280.88 ns | 0.682 ns | 0.605 ns | 280.80 ns | 1.15 | 0.02 | 0.0534 | - | - | 112 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 128 | 294.57 ns | 1.947 ns | 1.726 ns | 294.99 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 128 | 310.13 ns | 2.003 ns | 1.874 ns | 309.52 ns | 1.05 | 0.01 | 0.0381 | - | - | 80 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 256 | 565.60 ns | 8.771 ns | 7.324 ns | 562.34 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 256 | 591.69 ns | 1.404 ns | 1.244 ns | 591.34 ns | 1.05 | 0.01 | 0.0381 | - | - | 80 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 512 | 1,108.25 ns | 5.806 ns | 5.431 ns | 1,107.48 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableList | 512 | 1,154.82 ns | 2.660 ns | 2.358 ns | 1,153.35 ns | 1.04 | 0.01 | 0.0381 | - | - | 80 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 1024 | 2,152.43 ns | 20.796 ns | 18.435 ns | 2,152.17 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 1024 | 2,255.06 ns | 4.975 ns | 4.410 ns | 2,254.16 ns | 1.05 | 0.01 | 0.0381 | - | - | 80 B | 0.010 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 2048 | 4,255.57 ns | 40.950 ns | 38.305 ns | 4,250.56 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 2048 | 4,358.18 ns | 9.010 ns | 7.523 ns | 4,353.73 ns | 1.03 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 4096 | 8,524.22 ns | 37.787 ns | 33.497 ns | 8,522.63 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 4096 | 8,673.26 ns | 39.051 ns | 36.528 ns | 8,657.84 ns | 1.02 | 0.01 | 0.0305 | - | - | 80 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 8192 | 17,064.37 ns | 143.446 ns | 134.179 ns | 17,003.89 ns | 1.00 | 0.00 | 31.2195 | - | - | 65592 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 8192 | 17,284.62 ns | 34.690 ns | 32.449 ns | 17,275.01 ns | 1.01 | 0.01 | 0.0305 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 16384 | 78,157.95 ns | 1,525.105 ns | 2,462.760 ns | 78,296.25 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 16384 | 34,507.08 ns | 153.998 ns | 144.049 ns | 34,429.32 ns | 0.44 | 0.01 | - | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 32768 | 156,674.32 ns | 3,047.363 ns | 4,271.977 ns | 156,946.31 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 32768 | 68,860.84 ns | 80.362 ns | 71.239 ns | 68,855.95 ns | 0.44 | 0.02 | - | - | - | 81 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 65536 | 233,735.45 ns | 4,251.547 ns | 3,976.900 ns | 233,665.84 ns | 1.00 | 0.00 | 132.0801 | 131.1035 | 131.1035 | 524673 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 65536 | 138,055.14 ns | 369.543 ns | 345.671 ns | 137,870.92 ns | 0.59 | 0.01 | - | - | - | 82 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 131072 | 504,790.02 ns | 5,969.103 ns | 5,291.454 ns | 506,436.28 ns | 1.00 | 0.00 | 210.9375 | 209.9609 | 209.9609 | 1048765 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 131072 | 275,867.68 ns | 96.531 ns | 80.608 ns | 275,887.01 ns | 0.55 | 0.01 | - | - | - | 83 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableList | 850000 | 2,635,426.13 ns | 50,119.824 ns | 55,708.052 ns | 2,624,835.55 ns | 1.00 | 0.00 | 85.9375 | 85.9375 | 85.9375 | 6800208 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableList | 850000 | 2,401,992.30 ns | 4,520.948 ns | 4,007.703 ns | 2,401,877.54 ns | 0.91 | 0.02 | - | - | - | 139 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 1 | 14.11 ns | 0.057 ns | 0.051 ns | 14.13 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 1 | 60.51 ns | 0.522 ns | 0.488 ns | 60.63 ns | 4.29 | 0.03 | 0.0802 | - | - | 168 B | 2.62 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 2 | 15.93 ns | 0.104 ns | 0.092 ns | 15.92 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 2 | 64.19 ns | 1.320 ns | 1.296 ns | 64.39 ns | 4.02 | 0.08 | 0.0842 | - | - | 176 B | 2.44 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 3 | 17.79 ns | 0.091 ns | 0.080 ns | 17.77 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 3 | 66.86 ns | 0.498 ns | 0.416 ns | 66.86 ns | 3.76 | 0.03 | 0.0918 | - | - | 192 B | 2.40 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 4 | 19.43 ns | 0.149 ns | 0.140 ns | 19.38 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 4 | 70.85 ns | 1.004 ns | 0.939 ns | 70.82 ns | 3.65 | 0.06 | 0.0918 | - | - | 192 B | 2.18 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 5 | 21.70 ns | 0.243 ns | 0.215 ns | 21.67 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 5 | 72.39 ns | 1.181 ns | 1.105 ns | 71.87 ns | 3.34 | 0.07 | 0.1070 | - | - | 224 B | 2.33 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 6 | 23.76 ns | 0.327 ns | 0.290 ns | 23.60 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 6 | 73.96 ns | 0.906 ns | 0.757 ns | 74.01 ns | 3.11 | 0.05 | 0.1070 | - | - | 224 B | 2.15 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 7 | 25.83 ns | 0.286 ns | 0.223 ns | 25.78 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 7 | 94.74 ns | 4.565 ns | 13.460 ns | 92.68 ns | 4.08 | 0.42 | 0.1070 | - | - | 224 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 8 | 30.33 ns | 0.631 ns | 1.617 ns | 30.16 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 8 | 84.05 ns | 2.847 ns | 8.351 ns | 81.17 ns | 2.80 | 0.27 | 0.1070 | - | - | 224 B | 1.87 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 9 | 30.01 ns | 0.318 ns | 0.297 ns | 30.00 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 9 | 81.13 ns | 1.368 ns | 1.212 ns | 81.04 ns | 2.70 | 0.05 | 0.1377 | - | - | 288 B | 2.25 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 10 | 34.40 ns | 0.704 ns | 1.438 ns | 34.04 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 10 | 84.50 ns | 1.729 ns | 3.117 ns | 84.14 ns | 2.46 | 0.14 | 0.1377 | - | - | 288 B | 2.12 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 11 | 34.74 ns | 0.392 ns | 0.348 ns | 34.75 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 11 | 85.95 ns | 1.757 ns | 1.643 ns | 85.77 ns | 2.48 | 0.07 | 0.1377 | - | - | 288 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 12 | 37.67 ns | 0.264 ns | 0.247 ns | 37.73 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 12 | 86.94 ns | 1.272 ns | 1.063 ns | 86.94 ns | 2.30 | 0.03 | 0.1377 | - | - | 288 B | 1.89 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 13 | 39.38 ns | 0.519 ns | 0.460 ns | 39.22 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 13 | 90.96 ns | 1.624 ns | 2.970 ns | 90.66 ns | 2.39 | 0.07 | 0.1377 | - | - | 288 B | 1.80 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 14 | 41.30 ns | 0.222 ns | 0.197 ns | 41.32 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 14 | 93.14 ns | 1.654 ns | 1.547 ns | 93.02 ns | 2.25 | 0.04 | 0.1377 | - | - | 288 B | 1.71 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 15 | 44.04 ns | 0.230 ns | 0.204 ns | 43.96 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 15 | 88.12 ns | 0.719 ns | 0.637 ns | 88.03 ns | 2.00 | 0.02 | 0.1377 | - | - | 288 B | 1.64 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 16 | 46.40 ns | 0.577 ns | 0.511 ns | 46.40 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 16 | 96.94 ns | 1.592 ns | 1.411 ns | 97.18 ns | 2.09 | 0.04 | 0.1377 | - | - | 288 B | 1.57 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 17 | 48.27 ns | 0.370 ns | 0.346 ns | 48.35 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 17 | 103.04 ns | 1.313 ns | 1.228 ns | 102.99 ns | 2.13 | 0.03 | 0.1988 | - | - | 416 B | 2.17 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 18 | 49.75 ns | 0.383 ns | 0.339 ns | 49.73 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 18 | 105.65 ns | 1.259 ns | 1.178 ns | 106.00 ns | 2.12 | 0.03 | 0.1988 | - | - | 416 B | 2.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 19 | 53.29 ns | 0.720 ns | 0.638 ns | 53.36 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 19 | 107.52 ns | 2.117 ns | 2.678 ns | 106.73 ns | 2.01 | 0.06 | 0.1988 | - | - | 416 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 20 | 56.78 ns | 0.345 ns | 0.306 ns | 56.89 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 20 | 103.03 ns | 0.582 ns | 0.544 ns | 103.19 ns | 1.82 | 0.01 | 0.1988 | - | - | 416 B | 1.93 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 30 | 79.59 ns | 0.773 ns | 0.723 ns | 79.88 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 30 | 142.98 ns | 0.988 ns | 0.876 ns | 143.07 ns | 1.80 | 0.02 | 0.1988 | - | - | 416 B | 1.41 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 32 | 84.47 ns | 0.609 ns | 0.569 ns | 84.42 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 32 | 145.65 ns | 2.940 ns | 2.750 ns | 145.73 ns | 1.72 | 0.04 | 0.1988 | - | - | 416 B | 1.33 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 36 | 94.37 ns | 0.670 ns | 0.627 ns | 94.49 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 36 | 145.10 ns | 0.858 ns | 0.803 ns | 145.15 ns | 1.54 | 0.01 | 0.0801 | - | - | 168 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 37 | 83.50 ns | 1.135 ns | 1.006 ns | 83.23 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 37 | 144.06 ns | 0.955 ns | 0.797 ns | 143.93 ns | 1.72 | 0.02 | 0.0801 | - | - | 168 B | 0.48 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 40 | 103.07 ns | 1.236 ns | 1.096 ns | 103.18 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 40 | 86.75 ns | 0.542 ns | 0.507 ns | 86.77 ns | 0.84 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 40 | 151.75 ns | 1.716 ns | 1.605 ns | 151.45 ns | 1.47 | 0.02 | 0.0801 | - | - | 168 B | 0.45 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 40 | 150.59 ns | 1.097 ns | 0.972 ns | 150.73 ns | 1.46 | 0.02 | 0.0801 | - | - | 168 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 50 | 124.14 ns | 1.830 ns | 1.622 ns | 123.82 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 50 | 170.29 ns | 0.864 ns | 0.766 ns | 170.29 ns | 1.37 | 0.02 | 0.0801 | - | - | 168 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 60 | 141.58 ns | 0.639 ns | 0.534 ns | 141.76 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 60 | 188.44 ns | 1.495 ns | 1.399 ns | 188.76 ns | 1.33 | 0.01 | 0.0803 | - | - | 168 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 70 | 170.89 ns | 3.140 ns | 2.784 ns | 170.81 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 70 | 210.30 ns | 1.938 ns | 1.813 ns | 210.28 ns | 1.23 | 0.02 | 0.0803 | - | - | 168 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 80 | 187.99 ns | 2.402 ns | 2.247 ns | 187.38 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 80 | 230.68 ns | 1.599 ns | 1.496 ns | 230.18 ns | 1.23 | 0.02 | 0.0801 | - | - | 168 B | 0.24 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 850000 | 2,768,770.36 ns | 50,845.463 ns | 47,560.878 ns | 2,762,136.72 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800164 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 850000 | 1,857,547.84 ns | 7,617.442 ns | 6,360.909 ns | 1,854,395.90 ns | 0.67 | 0.01 | - | - | - | 433 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 90 | 213.28 ns | 3.741 ns | 3.499 ns | 213.59 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 90 | 248.04 ns | 1.525 ns | 1.427 ns | 247.73 ns | 1.16 | 0.02 | 0.0801 | - | - | 168 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 100 | 231.71 ns | 1.196 ns | 1.119 ns | 231.93 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 100 | 264.88 ns | 1.523 ns | 1.272 ns | 265.10 ns | 1.14 | 0.01 | 0.0801 | - | - | 168 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 128 | 293.05 ns | 2.043 ns | 1.911 ns | 292.89 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 128 | 331.71 ns | 0.918 ns | 0.767 ns | 331.84 ns | 1.13 | 0.01 | 0.0801 | - | - | 168 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 256 | 567.04 ns | 3.343 ns | 2.964 ns | 566.91 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 256 | 596.36 ns | 2.832 ns | 2.365 ns | 596.32 ns | 1.05 | 0.01 | 0.0801 | - | - | 168 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 512 | 1,105.23 ns | 8.376 ns | 7.835 ns | 1,104.20 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 512 | 1,095.69 ns | 3.640 ns | 3.405 ns | 1,095.34 ns | 0.99 | 0.01 | 0.0801 | - | - | 168 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 1024 | 2,145.10 ns | 11.480 ns | 9.586 ns | 2,145.07 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 1024 | 2,134.32 ns | 10.210 ns | 9.550 ns | 2,134.37 ns | 0.99 | 0.00 | 0.0801 | - | - | 168 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 2048 | 4,297.47 ns | 49.331 ns | 41.193 ns | 4,304.54 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 2048 | 4,282.77 ns | 20.153 ns | 18.852 ns | 4,282.29 ns | 1.00 | 0.01 | 0.0763 | - | - | 168 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 4096 | 8,569.46 ns | 45.492 ns | 40.327 ns | 8,573.28 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 4096 | 8,464.96 ns | 39.055 ns | 34.621 ns | 8,468.77 ns | 0.99 | 0.01 | 0.0763 | - | - | 168 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 8192 | 17,100.79 ns | 116.482 ns | 108.957 ns | 17,105.83 ns | 1.00 | 0.00 | 31.2195 | - | - | 65592 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 8192 | 16,739.78 ns | 88.784 ns | 83.048 ns | 16,769.72 ns | 0.98 | 0.01 | 0.0610 | - | - | 168 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 16384 | 79,162.86 ns | 1,577.689 ns | 3,001.718 ns | 78,393.41 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 16384 | 33,674.62 ns | 169.438 ns | 158.492 ns | 33,718.31 ns | 0.43 | 0.02 | 0.1831 | - | - | 448 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 32768 | 156,195.68 ns | 3,105.935 ns | 5,833.700 ns | 155,759.62 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 32768 | 67,152.12 ns | 391.122 ns | 365.856 ns | 67,110.84 ns | 0.43 | 0.02 | 0.1221 | - | - | 449 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 65536 | 230,945.86 ns | 2,636.658 ns | 2,337.329 ns | 231,439.67 ns | 1.00 | 0.00 | 130.3711 | 129.3945 | 129.3945 | 524744 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 65536 | 135,111.60 ns | 1,308.245 ns | 1,223.733 ns | 134,920.80 ns | 0.59 | 0.01 | - | - | - | 450 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | Add_WithCapacity | List | RecyclableLongList | 131072 | 500,459.08 ns | 9,518.732 ns | 10,961.786 ns | 499,489.31 ns | 1.00 | 0.00 | 209.9609 | 208.9844 | 208.9844 | 1048772 B | 1.000 | +| Actual | Add_WithCapacity | List | RecyclableLongList | 131072 | 268,397.92 ns | 1,542.779 ns | 1,443.116 ns | 268,233.11 ns | 0.54 | 0.01 | - | - | - | 451 B | 0.000 | +
+ +# `AddRange` with Pre-Initialized Capacity Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.400 + [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 +``` +
+Add Entire Collection with Pre-Initialized Capacity Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | AddRa(...)acity [21] | List | Array | 0 | 17.47 ns | 0.333 ns | 0.312 ns | 17.58 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 0 | 11.41 ns | 0.048 ns | 0.040 ns | 11.40 ns | 0.65 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 1 | 27.16 ns | 0.293 ns | 0.274 ns | 27.14 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 1 | 11.28 ns | 0.043 ns | 0.036 ns | 11.27 ns | 0.41 | 0.00 | 0.0153 | - | - | 32 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 2 | 27.83 ns | 0.394 ns | 0.369 ns | 27.74 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 2 | 11.66 ns | 0.056 ns | 0.053 ns | 11.65 ns | 0.42 | 0.01 | 0.0191 | - | - | 40 B | 0.56 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 3 | 29.26 ns | 0.479 ns | 0.425 ns | 29.18 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 3 | 11.82 ns | 0.019 ns | 0.015 ns | 11.82 ns | 0.40 | 0.01 | 0.0229 | - | - | 48 B | 0.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 4 | 28.97 ns | 0.261 ns | 0.218 ns | 29.04 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 4 | 12.31 ns | 0.219 ns | 0.205 ns | 12.24 ns | 0.43 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 5 | 29.94 ns | 0.378 ns | 0.354 ns | 29.89 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 5 | 12.61 ns | 0.061 ns | 0.057 ns | 12.60 ns | 0.42 | 0.01 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 6 | 28.28 ns | 0.201 ns | 0.178 ns | 28.25 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 6 | 12.81 ns | 0.055 ns | 0.043 ns | 12.80 ns | 0.45 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 7 | 29.81 ns | 0.107 ns | 0.095 ns | 29.81 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 7 | 13.29 ns | 0.147 ns | 0.137 ns | 13.22 ns | 0.45 | 0.01 | 0.0383 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 8 | 30.04 ns | 0.095 ns | 0.080 ns | 30.06 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 8 | 13.51 ns | 0.070 ns | 0.066 ns | 13.49 ns | 0.45 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 9 | 30.78 ns | 0.159 ns | 0.149 ns | 30.77 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 9 | 14.32 ns | 0.086 ns | 0.076 ns | 14.31 ns | 0.47 | 0.00 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 10 | 30.14 ns | 0.156 ns | 0.146 ns | 30.17 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 10 | 14.61 ns | 0.098 ns | 0.092 ns | 14.59 ns | 0.48 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 11 | 33.60 ns | 0.273 ns | 0.255 ns | 33.67 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 11 | 15.30 ns | 0.124 ns | 0.116 ns | 15.28 ns | 0.46 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 12 | 33.88 ns | 0.557 ns | 0.521 ns | 33.99 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 12 | 15.36 ns | 0.049 ns | 0.044 ns | 15.35 ns | 0.45 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 13 | 32.11 ns | 0.073 ns | 0.064 ns | 32.11 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 13 | 15.68 ns | 0.034 ns | 0.028 ns | 15.68 ns | 0.49 | 0.00 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 14 | 34.02 ns | 0.402 ns | 0.356 ns | 34.10 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 14 | 17.04 ns | 0.333 ns | 0.696 ns | 16.81 ns | 0.51 | 0.03 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 15 | 34.87 ns | 0.623 ns | 0.583 ns | 34.69 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 15 | 16.66 ns | 0.150 ns | 0.126 ns | 16.60 ns | 0.48 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 16 | 32.45 ns | 0.316 ns | 0.247 ns | 32.47 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 16 | 16.75 ns | 0.244 ns | 0.228 ns | 16.60 ns | 0.52 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 17 | 34.00 ns | 0.373 ns | 0.349 ns | 34.09 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 17 | 16.95 ns | 0.127 ns | 0.118 ns | 16.94 ns | 0.50 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 18 | 32.89 ns | 0.141 ns | 0.117 ns | 32.90 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 18 | 17.15 ns | 0.058 ns | 0.052 ns | 17.14 ns | 0.52 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 19 | 35.44 ns | 0.486 ns | 0.406 ns | 35.39 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 19 | 18.01 ns | 0.092 ns | 0.086 ns | 17.98 ns | 0.51 | 0.01 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 20 | 35.71 ns | 0.502 ns | 0.470 ns | 35.67 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 20 | 18.10 ns | 0.121 ns | 0.107 ns | 18.08 ns | 0.51 | 0.01 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 30 | 39.75 ns | 0.658 ns | 0.615 ns | 39.76 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 30 | 24.30 ns | 0.210 ns | 0.176 ns | 24.35 ns | 0.61 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 32 | 38.25 ns | 0.173 ns | 0.162 ns | 38.21 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 32 | 24.43 ns | 0.114 ns | 0.095 ns | 24.41 ns | 0.64 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 36 | 43.72 ns | 0.491 ns | 0.460 ns | 43.89 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 36 | 26.19 ns | 0.154 ns | 0.137 ns | 26.11 ns | 0.60 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 37 | 41.45 ns | 0.366 ns | 0.342 ns | 41.51 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 37 | 26.87 ns | 0.459 ns | 0.407 ns | 26.72 ns | 0.65 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 40 | 43.02 ns | 0.831 ns | 0.853 ns | 42.87 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | Array | 40 | 42.85 ns | 0.567 ns | 0.503 ns | 42.85 ns | 0.99 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.75 ns | 0.222 ns | 0.208 ns | 27.74 ns | 0.64 | 0.01 | 0.1645 | - | - | 344 B | 0.91 | +| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.35 ns | 0.219 ns | 0.205 ns | 27.25 ns | 0.64 | 0.01 | 0.1645 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 50 | 45.48 ns | 0.473 ns | 0.419 ns | 45.25 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 50 | 28.94 ns | 0.121 ns | 0.101 ns | 28.91 ns | 0.64 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 60 | 50.41 ns | 0.319 ns | 0.266 ns | 50.47 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 60 | 31.90 ns | 0.056 ns | 0.043 ns | 31.90 ns | 0.63 | 0.00 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 70 | 52.00 ns | 0.845 ns | 0.749 ns | 51.69 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 70 | 35.43 ns | 0.565 ns | 0.501 ns | 35.30 ns | 0.68 | 0.02 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 80 | 56.55 ns | 0.787 ns | 0.697 ns | 56.50 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 80 | 38.12 ns | 0.413 ns | 0.387 ns | 38.06 ns | 0.67 | 0.01 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 90 | 60.15 ns | 0.562 ns | 0.439 ns | 60.22 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 90 | 41.78 ns | 0.556 ns | 0.493 ns | 41.78 ns | 0.70 | 0.01 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 100 | 62.85 ns | 0.705 ns | 0.625 ns | 62.82 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 100 | 45.85 ns | 0.696 ns | 0.651 ns | 45.93 ns | 0.73 | 0.01 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 128 | 70.13 ns | 1.003 ns | 0.939 ns | 69.62 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 128 | 56.16 ns | 0.522 ns | 0.463 ns | 56.07 ns | 0.80 | 0.01 | 0.5010 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 256 | 115.82 ns | 0.644 ns | 0.538 ns | 115.72 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 256 | 102.02 ns | 0.299 ns | 0.265 ns | 101.97 ns | 0.88 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 512 | 206.04 ns | 1.092 ns | 0.968 ns | 205.57 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 512 | 179.93 ns | 0.294 ns | 0.261 ns | 179.90 ns | 0.87 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 1024 | 395.72 ns | 3.167 ns | 2.807 ns | 394.48 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 1024 | 350.98 ns | 4.600 ns | 4.078 ns | 349.02 ns | 0.89 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 2048 | 770.85 ns | 1.157 ns | 0.966 ns | 770.79 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 2048 | 685.18 ns | 9.571 ns | 8.953 ns | 680.08 ns | 0.89 | 0.01 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 4096 | 1,517.98 ns | 2.673 ns | 2.370 ns | 1,517.27 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 4096 | 1,465.87 ns | 3.699 ns | 3.279 ns | 1,465.55 ns | 0.97 | 0.00 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 8192 | 2,894.74 ns | 24.007 ns | 20.047 ns | 2,903.41 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 8192 | 2,843.05 ns | 7.940 ns | 7.038 ns | 2,843.14 ns | 0.98 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 16384 | 56,139.80 ns | 1,120.107 ns | 2,262.672 ns | 56,889.25 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 16384 | 56,250.19 ns | 1,108.909 ns | 2,290.090 ns | 57,251.32 ns | 1.00 | 0.06 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 32768 | 110,936.01 ns | 2,209.007 ns | 4,462.302 ns | 111,651.43 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 32768 | 113,828.41 ns | 1,997.108 ns | 1,770.384 ns | 114,270.10 ns | 1.02 | 0.05 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 65536 | 102,988.93 ns | 1,198.265 ns | 1,062.231 ns | 103,174.19 ns | 1.00 | 0.00 | 127.0752 | 125.9766 | 125.9766 | 524847 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 65536 | 107,630.06 ns | 1,165.349 ns | 1,090.068 ns | 107,104.48 ns | 1.04 | 0.02 | 112.0605 | 111.6943 | 111.6943 | 524343 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 131072 | 259,445.94 ns | 4,882.214 ns | 4,794.987 ns | 261,099.60 ns | 1.00 | 0.00 | 203.8574 | 202.3926 | 202.3926 | 1048869 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 131072 | 270,584.39 ns | 5,391.656 ns | 10,126.836 ns | 273,353.64 ns | 1.03 | 0.04 | 185.0586 | 184.5703 | 184.5703 | 1048657 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | Array | 850000 | 1,815,423.41 ns | 15,451.426 ns | 14,453.273 ns | 1,818,378.12 ns | 1.00 | 0.00 | 152.3438 | 152.3438 | 152.3438 | 6800107 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 850000 | 1,821,703.10 ns | 14,720.500 ns | 13,769.565 ns | 1,820,762.70 ns | 1.00 | 0.01 | 152.3438 | 152.3438 | 152.3438 | 6800075 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 0 | 16.97 ns | 0.091 ns | 0.085 ns | 16.96 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 0 | 18.73 ns | 0.149 ns | 0.139 ns | 18.69 ns | 1.10 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 1 | 28.36 ns | 0.352 ns | 0.312 ns | 28.26 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 1 | 46.39 ns | 0.830 ns | 0.776 ns | 46.48 ns | 1.64 | 0.03 | 0.0268 | - | - | 56 B | 0.88 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 2 | 28.19 ns | 0.185 ns | 0.155 ns | 28.19 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 2 | 45.49 ns | 0.938 ns | 0.963 ns | 45.67 ns | 1.62 | 0.04 | 0.0268 | - | - | 56 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 3 | 28.68 ns | 0.267 ns | 0.237 ns | 28.67 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 3 | 46.49 ns | 0.856 ns | 0.800 ns | 46.71 ns | 1.62 | 0.03 | 0.0268 | - | - | 56 B | 0.70 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 4 | 28.99 ns | 0.221 ns | 0.196 ns | 28.99 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 4 | 46.55 ns | 0.349 ns | 0.292 ns | 46.64 ns | 1.61 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 5 | 28.41 ns | 0.208 ns | 0.194 ns | 28.40 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 5 | 46.85 ns | 0.752 ns | 0.704 ns | 47.04 ns | 1.65 | 0.02 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 6 | 30.33 ns | 0.630 ns | 0.589 ns | 30.13 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 6 | 46.93 ns | 0.730 ns | 0.683 ns | 47.19 ns | 1.55 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 7 | 30.25 ns | 0.223 ns | 0.198 ns | 30.16 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 7 | 45.36 ns | 0.778 ns | 0.728 ns | 45.49 ns | 1.50 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 8 | 30.75 ns | 0.236 ns | 0.221 ns | 30.78 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 8 | 45.55 ns | 0.914 ns | 0.978 ns | 45.92 ns | 1.49 | 0.04 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 9 | 32.17 ns | 0.371 ns | 0.347 ns | 32.14 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 9 | 46.65 ns | 0.937 ns | 0.876 ns | 46.83 ns | 1.45 | 0.03 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 10 | 32.24 ns | 0.334 ns | 0.312 ns | 32.30 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 10 | 47.17 ns | 0.810 ns | 0.718 ns | 47.26 ns | 1.46 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 11 | 35.68 ns | 0.746 ns | 1.093 ns | 35.89 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 11 | 48.46 ns | 0.707 ns | 0.662 ns | 48.56 ns | 1.35 | 0.05 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 12 | 35.80 ns | 0.723 ns | 1.013 ns | 35.44 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 12 | 49.32 ns | 0.538 ns | 0.503 ns | 49.62 ns | 1.37 | 0.04 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 13 | 35.29 ns | 0.477 ns | 0.447 ns | 35.30 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 13 | 49.48 ns | 0.843 ns | 0.788 ns | 49.45 ns | 1.40 | 0.02 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 14 | 35.72 ns | 0.670 ns | 0.797 ns | 35.71 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 14 | 48.77 ns | 0.894 ns | 0.792 ns | 48.96 ns | 1.37 | 0.04 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 15 | 36.19 ns | 0.444 ns | 0.415 ns | 36.15 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 15 | 48.57 ns | 0.964 ns | 0.902 ns | 48.88 ns | 1.34 | 0.03 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 16 | 34.74 ns | 0.497 ns | 0.441 ns | 34.83 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 16 | 48.91 ns | 0.715 ns | 0.669 ns | 49.00 ns | 1.41 | 0.03 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 17 | 34.88 ns | 0.461 ns | 0.432 ns | 35.03 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 17 | 49.03 ns | 0.986 ns | 0.922 ns | 48.95 ns | 1.41 | 0.03 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 18 | 33.58 ns | 0.342 ns | 0.320 ns | 33.67 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 18 | 48.84 ns | 0.593 ns | 0.555 ns | 48.91 ns | 1.45 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 19 | 35.99 ns | 0.741 ns | 1.176 ns | 35.87 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 19 | 50.89 ns | 1.017 ns | 0.999 ns | 50.97 ns | 1.41 | 0.05 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 20 | 38.49 ns | 0.760 ns | 0.635 ns | 38.70 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 20 | 49.49 ns | 0.983 ns | 1.092 ns | 49.55 ns | 1.29 | 0.04 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 30 | 40.20 ns | 0.654 ns | 0.580 ns | 39.96 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 30 | 50.19 ns | 1.018 ns | 1.089 ns | 50.35 ns | 1.25 | 0.03 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 32 | 40.25 ns | 0.458 ns | 0.429 ns | 40.21 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 32 | 49.90 ns | 0.936 ns | 1.281 ns | 49.53 ns | 1.24 | 0.04 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 36 | 44.36 ns | 0.828 ns | 0.775 ns | 44.32 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 36 | 51.52 ns | 0.818 ns | 0.765 ns | 51.56 ns | 1.16 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 37 | 45.10 ns | 0.903 ns | 1.075 ns | 44.70 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 37 | 50.92 ns | 0.633 ns | 0.592 ns | 50.96 ns | 1.13 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 41.96 ns | 0.395 ns | 0.370 ns | 41.95 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 42.10 ns | 0.579 ns | 0.513 ns | 41.99 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 50.83 ns | 0.847 ns | 0.792 ns | 51.14 ns | 1.21 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 48.82 ns | 0.975 ns | 0.958 ns | 48.97 ns | 1.16 | 0.03 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 50 | 44.73 ns | 0.194 ns | 0.172 ns | 44.72 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 50 | 51.85 ns | 0.577 ns | 0.540 ns | 51.77 ns | 1.16 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 60 | 50.00 ns | 0.799 ns | 0.747 ns | 49.92 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 60 | 52.46 ns | 1.063 ns | 0.995 ns | 52.66 ns | 1.05 | 0.03 | 0.0268 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 70 | 53.58 ns | 0.465 ns | 0.435 ns | 53.64 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 70 | 53.86 ns | 0.772 ns | 0.722 ns | 53.87 ns | 1.01 | 0.01 | 0.0268 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 80 | 55.85 ns | 0.385 ns | 0.360 ns | 55.71 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 80 | 51.50 ns | 1.059 ns | 1.449 ns | 51.70 ns | 0.93 | 0.02 | 0.0268 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 850000 | 2,250,645.82 ns | 44,040.987 ns | 81,632.793 ns | 2,252,766.41 ns | 1.00 | 0.00 | 97.6563 | 97.6563 | 97.6563 | 6800090 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 850000 | 767,171.84 ns | 12,585.756 ns | 11,772.724 ns | 771,397.17 ns | 0.34 | 0.01 | - | - | - | 57 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 90 | 59.30 ns | 0.281 ns | 0.234 ns | 59.26 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 90 | 53.80 ns | 0.828 ns | 0.775 ns | 54.17 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 100 | 65.07 ns | 0.397 ns | 0.371 ns | 65.06 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 100 | 54.17 ns | 0.944 ns | 0.969 ns | 54.35 ns | 0.83 | 0.02 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 128 | 69.83 ns | 0.224 ns | 0.175 ns | 69.79 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 128 | 56.93 ns | 1.088 ns | 1.018 ns | 57.30 ns | 0.82 | 0.02 | 0.0268 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 256 | 115.77 ns | 0.376 ns | 0.334 ns | 115.65 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 256 | 58.29 ns | 0.592 ns | 0.525 ns | 58.15 ns | 0.50 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 512 | 207.08 ns | 1.322 ns | 1.237 ns | 206.64 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 512 | 85.60 ns | 0.732 ns | 0.684 ns | 85.98 ns | 0.41 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 1024 | 399.39 ns | 0.902 ns | 0.799 ns | 399.21 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 1024 | 118.41 ns | 0.536 ns | 0.502 ns | 118.31 ns | 0.30 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 2048 | 781.56 ns | 7.964 ns | 7.449 ns | 777.82 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 2048 | 269.41 ns | 0.987 ns | 0.875 ns | 269.24 ns | 0.34 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 4096 | 1,531.02 ns | 7.857 ns | 6.135 ns | 1,531.64 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 4096 | 598.77 ns | 1.315 ns | 1.098 ns | 598.35 ns | 0.39 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 8192 | 2,825.05 ns | 5.936 ns | 5.262 ns | 2,824.78 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 8192 | 1,129.73 ns | 3.459 ns | 3.066 ns | 1,128.38 ns | 0.40 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 16384 | 57,730.42 ns | 1,145.775 ns | 1,319.476 ns | 58,057.66 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 16384 | 2,478.27 ns | 13.160 ns | 12.309 ns | 2,472.38 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 32768 | 113,033.51 ns | 2,195.740 ns | 3,218.487 ns | 114,504.60 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 32768 | 5,365.09 ns | 35.512 ns | 31.480 ns | 5,357.99 ns | 0.05 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 65536 | 102,429.88 ns | 1,646.786 ns | 1,540.404 ns | 102,706.71 ns | 1.00 | 0.00 | 123.6572 | 122.5586 | 122.5586 | 524925 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 65536 | 11,573.79 ns | 25.570 ns | 21.352 ns | 11,569.69 ns | 0.11 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 131072 | 310,167.86 ns | 6,143.482 ns | 16,184.390 ns | 309,573.83 ns | 1.00 | 0.00 | 129.8828 | 128.9063 | 128.9063 | 1049061 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 131072 | 22,926.90 ns | 105.295 ns | 98.493 ns | 22,921.88 ns | 0.07 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 0 | 17.83 ns | 0.210 ns | 0.196 ns | 17.88 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 0 | 22.97 ns | 0.113 ns | 0.100 ns | 22.97 ns | 1.29 | 0.02 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1 | 27.04 ns | 0.151 ns | 0.126 ns | 27.01 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 1 | 23.37 ns | 0.172 ns | 0.160 ns | 23.35 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2 | 28.67 ns | 0.217 ns | 0.203 ns | 28.63 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 2 | 23.30 ns | 0.128 ns | 0.119 ns | 23.28 ns | 0.81 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 3 | 29.08 ns | 0.274 ns | 0.256 ns | 29.05 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 3 | 23.69 ns | 0.367 ns | 0.286 ns | 23.69 ns | 0.81 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4 | 28.39 ns | 0.222 ns | 0.185 ns | 28.35 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 4 | 23.23 ns | 0.230 ns | 0.203 ns | 23.20 ns | 0.82 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 5 | 29.92 ns | 0.373 ns | 0.348 ns | 29.83 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 5 | 23.63 ns | 0.208 ns | 0.194 ns | 23.58 ns | 0.79 | 0.01 | 0.0536 | - | - | 112 B | 1.17 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 6 | 29.65 ns | 0.284 ns | 0.251 ns | 29.57 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 6 | 23.56 ns | 0.204 ns | 0.191 ns | 23.55 ns | 0.79 | 0.01 | 0.0574 | - | - | 120 B | 1.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 7 | 30.09 ns | 0.173 ns | 0.162 ns | 30.08 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 7 | 24.11 ns | 0.251 ns | 0.222 ns | 24.06 ns | 0.80 | 0.01 | 0.0612 | - | - | 128 B | 1.14 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8 | 30.35 ns | 0.304 ns | 0.269 ns | 30.27 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 8 | 24.37 ns | 0.142 ns | 0.126 ns | 24.33 ns | 0.80 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 9 | 31.25 ns | 0.097 ns | 0.076 ns | 31.25 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 9 | 25.24 ns | 0.387 ns | 0.343 ns | 25.19 ns | 0.81 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 10 | 30.77 ns | 0.419 ns | 0.392 ns | 30.56 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 10 | 26.18 ns | 0.470 ns | 0.440 ns | 26.25 ns | 0.85 | 0.02 | 0.0727 | - | - | 152 B | 1.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 11 | 31.44 ns | 0.091 ns | 0.076 ns | 31.41 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 11 | 25.83 ns | 0.236 ns | 0.209 ns | 25.76 ns | 0.82 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 12 | 31.71 ns | 0.378 ns | 0.353 ns | 31.58 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 12 | 26.36 ns | 0.214 ns | 0.190 ns | 26.36 ns | 0.83 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 13 | 33.58 ns | 0.535 ns | 0.500 ns | 33.33 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 13 | 26.56 ns | 0.377 ns | 0.334 ns | 26.53 ns | 0.79 | 0.02 | 0.0842 | - | - | 176 B | 1.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 14 | 33.64 ns | 0.355 ns | 0.332 ns | 33.78 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 14 | 26.76 ns | 0.319 ns | 0.299 ns | 26.79 ns | 0.80 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 15 | 32.06 ns | 0.129 ns | 0.115 ns | 32.08 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 15 | 26.79 ns | 0.311 ns | 0.275 ns | 26.76 ns | 0.84 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16 | 34.07 ns | 0.265 ns | 0.247 ns | 33.98 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 16 | 28.54 ns | 0.231 ns | 0.193 ns | 28.57 ns | 0.84 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 17 | 34.40 ns | 0.295 ns | 0.276 ns | 34.31 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 17 | 28.32 ns | 0.159 ns | 0.141 ns | 28.36 ns | 0.82 | 0.01 | 0.0994 | - | - | 208 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 18 | 34.36 ns | 0.138 ns | 0.129 ns | 34.31 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 18 | 28.55 ns | 0.180 ns | 0.160 ns | 28.59 ns | 0.83 | 0.01 | 0.1033 | - | - | 216 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 19 | 35.91 ns | 0.319 ns | 0.299 ns | 35.83 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 19 | 29.00 ns | 0.268 ns | 0.223 ns | 28.97 ns | 0.81 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 20 | 34.45 ns | 0.347 ns | 0.325 ns | 34.34 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 20 | 29.58 ns | 0.208 ns | 0.162 ns | 29.52 ns | 0.86 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 30 | 40.09 ns | 0.629 ns | 0.588 ns | 39.86 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 30 | 32.58 ns | 0.384 ns | 0.360 ns | 32.65 ns | 0.81 | 0.02 | 0.1492 | - | - | 312 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32 | 40.19 ns | 0.715 ns | 0.669 ns | 39.87 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 32 | 32.04 ns | 0.477 ns | 0.446 ns | 31.98 ns | 0.80 | 0.01 | 0.1568 | - | - | 328 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 36 | 40.58 ns | 0.419 ns | 0.392 ns | 40.39 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 36 | 34.05 ns | 0.524 ns | 0.490 ns | 33.97 ns | 0.84 | 0.02 | 0.1721 | - | - | 360 B | 1.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 37 | 49.74 ns | 0.477 ns | 0.398 ns | 49.67 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 37 | 40.70 ns | 0.723 ns | 0.677 ns | 40.77 ns | 0.82 | 0.01 | 0.0382 | - | - | 80 B | 0.23 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 49.81 ns | 0.517 ns | 0.484 ns | 49.75 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 52.08 ns | 0.939 ns | 0.878 ns | 52.32 ns | 1.05 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 39.35 ns | 0.409 ns | 0.383 ns | 39.29 ns | 0.79 | 0.01 | 0.0382 | - | - | 80 B | 0.21 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 39.09 ns | 0.290 ns | 0.242 ns | 39.05 ns | 0.78 | 0.01 | 0.0382 | - | - | 80 B | 0.21 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 50 | 54.07 ns | 1.105 ns | 1.315 ns | 53.74 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 50 | 39.59 ns | 0.225 ns | 0.176 ns | 39.59 ns | 0.73 | 0.02 | 0.0382 | - | - | 80 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 60 | 59.75 ns | 0.694 ns | 0.615 ns | 59.68 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 60 | 39.27 ns | 0.395 ns | 0.369 ns | 39.17 ns | 0.66 | 0.01 | 0.0382 | - | - | 80 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 70 | 62.51 ns | 1.074 ns | 0.952 ns | 62.54 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 70 | 42.73 ns | 0.567 ns | 0.473 ns | 42.68 ns | 0.68 | 0.01 | 0.0382 | - | - | 80 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 80 | 69.90 ns | 0.640 ns | 0.567 ns | 69.84 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 80 | 41.26 ns | 0.321 ns | 0.301 ns | 41.18 ns | 0.59 | 0.01 | 0.0382 | - | - | 80 B | 0.11 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 90 | 75.08 ns | 0.725 ns | 0.678 ns | 75.01 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 90 | 44.30 ns | 0.885 ns | 1.053 ns | 43.91 ns | 0.59 | 0.01 | 0.0382 | - | - | 80 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 100 | 80.72 ns | 1.560 ns | 1.797 ns | 80.43 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 100 | 44.82 ns | 0.668 ns | 0.624 ns | 44.87 ns | 0.56 | 0.02 | 0.0382 | - | - | 80 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 128 | 95.32 ns | 1.581 ns | 1.479 ns | 95.06 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 128 | 44.00 ns | 0.080 ns | 0.067 ns | 44.00 ns | 0.46 | 0.01 | 0.0382 | - | - | 80 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 256 | 157.62 ns | 2.887 ns | 2.700 ns | 158.03 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 256 | 54.53 ns | 1.059 ns | 1.133 ns | 54.56 ns | 0.35 | 0.01 | 0.0381 | - | - | 80 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 512 | 285.02 ns | 5.731 ns | 5.361 ns | 285.71 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 512 | 74.42 ns | 0.656 ns | 0.614 ns | 74.24 ns | 0.26 | 0.00 | 0.0381 | - | - | 80 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1024 | 573.97 ns | 11.070 ns | 11.844 ns | 570.64 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 1024 | 107.65 ns | 1.021 ns | 0.955 ns | 107.28 ns | 0.19 | 0.00 | 0.0381 | - | - | 80 B | 0.010 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2048 | 1,100.59 ns | 21.785 ns | 25.087 ns | 1,100.00 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 2048 | 258.92 ns | 0.553 ns | 0.517 ns | 259.14 ns | 0.23 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4096 | 2,158.50 ns | 43.128 ns | 49.666 ns | 2,152.95 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 4096 | 573.07 ns | 1.056 ns | 0.882 ns | 572.72 ns | 0.27 | 0.01 | 0.0381 | - | - | 80 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8192 | 4,209.13 ns | 78.520 ns | 77.117 ns | 4,203.19 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 8192 | 1,176.87 ns | 3.637 ns | 3.402 ns | 1,175.27 ns | 0.28 | 0.01 | 0.0381 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16384 | 59,377.65 ns | 1,169.439 ns | 1,251.287 ns | 59,336.36 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 16384 | 2,446.97 ns | 5.342 ns | 4.997 ns | 2,446.45 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32768 | 121,530.46 ns | 1,092.093 ns | 968.112 ns | 121,635.47 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 32768 | 5,369.72 ns | 27.395 ns | 25.625 ns | 5,358.22 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 65536 | 109,162.95 ns | 1,785.643 ns | 1,833.724 ns | 108,922.86 ns | 1.00 | 0.00 | 115.3564 | 114.2578 | 114.2578 | 525006 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 65536 | 11,399.72 ns | 7.312 ns | 5.709 ns | 11,399.52 ns | 0.10 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 131072 | 323,491.82 ns | 10,223.323 ns | 30,143.699 ns | 320,071.29 ns | 1.00 | 0.00 | 143.5547 | 142.5781 | 142.5781 | 1049100 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 131072 | 23,083.70 ns | 64.841 ns | 57.480 ns | 23,065.26 ns | 0.07 | 0.01 | 0.0305 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 850000 | 2,235,065.56 ns | 44,500.332 ns | 90,902.387 ns | 2,221,848.24 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 850000 | 771,934.11 ns | 6,876.389 ns | 5,368.632 ns | 773,185.45 ns | 0.34 | 0.02 | - | - | - | 93 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 17.79 ns | 0.113 ns | 0.100 ns | 17.77 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 19.75 ns | 0.104 ns | 0.092 ns | 19.73 ns | 1.11 | 0.01 | 0.0382 | - | - | 80 B | 2.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 28.96 ns | 0.190 ns | 0.178 ns | 29.00 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 63.22 ns | 1.229 ns | 1.315 ns | 63.21 ns | 2.18 | 0.04 | 0.0688 | - | - | 144 B | 2.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 27.24 ns | 0.362 ns | 0.321 ns | 27.22 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 62.76 ns | 1.167 ns | 1.092 ns | 63.05 ns | 2.30 | 0.04 | 0.0726 | - | - | 152 B | 2.11 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 29.27 ns | 0.292 ns | 0.274 ns | 29.36 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 67.54 ns | 1.064 ns | 0.995 ns | 67.69 ns | 2.31 | 0.04 | 0.0802 | - | - | 168 B | 2.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 29.88 ns | 0.409 ns | 0.363 ns | 29.86 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 61.32 ns | 0.588 ns | 0.550 ns | 61.40 ns | 2.05 | 0.03 | 0.0802 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 30.30 ns | 0.505 ns | 0.472 ns | 30.00 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 70.50 ns | 1.101 ns | 1.030 ns | 70.46 ns | 2.33 | 0.06 | 0.0956 | - | - | 200 B | 2.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 28.41 ns | 0.273 ns | 0.256 ns | 28.32 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 69.63 ns | 0.604 ns | 0.535 ns | 69.56 ns | 2.45 | 0.03 | 0.0956 | - | - | 200 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 29.05 ns | 0.312 ns | 0.292 ns | 28.95 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 68.21 ns | 1.276 ns | 1.194 ns | 68.16 ns | 2.35 | 0.04 | 0.0956 | - | - | 200 B | 1.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 29.10 ns | 0.084 ns | 0.066 ns | 29.08 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 61.73 ns | 0.821 ns | 0.728 ns | 61.55 ns | 2.12 | 0.02 | 0.0956 | - | - | 200 B | 1.67 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 30.56 ns | 0.263 ns | 0.246 ns | 30.58 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 73.09 ns | 1.487 ns | 1.770 ns | 73.14 ns | 2.39 | 0.07 | 0.1262 | - | - | 264 B | 2.06 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 33.47 ns | 0.480 ns | 0.426 ns | 33.54 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 73.77 ns | 1.411 ns | 1.385 ns | 73.67 ns | 2.21 | 0.06 | 0.1262 | - | - | 264 B | 1.94 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 31.23 ns | 0.436 ns | 0.364 ns | 31.13 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 75.22 ns | 1.109 ns | 1.037 ns | 75.30 ns | 2.41 | 0.04 | 0.1262 | - | - | 264 B | 1.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 33.76 ns | 0.282 ns | 0.264 ns | 33.78 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 73.59 ns | 1.137 ns | 1.063 ns | 73.43 ns | 2.18 | 0.04 | 0.1262 | - | - | 264 B | 1.74 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 31.65 ns | 0.297 ns | 0.248 ns | 31.58 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 73.81 ns | 1.156 ns | 1.081 ns | 73.93 ns | 2.33 | 0.03 | 0.1262 | - | - | 264 B | 1.65 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 32.36 ns | 0.373 ns | 0.311 ns | 32.35 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 74.67 ns | 1.482 ns | 1.314 ns | 74.60 ns | 2.30 | 0.05 | 0.1262 | - | - | 264 B | 1.57 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 32.22 ns | 0.490 ns | 0.459 ns | 31.99 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 76.58 ns | 1.552 ns | 1.451 ns | 76.28 ns | 2.38 | 0.06 | 0.1262 | - | - | 264 B | 1.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 32.34 ns | 0.511 ns | 0.453 ns | 32.15 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 67.38 ns | 1.334 ns | 1.247 ns | 67.15 ns | 2.09 | 0.06 | 0.1262 | - | - | 264 B | 1.43 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 34.79 ns | 0.599 ns | 0.531 ns | 34.60 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 78.84 ns | 1.156 ns | 1.081 ns | 78.93 ns | 2.27 | 0.04 | 0.1874 | - | - | 392 B | 2.04 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 35.21 ns | 0.489 ns | 0.458 ns | 35.11 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 78.97 ns | 1.603 ns | 1.500 ns | 78.86 ns | 2.24 | 0.05 | 0.1874 | - | - | 392 B | 1.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 36.88 ns | 0.607 ns | 0.538 ns | 36.71 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 80.61 ns | 1.571 ns | 2.352 ns | 80.11 ns | 2.18 | 0.05 | 0.1874 | - | - | 392 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 34.37 ns | 0.177 ns | 0.148 ns | 34.35 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 80.30 ns | 1.567 ns | 1.466 ns | 80.14 ns | 2.34 | 0.03 | 0.1874 | - | - | 392 B | 1.81 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 40.35 ns | 0.602 ns | 0.534 ns | 40.30 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 79.78 ns | 1.080 ns | 1.010 ns | 80.23 ns | 1.98 | 0.04 | 0.1874 | - | - | 392 B | 1.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 57.83 ns | 0.249 ns | 0.233 ns | 57.77 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 71.00 ns | 0.291 ns | 0.243 ns | 71.02 ns | 1.23 | 0.01 | 0.1874 | - | - | 392 B | 1.26 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 49.00 ns | 0.370 ns | 0.346 ns | 49.06 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 87.38 ns | 1.271 ns | 1.127 ns | 87.10 ns | 1.78 | 0.03 | 0.0688 | - | - | 144 B | 0.42 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 51.51 ns | 0.383 ns | 0.320 ns | 51.62 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 95.17 ns | 0.805 ns | 0.714 ns | 95.14 ns | 1.85 | 0.02 | 0.0688 | - | - | 144 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 51.09 ns | 0.490 ns | 0.459 ns | 50.97 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 50.67 ns | 0.382 ns | 0.357 ns | 50.72 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 94.34 ns | 0.529 ns | 0.494 ns | 94.42 ns | 1.85 | 0.02 | 0.0688 | - | - | 144 B | 0.38 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 92.29 ns | 0.735 ns | 0.688 ns | 92.28 ns | 1.81 | 0.03 | 0.0688 | - | - | 144 B | 0.38 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 54.53 ns | 0.672 ns | 0.629 ns | 54.44 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 86.75 ns | 0.621 ns | 0.519 ns | 86.75 ns | 1.59 | 0.01 | 0.0688 | - | - | 144 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 58.38 ns | 0.196 ns | 0.164 ns | 58.38 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 95.20 ns | 0.808 ns | 0.675 ns | 95.15 ns | 1.63 | 0.01 | 0.0688 | - | - | 144 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 64.74 ns | 0.550 ns | 0.460 ns | 64.77 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 96.66 ns | 0.657 ns | 0.582 ns | 96.57 ns | 1.49 | 0.01 | 0.0688 | - | - | 144 B | 0.23 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 71.68 ns | 1.478 ns | 1.642 ns | 71.31 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 103.54 ns | 2.057 ns | 2.020 ns | 102.75 ns | 1.45 | 0.04 | 0.0688 | - | - | 144 B | 0.21 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 2,230,599.91 ns | 44,380.632 ns | 114,560.583 ns | 2,222,113.09 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 1,155,742.01 ns | 4,080.497 ns | 3,185.784 ns | 1,154,853.91 ns | 0.50 | 0.03 | - | - | - | 437 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 72.88 ns | 0.808 ns | 0.716 ns | 72.71 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 96.04 ns | 0.836 ns | 0.782 ns | 95.80 ns | 1.32 | 0.02 | 0.0688 | - | - | 144 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 89.61 ns | 1.360 ns | 1.272 ns | 89.64 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 101.07 ns | 1.215 ns | 1.137 ns | 100.94 ns | 1.13 | 0.02 | 0.0688 | - | - | 144 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 104.85 ns | 2.030 ns | 2.639 ns | 105.60 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 104.80 ns | 2.118 ns | 1.877 ns | 105.04 ns | 1.01 | 0.03 | 0.0688 | - | - | 144 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 179.97 ns | 3.625 ns | 9.421 ns | 181.43 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 128.77 ns | 2.629 ns | 5.189 ns | 129.94 ns | 0.72 | 0.04 | 0.0687 | - | - | 144 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 334.51 ns | 6.695 ns | 13.214 ns | 336.01 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 144.37 ns | 2.385 ns | 2.114 ns | 144.58 ns | 0.43 | 0.02 | 0.0687 | - | - | 144 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 657.29 ns | 13.023 ns | 14.997 ns | 652.88 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 183.48 ns | 2.584 ns | 2.417 ns | 182.64 ns | 0.28 | 0.01 | 0.0687 | - | - | 144 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 1,090.14 ns | 21.036 ns | 52.387 ns | 1,081.91 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 331.87 ns | 4.616 ns | 4.317 ns | 331.39 ns | 0.29 | 0.01 | 0.0687 | - | - | 144 B | 0.009 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 2,145.31 ns | 33.489 ns | 31.325 ns | 2,151.36 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 636.06 ns | 4.107 ns | 3.640 ns | 634.39 ns | 0.30 | 0.00 | 0.0687 | - | - | 144 B | 0.004 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 4,230.61 ns | 83.669 ns | 102.753 ns | 4,229.90 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 1,207.70 ns | 5.585 ns | 4.664 ns | 1,208.68 ns | 0.29 | 0.01 | 0.0687 | - | - | 144 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 60,726.29 ns | 421.969 ns | 374.065 ns | 60,803.53 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 2,523.02 ns | 11.024 ns | 10.311 ns | 2,522.34 ns | 0.04 | 0.00 | 0.2022 | - | - | 424 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 115,717.23 ns | 2,245.857 ns | 3,562.167 ns | 115,670.65 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262253 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 5,158.65 ns | 16.619 ns | 14.732 ns | 5,159.40 ns | 0.04 | 0.00 | 0.1984 | - | - | 424 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 108,583.75 ns | 613.559 ns | 573.924 ns | 108,597.95 ns | 1.00 | 0.00 | 112.3047 | 111.2061 | 111.2061 | 525069 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 11,203.73 ns | 50.533 ns | 42.197 ns | 11,190.20 ns | 0.10 | 0.00 | 0.1984 | - | - | 424 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 365,941.87 ns | 7,298.546 ns | 18,577.129 ns | 365,174.68 ns | 1.00 | 0.00 | 127.9297 | 126.9531 | 126.9531 | 1049115 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 22,439.59 ns | 291.491 ns | 272.661 ns | 22,280.94 ns | 0.06 | 0.00 | 0.1831 | - | - | 424 B | 0.000 | +
+ +# `AddRange` with Pre-Initialized Capacity when Source is Array Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.400 + [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 +``` +
+Add Entire Collection with Pre-Initialized Capacity Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | AddRa(...)acity [21] | List | Array | 0 | 18.91 ns | 0.399 ns | 0.504 ns | 18.94 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 0 | 11.92 ns | 0.266 ns | 0.273 ns | 11.95 ns | 0.63 | 0.03 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 1 | 32.37 ns | 0.663 ns | 0.972 ns | 32.43 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 1 | 11.73 ns | 0.162 ns | 0.143 ns | 11.74 ns | 0.37 | 0.01 | 0.0153 | - | - | 32 B | 0.50 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 2 | 32.43 ns | 0.532 ns | 0.472 ns | 32.48 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 2 | 11.83 ns | 0.157 ns | 0.147 ns | 11.81 ns | 0.36 | 0.01 | 0.0191 | - | - | 40 B | 0.56 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 3 | 28.97 ns | 0.466 ns | 0.436 ns | 28.97 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 3 | 12.08 ns | 0.147 ns | 0.137 ns | 12.05 ns | 0.42 | 0.01 | 0.0229 | - | - | 48 B | 0.60 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 4 | 30.66 ns | 0.610 ns | 0.571 ns | 30.71 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 4 | 12.73 ns | 0.135 ns | 0.126 ns | 12.66 ns | 0.42 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 5 | 32.46 ns | 0.396 ns | 0.351 ns | 32.45 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 5 | 12.59 ns | 0.027 ns | 0.021 ns | 12.59 ns | 0.39 | 0.00 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 6 | 31.34 ns | 0.568 ns | 0.531 ns | 31.12 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 6 | 13.00 ns | 0.101 ns | 0.084 ns | 12.98 ns | 0.42 | 0.01 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 7 | 31.63 ns | 0.578 ns | 0.541 ns | 31.68 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 7 | 13.37 ns | 0.164 ns | 0.137 ns | 13.35 ns | 0.42 | 0.01 | 0.0383 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 8 | 29.16 ns | 0.177 ns | 0.165 ns | 29.15 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 8 | 13.61 ns | 0.107 ns | 0.100 ns | 13.56 ns | 0.47 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 9 | 33.82 ns | 0.522 ns | 0.488 ns | 33.86 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 9 | 14.31 ns | 0.099 ns | 0.092 ns | 14.29 ns | 0.42 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 10 | 33.45 ns | 0.406 ns | 0.380 ns | 33.48 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 10 | 14.67 ns | 0.138 ns | 0.130 ns | 14.70 ns | 0.44 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 11 | 36.25 ns | 0.417 ns | 0.369 ns | 36.23 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 11 | 15.23 ns | 0.073 ns | 0.069 ns | 15.20 ns | 0.42 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 12 | 32.13 ns | 0.274 ns | 0.229 ns | 32.16 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 12 | 15.46 ns | 0.158 ns | 0.147 ns | 15.40 ns | 0.48 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 13 | 32.25 ns | 0.346 ns | 0.307 ns | 32.16 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 13 | 15.81 ns | 0.140 ns | 0.131 ns | 15.76 ns | 0.49 | 0.01 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 14 | 35.85 ns | 0.332 ns | 0.311 ns | 35.89 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 14 | 16.09 ns | 0.076 ns | 0.064 ns | 16.07 ns | 0.45 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 15 | 37.66 ns | 0.229 ns | 0.192 ns | 37.69 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 15 | 16.45 ns | 0.159 ns | 0.149 ns | 16.40 ns | 0.44 | 0.00 | 0.0688 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 16 | 32.29 ns | 0.354 ns | 0.331 ns | 32.18 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 16 | 16.70 ns | 0.207 ns | 0.184 ns | 16.63 ns | 0.52 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 17 | 37.59 ns | 0.256 ns | 0.239 ns | 37.54 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 17 | 16.87 ns | 0.071 ns | 0.063 ns | 16.85 ns | 0.45 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 18 | 32.75 ns | 0.392 ns | 0.366 ns | 32.64 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 18 | 17.15 ns | 0.063 ns | 0.059 ns | 17.13 ns | 0.52 | 0.01 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 19 | 39.10 ns | 0.741 ns | 0.693 ns | 38.87 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 19 | 17.87 ns | 0.127 ns | 0.118 ns | 17.81 ns | 0.46 | 0.01 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 20 | 37.71 ns | 0.776 ns | 0.797 ns | 37.79 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 20 | 17.94 ns | 0.125 ns | 0.117 ns | 17.90 ns | 0.48 | 0.01 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 30 | 40.95 ns | 0.779 ns | 0.765 ns | 41.03 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 30 | 24.05 ns | 0.082 ns | 0.077 ns | 24.05 ns | 0.59 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 32 | 37.90 ns | 0.270 ns | 0.240 ns | 37.88 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 32 | 24.45 ns | 0.124 ns | 0.110 ns | 24.45 ns | 0.65 | 0.01 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 36 | 40.32 ns | 0.534 ns | 0.499 ns | 40.22 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 36 | 25.79 ns | 0.199 ns | 0.177 ns | 25.71 ns | 0.64 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 37 | 40.31 ns | 0.401 ns | 0.355 ns | 40.34 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 37 | 26.49 ns | 0.301 ns | 0.282 ns | 26.38 ns | 0.66 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 40 | 42.33 ns | 0.173 ns | 0.145 ns | 42.31 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | Array | 40 | 45.48 ns | 0.171 ns | 0.160 ns | 45.45 ns | 1.08 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.09 ns | 0.052 ns | 0.041 ns | 27.09 ns | 0.64 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| Actual | AddRa(...)acity [21] | List | Array | 40 | 27.53 ns | 0.146 ns | 0.122 ns | 27.53 ns | 0.65 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 50 | 74.16 ns | 0.145 ns | 0.128 ns | 74.18 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 50 | 35.09 ns | 0.130 ns | 0.122 ns | 35.07 ns | 0.47 | 0.00 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 60 | 57.71 ns | 1.176 ns | 1.258 ns | 57.31 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 60 | 32.94 ns | 0.620 ns | 0.909 ns | 32.55 ns | 0.58 | 0.03 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 70 | 58.09 ns | 1.189 ns | 1.054 ns | 58.12 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 70 | 60.20 ns | 1.220 ns | 1.141 ns | 60.07 ns | 1.04 | 0.02 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 80 | 55.03 ns | 0.337 ns | 0.299 ns | 55.01 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 80 | 38.42 ns | 0.784 ns | 0.871 ns | 38.04 ns | 0.70 | 0.02 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 90 | 63.62 ns | 1.282 ns | 1.879 ns | 63.34 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 90 | 43.73 ns | 0.959 ns | 2.659 ns | 43.02 ns | 0.67 | 0.04 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 100 | 64.68 ns | 1.308 ns | 1.454 ns | 64.23 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 100 | 45.14 ns | 0.804 ns | 0.713 ns | 45.14 ns | 0.69 | 0.02 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 128 | 72.13 ns | 1.034 ns | 0.864 ns | 71.90 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 128 | 57.82 ns | 0.941 ns | 0.786 ns | 58.03 ns | 0.80 | 0.01 | 0.5010 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 256 | 115.77 ns | 0.300 ns | 0.266 ns | 115.70 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 256 | 100.64 ns | 0.753 ns | 0.704 ns | 100.33 ns | 0.87 | 0.01 | 0.9900 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 512 | 204.95 ns | 0.706 ns | 0.660 ns | 204.69 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 512 | 181.88 ns | 2.521 ns | 2.235 ns | 181.50 ns | 0.89 | 0.01 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 1024 | 413.04 ns | 8.276 ns | 7.742 ns | 411.99 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 1024 | 355.04 ns | 1.979 ns | 1.754 ns | 355.42 ns | 0.86 | 0.02 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 2048 | 769.05 ns | 3.644 ns | 3.409 ns | 767.84 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 2048 | 674.33 ns | 3.062 ns | 2.864 ns | 673.75 ns | 0.88 | 0.01 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 4096 | 1,498.75 ns | 4.783 ns | 4.240 ns | 1,498.61 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 4096 | 1,512.26 ns | 29.929 ns | 41.956 ns | 1,505.24 ns | 1.02 | 0.03 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 8192 | 2,895.90 ns | 25.059 ns | 20.925 ns | 2,888.80 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 8192 | 2,806.63 ns | 31.901 ns | 28.280 ns | 2,793.55 ns | 0.97 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 16384 | 55,418.13 ns | 606.035 ns | 506.066 ns | 55,441.53 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 16384 | 55,540.70 ns | 1,079.305 ns | 1,108.367 ns | 55,499.65 ns | 1.01 | 0.03 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 32768 | 107,023.05 ns | 1,955.576 ns | 1,632.995 ns | 107,432.47 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 32768 | 111,818.01 ns | 2,210.254 ns | 3,812.579 ns | 112,191.56 ns | 1.02 | 0.02 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 65536 | 109,886.70 ns | 2,176.182 ns | 4,140.413 ns | 109,143.95 ns | 1.00 | 0.00 | 126.4648 | 125.3662 | 125.3662 | 524919 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 65536 | 112,801.38 ns | 2,158.013 ns | 3,094.957 ns | 112,238.62 ns | 1.03 | 0.04 | 109.4971 | 109.1309 | 109.1309 | 524343 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 131072 | 274,437.13 ns | 5,029.541 ns | 4,199.894 ns | 275,704.49 ns | 1.00 | 0.00 | 200.1953 | 198.7305 | 198.7305 | 1048888 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 131072 | 287,164.24 ns | 5,738.454 ns | 9,428.445 ns | 287,049.51 ns | 1.04 | 0.04 | 177.2461 | 176.7578 | 176.7578 | 1048654 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | Array | 850000 | 2,032,854.05 ns | 19,094.099 ns | 17,860.632 ns | 2,036,572.85 ns | 1.00 | 0.00 | 156.2500 | 156.2500 | 156.2500 | 6800109 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | Array | 850000 | 2,017,756.75 ns | 13,677.577 ns | 12,124.816 ns | 2,015,650.00 ns | 0.99 | 0.01 | 156.2500 | 156.2500 | 156.2500 | 6800077 B | 1.00 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 0 | 15.55 ns | 0.078 ns | 0.073 ns | 15.58 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 0 | 18.54 ns | 0.032 ns | 0.027 ns | 18.55 ns | 1.19 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 1 | 28.58 ns | 0.112 ns | 0.099 ns | 28.55 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 1 | 46.67 ns | 0.948 ns | 1.265 ns | 46.35 ns | 1.66 | 0.04 | 0.0268 | - | - | 56 B | 0.88 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 2 | 28.80 ns | 0.406 ns | 0.380 ns | 28.73 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 2 | 44.98 ns | 0.863 ns | 0.887 ns | 45.14 ns | 1.56 | 0.04 | 0.0268 | - | - | 56 B | 0.78 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 3 | 27.27 ns | 0.284 ns | 0.252 ns | 27.16 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 3 | 46.40 ns | 0.387 ns | 0.302 ns | 46.43 ns | 1.70 | 0.02 | 0.0268 | - | - | 56 B | 0.70 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 4 | 30.15 ns | 0.603 ns | 0.670 ns | 30.01 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 4 | 47.04 ns | 0.949 ns | 1.331 ns | 46.56 ns | 1.57 | 0.05 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 5 | 33.80 ns | 0.756 ns | 2.194 ns | 33.25 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 5 | 48.09 ns | 0.959 ns | 1.628 ns | 47.97 ns | 1.43 | 0.10 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 6 | 29.98 ns | 0.293 ns | 0.288 ns | 29.94 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 6 | 46.45 ns | 0.368 ns | 0.326 ns | 46.44 ns | 1.55 | 0.02 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 7 | 32.02 ns | 0.670 ns | 1.443 ns | 31.36 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 7 | 45.45 ns | 0.860 ns | 0.804 ns | 45.18 ns | 1.37 | 0.07 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 8 | 29.12 ns | 0.180 ns | 0.150 ns | 29.05 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 8 | 45.89 ns | 0.916 ns | 0.981 ns | 45.89 ns | 1.58 | 0.04 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 9 | 33.17 ns | 0.652 ns | 0.610 ns | 32.90 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 9 | 46.97 ns | 0.821 ns | 0.768 ns | 46.86 ns | 1.42 | 0.04 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 10 | 31.31 ns | 0.293 ns | 0.244 ns | 31.34 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 10 | 46.76 ns | 0.866 ns | 0.810 ns | 47.00 ns | 1.49 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 11 | 34.66 ns | 0.711 ns | 0.665 ns | 34.40 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 11 | 48.13 ns | 0.980 ns | 1.554 ns | 48.27 ns | 1.41 | 0.06 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 12 | 33.95 ns | 0.638 ns | 0.596 ns | 33.98 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 12 | 48.45 ns | 0.764 ns | 0.715 ns | 48.42 ns | 1.43 | 0.03 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 13 | 33.50 ns | 0.699 ns | 0.957 ns | 33.36 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 13 | 47.38 ns | 0.782 ns | 0.653 ns | 47.45 ns | 1.44 | 0.04 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 14 | 37.06 ns | 0.588 ns | 0.550 ns | 37.14 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 14 | 48.24 ns | 0.625 ns | 0.554 ns | 48.34 ns | 1.30 | 0.03 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 15 | 34.47 ns | 0.657 ns | 0.614 ns | 34.33 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 15 | 47.74 ns | 0.927 ns | 0.952 ns | 48.00 ns | 1.38 | 0.03 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 16 | 34.73 ns | 0.286 ns | 0.253 ns | 34.70 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 16 | 48.29 ns | 0.810 ns | 0.758 ns | 48.59 ns | 1.39 | 0.02 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 17 | 33.42 ns | 0.223 ns | 0.198 ns | 33.47 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 17 | 48.79 ns | 0.631 ns | 0.590 ns | 48.88 ns | 1.46 | 0.02 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 18 | 33.17 ns | 0.180 ns | 0.159 ns | 33.15 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 18 | 48.85 ns | 0.592 ns | 0.554 ns | 48.86 ns | 1.47 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 19 | 39.00 ns | 0.555 ns | 0.519 ns | 38.90 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 19 | 49.31 ns | 0.977 ns | 0.959 ns | 49.48 ns | 1.26 | 0.02 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 20 | 39.24 ns | 0.214 ns | 0.200 ns | 39.14 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 20 | 49.03 ns | 0.767 ns | 0.717 ns | 49.27 ns | 1.25 | 0.02 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 30 | 40.53 ns | 0.834 ns | 0.820 ns | 40.48 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 30 | 48.85 ns | 0.993 ns | 1.456 ns | 49.13 ns | 1.21 | 0.05 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 32 | 40.98 ns | 0.349 ns | 0.326 ns | 40.93 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 32 | 48.91 ns | 0.759 ns | 0.673 ns | 49.28 ns | 1.19 | 0.02 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 36 | 44.67 ns | 0.833 ns | 0.738 ns | 44.70 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 36 | 49.90 ns | 0.987 ns | 0.969 ns | 50.18 ns | 1.12 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 37 | 42.42 ns | 0.758 ns | 0.709 ns | 42.46 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 37 | 49.95 ns | 0.825 ns | 0.772 ns | 50.03 ns | 1.18 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 42.72 ns | 0.424 ns | 0.376 ns | 42.66 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | PooledList | 40 | 42.27 ns | 0.245 ns | 0.230 ns | 42.21 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 50.49 ns | 0.999 ns | 0.934 ns | 50.45 ns | 1.18 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | AddRa(...)acity [21] | List | PooledList | 40 | 49.97 ns | 1.018 ns | 1.089 ns | 50.21 ns | 1.17 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 50 | 47.08 ns | 0.397 ns | 0.352 ns | 47.04 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 50 | 49.28 ns | 0.961 ns | 1.144 ns | 49.57 ns | 1.04 | 0.02 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 60 | 52.93 ns | 0.828 ns | 0.734 ns | 52.77 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 60 | 52.14 ns | 1.055 ns | 1.408 ns | 52.76 ns | 0.99 | 0.03 | 0.0268 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 70 | 52.34 ns | 0.302 ns | 0.268 ns | 52.24 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 70 | 52.49 ns | 0.884 ns | 0.827 ns | 52.60 ns | 1.00 | 0.02 | 0.0268 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 80 | 57.17 ns | 0.108 ns | 0.085 ns | 57.17 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 80 | 52.28 ns | 0.648 ns | 0.606 ns | 52.33 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 850000 | 2,355,574.11 ns | 47,032.123 ns | 92,836.823 ns | 2,364,393.55 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800088 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 850000 | 846,457.91 ns | 1,260.633 ns | 984.220 ns | 846,589.16 ns | 0.36 | 0.01 | - | - | - | 57 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 90 | 58.14 ns | 0.278 ns | 0.232 ns | 58.05 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 90 | 53.04 ns | 0.777 ns | 0.727 ns | 53.10 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 100 | 64.08 ns | 0.595 ns | 0.556 ns | 63.99 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 100 | 52.72 ns | 0.812 ns | 0.720 ns | 52.80 ns | 0.82 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 128 | 68.22 ns | 0.171 ns | 0.143 ns | 68.21 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 128 | 54.59 ns | 0.914 ns | 0.810 ns | 54.75 ns | 0.80 | 0.01 | 0.0268 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 256 | 117.40 ns | 0.796 ns | 0.745 ns | 117.13 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 256 | 57.89 ns | 0.689 ns | 0.645 ns | 57.72 ns | 0.49 | 0.01 | 0.0268 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 512 | 207.89 ns | 0.625 ns | 0.522 ns | 208.02 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | PooledList | 512 | 84.94 ns | 0.527 ns | 0.492 ns | 84.96 ns | 0.41 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 1024 | 405.68 ns | 2.542 ns | 2.378 ns | 405.36 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 1024 | 116.67 ns | 0.737 ns | 0.690 ns | 116.91 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 2048 | 770.26 ns | 4.806 ns | 4.496 ns | 769.32 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 2048 | 267.28 ns | 1.941 ns | 1.816 ns | 267.30 ns | 0.35 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 4096 | 1,490.88 ns | 5.273 ns | 4.403 ns | 1,489.42 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 4096 | 594.77 ns | 2.004 ns | 1.777 ns | 595.25 ns | 0.40 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 8192 | 2,817.93 ns | 10.356 ns | 8.648 ns | 2,816.59 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 8192 | 1,138.80 ns | 2.153 ns | 2.014 ns | 1,138.70 ns | 0.40 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 16384 | 53,457.46 ns | 295.500 ns | 276.411 ns | 53,489.79 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 16384 | 2,447.92 ns | 10.297 ns | 9.128 ns | 2,443.87 ns | 0.05 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 32768 | 109,372.22 ns | 826.120 ns | 772.754 ns | 109,576.67 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 32768 | 5,365.50 ns | 16.390 ns | 15.331 ns | 5,358.87 ns | 0.05 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 65536 | 101,411.80 ns | 1,544.178 ns | 1,516.589 ns | 101,647.15 ns | 1.00 | 0.00 | 123.9014 | 122.8027 | 122.8027 | 524955 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 65536 | 11,930.79 ns | 49.003 ns | 45.838 ns | 11,919.91 ns | 0.12 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | PooledList | 131072 | 318,837.17 ns | 6,314.559 ns | 16,745.315 ns | 317,902.47 ns | 1.00 | 0.00 | 176.2695 | 175.2930 | 175.2930 | 1048822 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | PooledList | 131072 | 25,195.34 ns | 85.188 ns | 79.684 ns | 25,158.76 ns | 0.08 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 0 | 18.78 ns | 0.081 ns | 0.076 ns | 18.74 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 0 | 22.83 ns | 0.113 ns | 0.101 ns | 22.81 ns | 1.22 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1 | 27.76 ns | 0.101 ns | 0.090 ns | 27.79 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 1 | 23.07 ns | 0.134 ns | 0.125 ns | 23.06 ns | 0.83 | 0.00 | 0.0497 | - | - | 104 B | 1.62 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2 | 28.19 ns | 0.107 ns | 0.089 ns | 28.20 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 2 | 23.01 ns | 0.086 ns | 0.077 ns | 23.03 ns | 0.82 | 0.00 | 0.0497 | - | - | 104 B | 1.44 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 3 | 28.77 ns | 0.148 ns | 0.138 ns | 28.79 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 3 | 23.09 ns | 0.141 ns | 0.132 ns | 23.08 ns | 0.80 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4 | 30.73 ns | 0.115 ns | 0.102 ns | 30.71 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 4 | 22.92 ns | 0.136 ns | 0.127 ns | 22.91 ns | 0.75 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 5 | 28.38 ns | 0.208 ns | 0.195 ns | 28.36 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 5 | 23.08 ns | 0.117 ns | 0.104 ns | 23.07 ns | 0.81 | 0.01 | 0.0536 | - | - | 112 B | 1.17 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 6 | 28.50 ns | 0.102 ns | 0.090 ns | 28.49 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 6 | 23.35 ns | 0.165 ns | 0.155 ns | 23.30 ns | 0.82 | 0.01 | 0.0574 | - | - | 120 B | 1.15 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 7 | 28.79 ns | 0.084 ns | 0.075 ns | 28.79 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 7 | 23.74 ns | 0.128 ns | 0.120 ns | 23.78 ns | 0.83 | 0.00 | 0.0612 | - | - | 128 B | 1.14 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8 | 31.87 ns | 0.166 ns | 0.155 ns | 31.89 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 8 | 24.09 ns | 0.172 ns | 0.153 ns | 24.05 ns | 0.76 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 9 | 32.47 ns | 0.184 ns | 0.172 ns | 32.48 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 9 | 24.57 ns | 0.134 ns | 0.119 ns | 24.57 ns | 0.76 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 10 | 31.27 ns | 0.175 ns | 0.163 ns | 31.27 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 10 | 24.74 ns | 0.132 ns | 0.117 ns | 24.73 ns | 0.79 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 11 | 33.73 ns | 0.128 ns | 0.113 ns | 33.73 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 11 | 25.56 ns | 0.172 ns | 0.161 ns | 25.58 ns | 0.76 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 12 | 34.17 ns | 0.210 ns | 0.186 ns | 34.18 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 12 | 25.81 ns | 0.248 ns | 0.232 ns | 25.76 ns | 0.75 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 13 | 31.23 ns | 0.077 ns | 0.060 ns | 31.24 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 13 | 26.18 ns | 0.162 ns | 0.152 ns | 26.18 ns | 0.84 | 0.01 | 0.0842 | - | - | 176 B | 1.10 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 14 | 34.78 ns | 0.295 ns | 0.276 ns | 34.78 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 14 | 26.91 ns | 0.093 ns | 0.087 ns | 26.92 ns | 0.77 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 15 | 34.67 ns | 0.265 ns | 0.222 ns | 34.59 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 15 | 26.32 ns | 0.072 ns | 0.064 ns | 26.33 ns | 0.76 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16 | 33.90 ns | 0.193 ns | 0.181 ns | 33.91 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 16 | 27.40 ns | 0.215 ns | 0.202 ns | 27.41 ns | 0.81 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 17 | 32.66 ns | 0.196 ns | 0.184 ns | 32.60 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 17 | 27.83 ns | 0.222 ns | 0.207 ns | 27.90 ns | 0.85 | 0.01 | 0.0995 | - | - | 208 B | 1.08 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 18 | 34.49 ns | 0.195 ns | 0.183 ns | 34.45 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 18 | 28.61 ns | 0.070 ns | 0.062 ns | 28.63 ns | 0.83 | 0.00 | 0.1033 | - | - | 216 B | 1.08 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 19 | 36.97 ns | 0.388 ns | 0.363 ns | 37.01 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 19 | 28.67 ns | 0.145 ns | 0.135 ns | 28.65 ns | 0.78 | 0.01 | 0.1071 | - | - | 224 B | 1.08 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 20 | 37.25 ns | 0.324 ns | 0.287 ns | 37.24 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 20 | 28.83 ns | 0.195 ns | 0.172 ns | 28.78 ns | 0.77 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 30 | 39.18 ns | 0.162 ns | 0.135 ns | 39.17 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 30 | 31.90 ns | 0.261 ns | 0.244 ns | 31.95 ns | 0.81 | 0.01 | 0.1492 | - | - | 312 B | 1.05 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32 | 41.21 ns | 0.179 ns | 0.168 ns | 41.17 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 32 | 31.55 ns | 0.186 ns | 0.155 ns | 31.54 ns | 0.77 | 0.00 | 0.1568 | - | - | 328 B | 1.05 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 36 | 45.17 ns | 0.927 ns | 1.416 ns | 45.23 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 36 | 34.75 ns | 0.187 ns | 0.156 ns | 34.72 ns | 0.78 | 0.03 | 0.1721 | - | - | 360 B | 1.05 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 37 | 50.93 ns | 0.542 ns | 0.480 ns | 50.81 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 37 | 40.49 ns | 0.288 ns | 0.241 ns | 40.53 ns | 0.80 | 0.01 | 0.0382 | - | - | 80 B | 0.23 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 53.62 ns | 1.075 ns | 1.238 ns | 53.53 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 40 | 49.33 ns | 0.525 ns | 0.491 ns | 49.28 ns | 0.91 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 38.44 ns | 0.254 ns | 0.237 ns | 38.53 ns | 0.71 | 0.02 | 0.0382 | - | - | 80 B | 0.21 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 40 | 43.63 ns | 0.672 ns | 0.628 ns | 43.76 ns | 0.81 | 0.03 | 0.0382 | - | - | 80 B | 0.21 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 50 | 54.49 ns | 0.839 ns | 0.785 ns | 54.54 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 50 | 39.84 ns | 0.585 ns | 0.548 ns | 39.81 ns | 0.73 | 0.02 | 0.0382 | - | - | 80 B | 0.18 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 60 | 57.38 ns | 0.662 ns | 0.587 ns | 57.30 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 60 | 40.35 ns | 0.519 ns | 0.460 ns | 40.21 ns | 0.70 | 0.01 | 0.0382 | - | - | 80 B | 0.15 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 70 | 63.51 ns | 0.799 ns | 0.747 ns | 63.38 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 70 | 44.74 ns | 0.516 ns | 0.483 ns | 44.69 ns | 0.70 | 0.01 | 0.0382 | - | - | 80 B | 0.13 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 80 | 67.41 ns | 1.119 ns | 1.047 ns | 67.50 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 80 | 40.79 ns | 0.330 ns | 0.308 ns | 40.78 ns | 0.61 | 0.01 | 0.0382 | - | - | 80 B | 0.11 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 90 | 77.65 ns | 0.928 ns | 0.868 ns | 77.47 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 90 | 41.66 ns | 0.558 ns | 0.522 ns | 41.56 ns | 0.54 | 0.01 | 0.0382 | - | - | 80 B | 0.10 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 100 | 78.83 ns | 1.072 ns | 1.003 ns | 78.90 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 100 | 42.03 ns | 0.403 ns | 0.336 ns | 42.03 ns | 0.53 | 0.01 | 0.0382 | - | - | 80 B | 0.09 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 128 | 89.78 ns | 1.477 ns | 1.309 ns | 89.83 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 128 | 43.92 ns | 0.144 ns | 0.128 ns | 43.86 ns | 0.49 | 0.01 | 0.0382 | - | - | 80 B | 0.07 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 256 | 154.98 ns | 2.287 ns | 2.139 ns | 154.98 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 256 | 60.20 ns | 0.181 ns | 0.170 ns | 60.19 ns | 0.39 | 0.01 | 0.0381 | - | - | 80 B | 0.04 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 512 | 278.40 ns | 4.896 ns | 4.579 ns | 279.41 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 512 | 71.55 ns | 0.173 ns | 0.162 ns | 71.57 ns | 0.26 | 0.00 | 0.0381 | - | - | 80 B | 0.02 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 1024 | 568.38 ns | 10.864 ns | 12.933 ns | 566.75 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 1024 | 104.60 ns | 0.457 ns | 0.405 ns | 104.76 ns | 0.18 | 0.00 | 0.0381 | - | - | 80 B | 0.010 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 2048 | 1,069.01 ns | 21.411 ns | 25.488 ns | 1,068.13 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 2048 | 257.18 ns | 0.858 ns | 0.803 ns | 256.92 ns | 0.24 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 4096 | 2,156.33 ns | 42.366 ns | 57.991 ns | 2,149.23 ns | 1.00 | 0.00 | 15.6212 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 4096 | 683.96 ns | 2.865 ns | 2.680 ns | 683.76 ns | 0.32 | 0.01 | 0.0381 | - | - | 80 B | 0.002 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 8192 | 4,173.65 ns | 82.880 ns | 95.445 ns | 4,138.99 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 8192 | 1,093.55 ns | 8.433 ns | 7.889 ns | 1,093.31 ns | 0.26 | 0.01 | 0.0381 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 16384 | 57,440.78 ns | 913.185 ns | 854.194 ns | 57,447.98 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 16384 | 2,424.05 ns | 11.689 ns | 10.934 ns | 2,419.78 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 32768 | 112,548.01 ns | 2,096.348 ns | 2,058.894 ns | 112,964.50 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 32768 | 5,225.45 ns | 18.780 ns | 17.567 ns | 5,223.90 ns | 0.05 | 0.00 | 0.0381 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 65536 | 114,803.07 ns | 1,028.345 ns | 911.601 ns | 114,939.65 ns | 1.00 | 0.00 | 118.8965 | 117.7979 | 117.7979 | 524931 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 65536 | 11,959.33 ns | 39.257 ns | 34.800 ns | 11,946.93 ns | 0.10 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 131072 | 512,310.62 ns | 62,622.519 ns | 184,643.909 ns | 375,182.47 ns | 1.00 | 0.00 | 175.7813 | 174.8047 | 174.8047 | 1048975 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 131072 | 24,956.13 ns | 24.065 ns | 18.788 ns | 24,952.89 ns | 0.04 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableList | 850000 | 2,204,685.51 ns | 42,710.796 ns | 70,175.063 ns | 2,215,875.00 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableList | 850000 | 901,679.04 ns | 10,601.461 ns | 9,397.919 ns | 901,813.43 ns | 0.41 | 0.01 | - | - | - | 93 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 16.15 ns | 0.129 ns | 0.107 ns | 16.15 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 0 | 19.55 ns | 0.106 ns | 0.088 ns | 19.50 ns | 1.21 | 0.01 | 0.0382 | - | - | 80 B | 2.50 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 26.94 ns | 0.144 ns | 0.128 ns | 26.96 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1 | 64.65 ns | 0.452 ns | 0.401 ns | 64.76 ns | 2.40 | 0.02 | 0.0688 | - | - | 144 B | 2.25 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 27.40 ns | 0.187 ns | 0.175 ns | 27.37 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2 | 64.75 ns | 0.618 ns | 0.578 ns | 64.97 ns | 2.36 | 0.03 | 0.0726 | - | - | 152 B | 2.11 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 27.36 ns | 0.167 ns | 0.156 ns | 27.38 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 3 | 67.23 ns | 0.765 ns | 0.716 ns | 67.07 ns | 2.46 | 0.03 | 0.0802 | - | - | 168 B | 2.10 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 27.39 ns | 0.132 ns | 0.117 ns | 27.38 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4 | 65.31 ns | 0.463 ns | 0.433 ns | 65.36 ns | 2.38 | 0.02 | 0.0802 | - | - | 168 B | 1.91 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 30.29 ns | 0.302 ns | 0.283 ns | 30.16 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 5 | 69.04 ns | 0.658 ns | 0.615 ns | 68.91 ns | 2.28 | 0.03 | 0.0956 | - | - | 200 B | 2.08 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 28.48 ns | 0.120 ns | 0.112 ns | 28.46 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 6 | 68.18 ns | 0.850 ns | 0.795 ns | 68.24 ns | 2.39 | 0.03 | 0.0956 | - | - | 200 B | 1.92 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 28.65 ns | 0.184 ns | 0.172 ns | 28.59 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 7 | 67.51 ns | 0.753 ns | 0.705 ns | 67.49 ns | 2.36 | 0.02 | 0.0956 | - | - | 200 B | 1.79 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 28.81 ns | 0.044 ns | 0.039 ns | 28.81 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8 | 65.51 ns | 0.165 ns | 0.154 ns | 65.49 ns | 2.27 | 0.01 | 0.0956 | - | - | 200 B | 1.67 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 29.98 ns | 0.219 ns | 0.205 ns | 29.96 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 9 | 73.00 ns | 1.014 ns | 0.948 ns | 73.27 ns | 2.43 | 0.04 | 0.1262 | - | - | 264 B | 2.06 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 30.51 ns | 0.107 ns | 0.095 ns | 30.50 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 10 | 71.92 ns | 1.254 ns | 1.173 ns | 71.99 ns | 2.36 | 0.04 | 0.1262 | - | - | 264 B | 1.94 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 31.95 ns | 0.386 ns | 0.361 ns | 31.83 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 11 | 72.62 ns | 1.129 ns | 1.001 ns | 72.65 ns | 2.27 | 0.04 | 0.1262 | - | - | 264 B | 1.83 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 32.02 ns | 0.244 ns | 0.228 ns | 32.07 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 12 | 71.77 ns | 0.894 ns | 0.792 ns | 71.78 ns | 2.24 | 0.03 | 0.1262 | - | - | 264 B | 1.74 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 32.18 ns | 0.343 ns | 0.321 ns | 32.24 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 13 | 72.51 ns | 1.111 ns | 1.039 ns | 72.64 ns | 2.25 | 0.03 | 0.1262 | - | - | 264 B | 1.65 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 35.83 ns | 0.355 ns | 0.315 ns | 35.84 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 14 | 72.25 ns | 0.425 ns | 0.355 ns | 72.29 ns | 2.02 | 0.02 | 0.1262 | - | - | 264 B | 1.57 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 32.54 ns | 0.287 ns | 0.240 ns | 32.52 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 15 | 72.71 ns | 1.153 ns | 1.078 ns | 72.94 ns | 2.23 | 0.04 | 0.1262 | - | - | 264 B | 1.50 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 33.60 ns | 0.237 ns | 0.222 ns | 33.65 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16 | 71.03 ns | 0.535 ns | 0.500 ns | 71.00 ns | 2.11 | 0.02 | 0.1262 | - | - | 264 B | 1.43 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 32.70 ns | 0.090 ns | 0.075 ns | 32.71 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 17 | 78.68 ns | 0.945 ns | 0.884 ns | 78.61 ns | 2.41 | 0.03 | 0.1874 | - | - | 392 B | 2.04 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 33.25 ns | 0.612 ns | 0.573 ns | 33.19 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 18 | 79.40 ns | 0.847 ns | 0.793 ns | 79.35 ns | 2.39 | 0.05 | 0.1874 | - | - | 392 B | 1.96 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 34.90 ns | 0.554 ns | 0.518 ns | 35.01 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 19 | 76.82 ns | 0.637 ns | 0.596 ns | 76.89 ns | 2.20 | 0.03 | 0.1874 | - | - | 392 B | 1.88 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 34.39 ns | 0.178 ns | 0.158 ns | 34.41 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 20 | 78.95 ns | 1.359 ns | 1.205 ns | 79.26 ns | 2.30 | 0.03 | 0.1874 | - | - | 392 B | 1.81 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 37.88 ns | 0.429 ns | 0.402 ns | 37.89 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 30 | 78.01 ns | 0.550 ns | 0.459 ns | 78.00 ns | 2.06 | 0.03 | 0.1874 | - | - | 392 B | 1.32 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 37.81 ns | 0.166 ns | 0.148 ns | 37.74 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32 | 76.46 ns | 0.325 ns | 0.271 ns | 76.50 ns | 2.02 | 0.01 | 0.1874 | - | - | 392 B | 1.26 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 49.50 ns | 0.339 ns | 0.301 ns | 49.46 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 36 | 88.51 ns | 0.661 ns | 0.586 ns | 88.52 ns | 1.79 | 0.01 | 0.0688 | - | - | 144 B | 0.42 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 50.63 ns | 0.784 ns | 0.695 ns | 50.56 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 37 | 88.84 ns | 0.954 ns | 0.892 ns | 88.78 ns | 1.76 | 0.04 | 0.0688 | - | - | 144 B | 0.41 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 49.03 ns | 0.417 ns | 0.370 ns | 49.05 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 48.71 ns | 0.835 ns | 0.928 ns | 48.83 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 87.31 ns | 1.110 ns | 1.039 ns | 87.56 ns | 1.78 | 0.02 | 0.0688 | - | - | 144 B | 0.38 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 40 | 88.00 ns | 0.569 ns | 0.533 ns | 88.13 ns | 1.80 | 0.02 | 0.0688 | - | - | 144 B | 0.38 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 54.78 ns | 0.675 ns | 0.632 ns | 54.90 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 50 | 87.02 ns | 0.442 ns | 0.414 ns | 86.97 ns | 1.59 | 0.02 | 0.0688 | - | - | 144 B | 0.32 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 57.35 ns | 0.331 ns | 0.310 ns | 57.46 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 60 | 91.01 ns | 1.260 ns | 1.179 ns | 90.92 ns | 1.59 | 0.02 | 0.0688 | - | - | 144 B | 0.27 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 64.76 ns | 0.729 ns | 0.682 ns | 64.68 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 70 | 91.62 ns | 1.225 ns | 1.023 ns | 91.68 ns | 1.42 | 0.02 | 0.0688 | - | - | 144 B | 0.23 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 68.58 ns | 0.913 ns | 0.854 ns | 68.68 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 80 | 88.22 ns | 0.721 ns | 0.674 ns | 88.25 ns | 1.29 | 0.02 | 0.0688 | - | - | 144 B | 0.21 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 2,538,596.09 ns | 50,251.943 ns | 132,383.717 ns | 2,544,541.80 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800141 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 850000 | 1,319,091.86 ns | 9,842.465 ns | 9,206.648 ns | 1,322,115.04 ns | 0.53 | 0.04 | - | - | - | 449 B | 0.000 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 74.95 ns | 1.377 ns | 1.288 ns | 75.04 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 90 | 88.78 ns | 1.157 ns | 1.082 ns | 88.77 ns | 1.18 | 0.03 | 0.0688 | - | - | 144 B | 0.19 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 78.49 ns | 1.377 ns | 1.221 ns | 78.36 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 100 | 92.89 ns | 0.439 ns | 0.367 ns | 92.91 ns | 1.18 | 0.02 | 0.0688 | - | - | 144 B | 0.17 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 92.57 ns | 1.884 ns | 2.314 ns | 93.06 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 128 | 90.26 ns | 0.707 ns | 0.662 ns | 90.29 ns | 0.96 | 0.02 | 0.0688 | - | - | 144 B | 0.13 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 157.87 ns | 1.926 ns | 1.802 ns | 157.59 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 256 | 100.98 ns | 0.383 ns | 0.339 ns | 101.04 ns | 0.64 | 0.01 | 0.0688 | - | - | 144 B | 0.07 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 280.42 ns | 5.429 ns | 6.034 ns | 280.08 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 512 | 118.82 ns | 1.031 ns | 0.964 ns | 118.84 ns | 0.42 | 0.01 | 0.0687 | - | - | 144 B | 0.03 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 550.41 ns | 10.930 ns | 14.213 ns | 549.32 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 1024 | 151.50 ns | 0.866 ns | 0.810 ns | 151.47 ns | 0.27 | 0.01 | 0.0687 | - | - | 144 B | 0.02 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 1,107.60 ns | 21.354 ns | 22.848 ns | 1,101.33 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 2048 | 316.43 ns | 1.933 ns | 1.809 ns | 316.65 ns | 0.28 | 0.01 | 0.0687 | - | - | 144 B | 0.009 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 2,138.24 ns | 39.016 ns | 36.496 ns | 2,147.29 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 4096 | 603.51 ns | 3.039 ns | 2.843 ns | 602.59 ns | 0.28 | 0.00 | 0.0687 | - | - | 144 B | 0.004 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 4,121.10 ns | 81.886 ns | 91.016 ns | 4,115.91 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 8192 | 1,176.01 ns | 4.800 ns | 4.489 ns | 1,174.98 ns | 0.29 | 0.01 | 0.0687 | - | - | 144 B | 0.002 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 57,390.39 ns | 456.832 ns | 404.970 ns | 57,432.85 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 16384 | 2,463.79 ns | 4.976 ns | 4.155 ns | 2,465.25 ns | 0.04 | 0.00 | 0.2022 | - | - | 424 B | 0.003 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 115,071.34 ns | 1,360.885 ns | 1,272.972 ns | 115,122.85 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262253 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 32768 | 5,018.02 ns | 17.996 ns | 16.834 ns | 5,012.70 ns | 0.04 | 0.00 | 0.1984 | - | - | 424 B | 0.002 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 116,796.34 ns | 1,458.231 ns | 1,292.683 ns | 117,262.53 ns | 1.00 | 0.00 | 118.2861 | 117.3096 | 117.3096 | 524949 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 65536 | 11,412.82 ns | 56.376 ns | 49.976 ns | 11,414.94 ns | 0.10 | 0.00 | 0.1984 | - | - | 424 B | 0.001 | +| | | | | | | | | | | | | | +| | | +| Baseline | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 531,504.27 ns | 71,962.404 ns | 212,182.771 ns | 376,339.89 ns | 1.00 | 0.00 | 143.5547 | 142.5781 | 142.5781 | 1049107 B | 1.000 | +| Actual | AddRa(...)acity [21] | List | RecyclableLongList | 131072 | 22,820.28 ns | 104.330 ns | 87.120 ns | 22,830.46 ns | 0.03 | 0.00 | 0.1831 | - | - | 424 B | 0.000 | +
+ +# `AddRange` when Source is Array Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2134/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.400 + [Host] : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.10 (7.0.1023.36312), X64 RyuJIT AVX2 +``` +
+Add Entire Collection Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |----------------:|--------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | AddRa(...)Array [25] | List | Array | 0 | 13.98 ns | 0.162 ns | 0.135 ns | 13.93 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 0 | 11.45 ns | 0.063 ns | 0.056 ns | 11.47 ns | 0.82 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 1 | 30.06 ns | 0.307 ns | 0.272 ns | 30.14 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 1 | 12.77 ns | 0.271 ns | 0.322 ns | 12.83 ns | 0.42 | 0.01 | 0.0153 | - | - | 32 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 2 | 30.44 ns | 0.288 ns | 0.256 ns | 30.40 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 2 | 12.96 ns | 0.289 ns | 0.355 ns | 13.05 ns | 0.42 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 3 | 30.37 ns | 0.414 ns | 0.387 ns | 30.42 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 3 | 13.15 ns | 0.049 ns | 0.044 ns | 13.15 ns | 0.43 | 0.01 | 0.0229 | - | - | 48 B | 0.55 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 4 | 30.92 ns | 0.607 ns | 0.538 ns | 31.03 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 4 | 13.44 ns | 0.059 ns | 0.052 ns | 13.43 ns | 0.43 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 5 | 30.81 ns | 0.257 ns | 0.240 ns | 30.78 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 5 | 13.42 ns | 0.295 ns | 0.476 ns | 13.61 ns | 0.44 | 0.02 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 6 | 30.68 ns | 0.058 ns | 0.054 ns | 30.67 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 6 | 13.82 ns | 0.107 ns | 0.089 ns | 13.82 ns | 0.45 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 7 | 31.12 ns | 0.066 ns | 0.051 ns | 31.12 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 7 | 13.82 ns | 0.025 ns | 0.022 ns | 13.82 ns | 0.44 | 0.00 | 0.0382 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 8 | 31.30 ns | 0.221 ns | 0.196 ns | 31.22 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 8 | 14.16 ns | 0.025 ns | 0.021 ns | 14.16 ns | 0.45 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 9 | 32.32 ns | 0.263 ns | 0.246 ns | 32.27 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 9 | 15.22 ns | 0.055 ns | 0.048 ns | 15.22 ns | 0.47 | 0.00 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 10 | 32.57 ns | 0.249 ns | 0.233 ns | 32.46 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 10 | 15.29 ns | 0.172 ns | 0.153 ns | 15.34 ns | 0.47 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 11 | 33.47 ns | 0.197 ns | 0.184 ns | 33.56 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 11 | 15.76 ns | 0.344 ns | 0.602 ns | 16.14 ns | 0.47 | 0.02 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 12 | 33.79 ns | 0.200 ns | 0.167 ns | 33.82 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 12 | 16.36 ns | 0.325 ns | 0.304 ns | 16.43 ns | 0.49 | 0.00 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 13 | 34.16 ns | 0.330 ns | 0.309 ns | 34.11 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 13 | 16.63 ns | 0.343 ns | 0.337 ns | 16.69 ns | 0.49 | 0.01 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 14 | 34.45 ns | 0.323 ns | 0.303 ns | 34.32 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 14 | 17.02 ns | 0.202 ns | 0.189 ns | 17.06 ns | 0.49 | 0.01 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 15 | 34.64 ns | 0.324 ns | 0.303 ns | 34.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 15 | 17.06 ns | 0.150 ns | 0.140 ns | 17.06 ns | 0.49 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 16 | 34.98 ns | 0.237 ns | 0.222 ns | 35.00 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 16 | 17.31 ns | 0.099 ns | 0.088 ns | 17.33 ns | 0.50 | 0.00 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 17 | 34.86 ns | 0.111 ns | 0.104 ns | 34.85 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 17 | 17.42 ns | 0.100 ns | 0.094 ns | 17.36 ns | 0.50 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 18 | 35.07 ns | 0.105 ns | 0.093 ns | 35.04 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 18 | 17.74 ns | 0.072 ns | 0.064 ns | 17.73 ns | 0.51 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 19 | 36.09 ns | 0.162 ns | 0.152 ns | 36.06 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 19 | 18.39 ns | 0.034 ns | 0.030 ns | 18.38 ns | 0.51 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 20 | 36.82 ns | 0.255 ns | 0.238 ns | 36.80 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 20 | 18.66 ns | 0.044 ns | 0.039 ns | 18.65 ns | 0.51 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 30 | 39.90 ns | 0.302 ns | 0.268 ns | 39.89 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 30 | 21.63 ns | 0.054 ns | 0.048 ns | 21.64 ns | 0.54 | 0.00 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 32 | 40.53 ns | 0.181 ns | 0.160 ns | 40.52 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 32 | 22.29 ns | 0.274 ns | 0.256 ns | 22.30 ns | 0.55 | 0.01 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 36 | 42.89 ns | 0.405 ns | 0.359 ns | 42.84 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 36 | 23.88 ns | 0.247 ns | 0.219 ns | 23.86 ns | 0.56 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 37 | 42.77 ns | 0.373 ns | 0.331 ns | 42.78 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 37 | 24.20 ns | 0.309 ns | 0.289 ns | 24.12 ns | 0.57 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 40 | 43.43 ns | 0.210 ns | 0.176 ns | 43.42 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)Array [25] | List | Array | 40 | 43.50 ns | 0.249 ns | 0.233 ns | 43.45 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 40 | 24.72 ns | 0.193 ns | 0.180 ns | 24.68 ns | 0.57 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| Actual | AddRa(...)Array [25] | List | Array | 40 | 24.65 ns | 0.166 ns | 0.138 ns | 24.66 ns | 0.57 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 50 | 46.74 ns | 0.512 ns | 0.454 ns | 46.63 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 50 | 27.95 ns | 0.268 ns | 0.251 ns | 27.94 ns | 0.60 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 60 | 50.94 ns | 0.515 ns | 0.482 ns | 50.82 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 60 | 31.60 ns | 0.047 ns | 0.042 ns | 31.61 ns | 0.62 | 0.01 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 70 | 53.40 ns | 0.137 ns | 0.129 ns | 53.39 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 70 | 34.79 ns | 0.111 ns | 0.093 ns | 34.79 ns | 0.65 | 0.00 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 80 | 57.21 ns | 0.506 ns | 0.422 ns | 57.28 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 80 | 38.56 ns | 0.244 ns | 0.228 ns | 38.59 ns | 0.67 | 0.01 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 90 | 60.42 ns | 0.529 ns | 0.469 ns | 60.49 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 90 | 40.87 ns | 0.061 ns | 0.054 ns | 40.86 ns | 0.68 | 0.01 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 100 | 62.97 ns | 0.104 ns | 0.087 ns | 62.99 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 100 | 44.66 ns | 0.049 ns | 0.041 ns | 44.67 ns | 0.71 | 0.00 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 128 | 70.57 ns | 0.369 ns | 0.345 ns | 70.58 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 128 | 51.80 ns | 0.122 ns | 0.109 ns | 51.82 ns | 0.73 | 0.00 | 0.5010 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 256 | 115.74 ns | 0.227 ns | 0.201 ns | 115.79 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 256 | 95.45 ns | 0.480 ns | 0.449 ns | 95.62 ns | 0.82 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 512 | 204.61 ns | 0.373 ns | 0.331 ns | 204.58 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 512 | 178.08 ns | 0.413 ns | 0.386 ns | 177.90 ns | 0.87 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 1024 | 393.97 ns | 1.994 ns | 1.865 ns | 393.10 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 1024 | 354.46 ns | 1.437 ns | 1.344 ns | 354.34 ns | 0.90 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 2048 | 767.88 ns | 3.372 ns | 3.154 ns | 767.33 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 2048 | 667.53 ns | 1.488 ns | 1.161 ns | 667.64 ns | 0.87 | 0.00 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 4096 | 1,490.30 ns | 5.362 ns | 5.016 ns | 1,492.34 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 4096 | 1,431.82 ns | 9.223 ns | 8.176 ns | 1,433.39 ns | 0.96 | 0.01 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 8192 | 2,858.99 ns | 24.459 ns | 20.424 ns | 2,862.66 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 8192 | 2,777.49 ns | 17.188 ns | 15.237 ns | 2,781.76 ns | 0.97 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 16384 | 59,270.04 ns | 1,166.561 ns | 1,949.061 ns | 60,135.94 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 16384 | 59,154.98 ns | 1,172.502 ns | 1,926.455 ns | 59,461.32 ns | 1.00 | 0.06 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 32768 | 117,641.57 ns | 2,338.419 ns | 3,970.812 ns | 119,190.45 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 32768 | 119,230.33 ns | 2,375.250 ns | 6,131.280 ns | 120,742.92 ns | 1.01 | 0.04 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 65536 | 110,019.82 ns | 2,057.050 ns | 1,924.166 ns | 110,404.49 ns | 1.00 | 0.00 | 124.8779 | 123.7793 | 123.7793 | 524937 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 65536 | 111,280.13 ns | 1,431.940 ns | 1,339.438 ns | 111,105.99 ns | 1.01 | 0.02 | 112.4268 | 112.0605 | 112.0605 | 524344 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 131072 | 274,605.45 ns | 5,370.968 ns | 8,673.112 ns | 273,466.65 ns | 1.00 | 0.00 | 197.2656 | 195.8008 | 195.8008 | 1048985 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 131072 | 286,187.36 ns | 5,383.804 ns | 10,875.549 ns | 285,147.56 ns | 1.04 | 0.05 | 183.5938 | 183.1055 | 183.1055 | 1048656 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | Array | 850000 | 2,102,348.70 ns | 41,324.471 ns | 49,193.844 ns | 2,113,536.72 ns | 1.00 | 0.00 | 156.2500 | 156.2500 | 156.2500 | 6800109 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | Array | 850000 | 2,106,699.34 ns | 41,567.453 ns | 51,048.565 ns | 2,116,926.56 ns | 1.00 | 0.02 | 156.2500 | 156.2500 | 156.2500 | 6800077 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 0 | 15.66 ns | 0.169 ns | 0.158 ns | 15.67 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 0 | 15.66 ns | 0.052 ns | 0.043 ns | 15.66 ns | 1.00 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 1 | 30.08 ns | 0.079 ns | 0.070 ns | 30.09 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 1 | 40.19 ns | 0.182 ns | 0.161 ns | 40.12 ns | 1.34 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 2 | 30.23 ns | 0.172 ns | 0.161 ns | 30.23 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 2 | 40.42 ns | 0.316 ns | 0.295 ns | 40.50 ns | 1.34 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 3 | 30.72 ns | 0.176 ns | 0.147 ns | 30.74 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 3 | 40.83 ns | 0.496 ns | 0.464 ns | 40.59 ns | 1.33 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 4 | 30.62 ns | 0.202 ns | 0.189 ns | 30.69 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 4 | 40.52 ns | 0.293 ns | 0.245 ns | 40.60 ns | 1.32 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 5 | 31.07 ns | 0.235 ns | 0.208 ns | 31.08 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 5 | 40.11 ns | 0.090 ns | 0.084 ns | 40.10 ns | 1.29 | 0.01 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 6 | 30.88 ns | 0.077 ns | 0.069 ns | 30.87 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 6 | 40.10 ns | 0.129 ns | 0.108 ns | 40.09 ns | 1.30 | 0.00 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 7 | 31.30 ns | 0.080 ns | 0.075 ns | 31.29 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 7 | 40.50 ns | 0.068 ns | 0.061 ns | 40.51 ns | 1.29 | 0.00 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 8 | 31.74 ns | 0.062 ns | 0.052 ns | 31.74 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 8 | 40.42 ns | 0.063 ns | 0.056 ns | 40.40 ns | 1.27 | 0.00 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 9 | 32.22 ns | 0.054 ns | 0.051 ns | 32.22 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 9 | 40.58 ns | 0.062 ns | 0.055 ns | 40.59 ns | 1.26 | 0.00 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 10 | 32.30 ns | 0.136 ns | 0.114 ns | 32.27 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 10 | 41.08 ns | 0.336 ns | 0.314 ns | 40.93 ns | 1.27 | 0.01 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 11 | 33.74 ns | 0.299 ns | 0.279 ns | 33.72 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 11 | 41.88 ns | 0.269 ns | 0.251 ns | 41.97 ns | 1.24 | 0.01 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 12 | 33.88 ns | 0.245 ns | 0.217 ns | 33.83 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 12 | 41.29 ns | 0.180 ns | 0.150 ns | 41.33 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 13 | 34.76 ns | 0.333 ns | 0.312 ns | 34.84 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 13 | 41.67 ns | 0.174 ns | 0.145 ns | 41.63 ns | 1.20 | 0.01 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 14 | 34.60 ns | 0.256 ns | 0.239 ns | 34.60 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 14 | 41.70 ns | 0.373 ns | 0.331 ns | 41.75 ns | 1.21 | 0.01 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 15 | 34.72 ns | 0.294 ns | 0.260 ns | 34.71 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 15 | 41.57 ns | 0.141 ns | 0.118 ns | 41.54 ns | 1.20 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 16 | 35.18 ns | 0.165 ns | 0.154 ns | 35.13 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 16 | 41.64 ns | 0.348 ns | 0.325 ns | 41.57 ns | 1.18 | 0.01 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 17 | 35.42 ns | 0.165 ns | 0.138 ns | 35.36 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 17 | 41.65 ns | 0.415 ns | 0.388 ns | 41.53 ns | 1.18 | 0.01 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 18 | 35.68 ns | 0.215 ns | 0.201 ns | 35.60 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 18 | 41.90 ns | 0.359 ns | 0.335 ns | 41.71 ns | 1.17 | 0.01 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 19 | 35.90 ns | 0.100 ns | 0.088 ns | 35.89 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 19 | 42.17 ns | 0.189 ns | 0.177 ns | 42.21 ns | 1.17 | 0.01 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 20 | 36.41 ns | 0.114 ns | 0.095 ns | 36.37 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 20 | 41.77 ns | 0.074 ns | 0.058 ns | 41.77 ns | 1.15 | 0.00 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 30 | 39.65 ns | 0.107 ns | 0.089 ns | 39.62 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 30 | 42.80 ns | 0.309 ns | 0.274 ns | 42.71 ns | 1.08 | 0.01 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 32 | 40.27 ns | 0.057 ns | 0.051 ns | 40.27 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 32 | 42.49 ns | 0.039 ns | 0.032 ns | 42.48 ns | 1.05 | 0.00 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 36 | 42.01 ns | 0.219 ns | 0.205 ns | 41.92 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 36 | 43.18 ns | 0.135 ns | 0.120 ns | 43.15 ns | 1.03 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 37 | 42.11 ns | 0.069 ns | 0.061 ns | 42.11 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 37 | 43.53 ns | 0.310 ns | 0.290 ns | 43.46 ns | 1.03 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 40 | 43.01 ns | 0.157 ns | 0.139 ns | 42.98 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)Array [25] | List | PooledList | 40 | 43.23 ns | 0.228 ns | 0.213 ns | 43.23 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 40 | 43.66 ns | 0.225 ns | 0.176 ns | 43.74 ns | 1.02 | 0.00 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | AddRa(...)Array [25] | List | PooledList | 40 | 43.28 ns | 0.050 ns | 0.044 ns | 43.27 ns | 1.01 | 0.00 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 50 | 46.84 ns | 0.718 ns | 0.672 ns | 46.50 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 50 | 44.73 ns | 0.639 ns | 0.567 ns | 44.56 ns | 0.95 | 0.02 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 60 | 50.29 ns | 0.278 ns | 0.246 ns | 50.32 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 60 | 45.71 ns | 0.374 ns | 0.350 ns | 45.61 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 70 | 53.36 ns | 0.300 ns | 0.266 ns | 53.31 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 70 | 47.91 ns | 0.199 ns | 0.155 ns | 47.93 ns | 0.90 | 0.01 | 0.0268 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 80 | 56.98 ns | 0.673 ns | 0.630 ns | 56.86 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 80 | 50.07 ns | 0.301 ns | 0.281 ns | 50.06 ns | 0.88 | 0.01 | 0.0268 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 850000 | 2,574,081.51 ns | 50,017.309 ns | 101,037.432 ns | 2,549,021.68 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800089 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 850000 | 895,974.44 ns | 5,112.691 ns | 4,269.328 ns | 894,426.66 ns | 0.35 | 0.01 | - | - | - | 57 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 90 | 59.29 ns | 0.569 ns | 0.532 ns | 59.15 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 90 | 50.60 ns | 0.357 ns | 0.334 ns | 50.54 ns | 0.85 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 100 | 62.47 ns | 0.570 ns | 0.505 ns | 62.59 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 100 | 50.59 ns | 0.329 ns | 0.292 ns | 50.61 ns | 0.81 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 128 | 70.12 ns | 0.084 ns | 0.065 ns | 70.13 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 128 | 51.71 ns | 0.102 ns | 0.091 ns | 51.69 ns | 0.74 | 0.00 | 0.0268 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 256 | 115.90 ns | 0.227 ns | 0.189 ns | 115.86 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 256 | 55.98 ns | 0.096 ns | 0.090 ns | 55.95 ns | 0.48 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 512 | 203.03 ns | 0.423 ns | 0.375 ns | 203.01 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | PooledList | 512 | 79.93 ns | 0.242 ns | 0.215 ns | 79.92 ns | 0.39 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 1024 | 395.70 ns | 0.525 ns | 0.438 ns | 395.65 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 1024 | 111.92 ns | 0.250 ns | 0.195 ns | 111.95 ns | 0.28 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 2048 | 758.36 ns | 1.280 ns | 1.134 ns | 758.20 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 2048 | 220.80 ns | 0.496 ns | 0.414 ns | 220.65 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 4096 | 1,503.28 ns | 5.860 ns | 5.195 ns | 1,502.49 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 4096 | 574.33 ns | 2.332 ns | 2.181 ns | 573.75 ns | 0.38 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 8192 | 2,856.51 ns | 24.510 ns | 21.728 ns | 2,863.33 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 8192 | 1,075.40 ns | 3.170 ns | 2.647 ns | 1,074.52 ns | 0.38 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 16384 | 60,136.87 ns | 1,201.610 ns | 2,992.425 ns | 60,447.64 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 16384 | 2,456.35 ns | 6.699 ns | 5.938 ns | 2,458.04 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 32768 | 117,201.05 ns | 2,326.277 ns | 4,855.807 ns | 117,823.02 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 32768 | 5,363.92 ns | 17.940 ns | 16.781 ns | 5,354.21 ns | 0.05 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 65536 | 110,920.38 ns | 1,352.140 ns | 1,264.793 ns | 110,981.04 ns | 1.00 | 0.00 | 126.2207 | 125.1221 | 125.1221 | 524883 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 65536 | 11,961.43 ns | 27.339 ns | 24.235 ns | 11,950.54 ns | 0.11 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | PooledList | 131072 | 381,840.88 ns | 8,956.746 ns | 26,268.585 ns | 384,509.74 ns | 1.00 | 0.00 | 134.7656 | 133.7891 | 133.7891 | 1049020 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | PooledList | 131072 | 22,994.42 ns | 200.079 ns | 187.154 ns | 23,072.79 ns | 0.07 | 0.01 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 0 | 16.15 ns | 0.241 ns | 0.214 ns | 16.23 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 0 | 17.85 ns | 0.072 ns | 0.060 ns | 17.83 ns | 1.11 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 1 | 32.28 ns | 0.676 ns | 1.566 ns | 32.07 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 1 | 20.10 ns | 0.073 ns | 0.057 ns | 20.10 ns | 0.63 | 0.04 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 2 | 31.86 ns | 0.655 ns | 0.851 ns | 32.21 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 2 | 20.23 ns | 0.308 ns | 0.257 ns | 20.10 ns | 0.63 | 0.02 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 3 | 31.76 ns | 0.647 ns | 0.907 ns | 32.17 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 3 | 20.23 ns | 0.150 ns | 0.140 ns | 20.16 ns | 0.63 | 0.02 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 4 | 31.26 ns | 0.648 ns | 1.232 ns | 30.78 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 4 | 19.69 ns | 0.044 ns | 0.041 ns | 19.69 ns | 0.62 | 0.03 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 5 | 32.23 ns | 0.240 ns | 0.225 ns | 32.23 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 5 | 32.98 ns | 0.370 ns | 0.328 ns | 32.86 ns | 1.02 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 6 | 32.48 ns | 0.276 ns | 0.244 ns | 32.35 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 6 | 33.48 ns | 0.297 ns | 0.263 ns | 33.47 ns | 1.03 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 7 | 32.66 ns | 0.205 ns | 0.182 ns | 32.70 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 7 | 32.58 ns | 0.484 ns | 0.452 ns | 32.47 ns | 1.00 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 8 | 32.63 ns | 0.437 ns | 0.387 ns | 32.63 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 8 | 32.34 ns | 0.444 ns | 0.415 ns | 32.20 ns | 0.99 | 0.02 | 0.0918 | - | - | 192 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 9 | 34.15 ns | 0.555 ns | 0.492 ns | 34.27 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 9 | 36.06 ns | 0.580 ns | 0.515 ns | 36.07 ns | 1.06 | 0.02 | 0.1224 | - | - | 256 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 10 | 34.33 ns | 0.342 ns | 0.320 ns | 34.32 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 10 | 35.74 ns | 0.297 ns | 0.278 ns | 35.76 ns | 1.04 | 0.02 | 0.1224 | - | - | 256 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 11 | 35.57 ns | 0.482 ns | 0.451 ns | 35.72 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 11 | 36.92 ns | 0.292 ns | 0.259 ns | 36.96 ns | 1.04 | 0.01 | 0.1224 | - | - | 256 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 12 | 35.80 ns | 0.237 ns | 0.198 ns | 35.82 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 12 | 36.97 ns | 0.168 ns | 0.157 ns | 36.99 ns | 1.03 | 0.01 | 0.1224 | - | - | 256 B | 1.68 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 13 | 36.23 ns | 0.533 ns | 0.445 ns | 36.05 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 13 | 37.27 ns | 0.284 ns | 0.265 ns | 37.28 ns | 1.03 | 0.01 | 0.1224 | - | - | 256 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 14 | 36.29 ns | 0.325 ns | 0.288 ns | 36.38 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 14 | 36.89 ns | 0.174 ns | 0.145 ns | 36.89 ns | 1.02 | 0.01 | 0.1224 | - | - | 256 B | 1.52 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 15 | 36.19 ns | 0.197 ns | 0.184 ns | 36.25 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 15 | 36.12 ns | 0.225 ns | 0.200 ns | 36.10 ns | 1.00 | 0.01 | 0.1224 | - | - | 256 B | 1.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 16 | 35.66 ns | 0.740 ns | 0.792 ns | 35.78 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 16 | 36.26 ns | 0.441 ns | 0.413 ns | 36.34 ns | 1.02 | 0.02 | 0.1224 | - | - | 256 B | 1.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 17 | 36.37 ns | 0.401 ns | 0.375 ns | 36.47 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 17 | 40.32 ns | 0.616 ns | 0.576 ns | 40.42 ns | 1.11 | 0.02 | 0.1836 | - | - | 384 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 18 | 34.98 ns | 0.344 ns | 0.322 ns | 35.11 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 18 | 40.10 ns | 0.477 ns | 0.446 ns | 40.18 ns | 1.15 | 0.01 | 0.1836 | - | - | 384 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 19 | 36.02 ns | 0.487 ns | 0.456 ns | 35.81 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 19 | 41.91 ns | 0.557 ns | 0.521 ns | 41.99 ns | 1.16 | 0.02 | 0.1836 | - | - | 384 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 20 | 38.37 ns | 0.339 ns | 0.317 ns | 38.40 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 20 | 42.52 ns | 0.780 ns | 0.730 ns | 42.63 ns | 1.11 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 30 | 40.30 ns | 0.766 ns | 0.716 ns | 40.30 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 30 | 41.79 ns | 0.604 ns | 0.565 ns | 41.78 ns | 1.04 | 0.02 | 0.1836 | - | - | 384 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 32 | 40.02 ns | 0.213 ns | 0.178 ns | 40.05 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 32 | 41.69 ns | 0.761 ns | 0.675 ns | 41.58 ns | 1.04 | 0.02 | 0.1836 | - | - | 384 B | 1.23 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 36 | 43.42 ns | 0.843 ns | 0.902 ns | 43.43 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 36 | 49.71 ns | 0.484 ns | 0.429 ns | 49.81 ns | 1.15 | 0.02 | 0.0650 | - | - | 136 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 37 | 48.79 ns | 0.472 ns | 0.441 ns | 48.85 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 37 | 50.34 ns | 0.990 ns | 0.972 ns | 50.19 ns | 1.03 | 0.02 | 0.0650 | - | - | 136 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 40 | 50.84 ns | 0.681 ns | 0.604 ns | 50.92 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 40 | 50.89 ns | 0.373 ns | 0.349 ns | 50.96 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 40 | 49.28 ns | 0.562 ns | 0.525 ns | 49.32 ns | 0.97 | 0.02 | 0.0650 | - | - | 136 B | 0.36 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 40 | 50.86 ns | 0.744 ns | 0.696 ns | 50.83 ns | 1.00 | 0.01 | 0.0650 | - | - | 136 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 50 | 54.57 ns | 1.060 ns | 0.991 ns | 54.44 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 50 | 50.32 ns | 0.826 ns | 0.733 ns | 50.39 ns | 0.92 | 0.02 | 0.0650 | - | - | 136 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 60 | 58.36 ns | 0.146 ns | 0.130 ns | 58.37 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 60 | 52.72 ns | 0.390 ns | 0.345 ns | 52.75 ns | 0.90 | 0.01 | 0.0650 | - | - | 136 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 70 | 62.18 ns | 0.863 ns | 0.848 ns | 62.11 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 70 | 50.45 ns | 0.357 ns | 0.298 ns | 50.59 ns | 0.81 | 0.01 | 0.0650 | - | - | 136 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 80 | 67.97 ns | 1.210 ns | 1.132 ns | 67.72 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 80 | 52.77 ns | 0.408 ns | 0.381 ns | 52.84 ns | 0.78 | 0.02 | 0.0650 | - | - | 136 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 90 | 72.24 ns | 0.947 ns | 0.886 ns | 72.15 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 90 | 52.63 ns | 0.478 ns | 0.447 ns | 52.76 ns | 0.73 | 0.01 | 0.0650 | - | - | 136 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 100 | 78.17 ns | 1.094 ns | 1.023 ns | 78.33 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 100 | 56.02 ns | 0.297 ns | 0.263 ns | 55.99 ns | 0.72 | 0.01 | 0.0650 | - | - | 136 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 128 | 92.24 ns | 1.023 ns | 0.957 ns | 92.23 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 128 | 57.56 ns | 0.409 ns | 0.383 ns | 57.56 ns | 0.62 | 0.01 | 0.0650 | - | - | 136 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 256 | 155.31 ns | 2.475 ns | 2.315 ns | 155.45 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 256 | 61.60 ns | 0.607 ns | 0.567 ns | 61.44 ns | 0.40 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 512 | 280.95 ns | 5.048 ns | 4.722 ns | 281.53 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 512 | 79.05 ns | 0.225 ns | 0.188 ns | 79.09 ns | 0.28 | 0.00 | 0.0650 | - | - | 136 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 1024 | 545.69 ns | 10.277 ns | 11.423 ns | 543.53 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 1024 | 117.54 ns | 1.284 ns | 1.201 ns | 116.91 ns | 0.22 | 0.00 | 0.0650 | - | - | 136 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 2048 | 1,076.71 ns | 20.812 ns | 23.967 ns | 1,073.89 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 2048 | 326.44 ns | 1.506 ns | 1.409 ns | 327.01 ns | 0.30 | 0.01 | 0.0648 | - | - | 136 B | 0.008 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 4096 | 2,140.71 ns | 42.356 ns | 56.544 ns | 2,154.15 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 4096 | 650.10 ns | 0.685 ns | 0.607 ns | 650.09 ns | 0.30 | 0.01 | 0.0648 | - | - | 136 B | 0.004 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 8192 | 3,876.78 ns | 25.089 ns | 19.588 ns | 3,878.57 ns | 1.00 | 0.00 | 31.2424 | 0.0076 | - | 65592 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 8192 | 1,103.68 ns | 1.994 ns | 1.768 ns | 1,103.59 ns | 0.28 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 16384 | 63,112.03 ns | 1,251.601 ns | 2,056.416 ns | 63,375.92 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 16384 | 2,451.24 ns | 7.439 ns | 6.958 ns | 2,452.84 ns | 0.04 | 0.00 | 0.0648 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 32768 | 124,751.37 ns | 2,460.834 ns | 5,082.048 ns | 126,176.40 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 32768 | 5,244.02 ns | 3.741 ns | 3.317 ns | 5,244.88 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 65536 | 118,639.17 ns | 1,672.047 ns | 1,564.034 ns | 118,777.62 ns | 1.00 | 0.00 | 118.7744 | 117.6758 | 117.6758 | 525009 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 65536 | 11,438.70 ns | 21.349 ns | 19.970 ns | 11,439.21 ns | 0.10 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 131072 | 353,726.80 ns | 12,759.761 ns | 34,058.385 ns | 350,392.29 ns | 1.00 | 0.00 | 162.1094 | 161.1328 | 161.1328 | 1049021 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 131072 | 25,212.62 ns | 70.204 ns | 65.669 ns | 25,192.50 ns | 0.07 | 0.01 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableList | 850000 | 2,599,598.26 ns | 51,725.617 ns | 111,344.847 ns | 2,615,473.63 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableList | 850000 | 925,293.44 ns | 18,110.282 ns | 18,597.927 ns | 930,489.50 ns | 0.35 | 0.02 | - | - | - | 149 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 0 | 14.85 ns | 0.147 ns | 0.138 ns | 14.90 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 0 | 18.41 ns | 0.129 ns | 0.121 ns | 18.40 ns | 1.24 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 1 | 30.43 ns | 0.239 ns | 0.212 ns | 30.38 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 1 | 69.64 ns | 0.495 ns | 0.439 ns | 69.64 ns | 2.29 | 0.02 | 0.0726 | - | - | 152 B | 1.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 2 | 30.37 ns | 0.271 ns | 0.253 ns | 30.26 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 2 | 68.70 ns | 0.485 ns | 0.430 ns | 68.71 ns | 2.26 | 0.02 | 0.0764 | - | - | 160 B | 1.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 3 | 30.08 ns | 0.071 ns | 0.066 ns | 30.07 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 3 | 66.28 ns | 0.665 ns | 0.622 ns | 66.52 ns | 2.20 | 0.02 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 4 | 30.32 ns | 0.102 ns | 0.091 ns | 30.28 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 4 | 69.72 ns | 0.464 ns | 0.434 ns | 69.81 ns | 2.30 | 0.02 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 5 | 30.68 ns | 0.153 ns | 0.128 ns | 30.70 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 5 | 67.78 ns | 0.353 ns | 0.275 ns | 67.80 ns | 2.21 | 0.01 | 0.0994 | - | - | 208 B | 2.17 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 6 | 31.04 ns | 0.076 ns | 0.059 ns | 31.05 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 6 | 67.41 ns | 1.157 ns | 1.083 ns | 67.63 ns | 2.17 | 0.04 | 0.0994 | - | - | 208 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 7 | 31.52 ns | 0.087 ns | 0.068 ns | 31.55 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 7 | 66.71 ns | 1.132 ns | 1.004 ns | 67.06 ns | 2.12 | 0.03 | 0.0994 | - | - | 208 B | 1.86 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 8 | 31.88 ns | 0.185 ns | 0.173 ns | 31.82 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 8 | 70.41 ns | 0.588 ns | 0.550 ns | 70.45 ns | 2.21 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 9 | 32.10 ns | 0.069 ns | 0.057 ns | 32.11 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 9 | 70.91 ns | 0.656 ns | 0.614 ns | 71.10 ns | 2.21 | 0.02 | 0.1301 | - | - | 272 B | 2.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 10 | 32.46 ns | 0.094 ns | 0.084 ns | 32.43 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 10 | 71.09 ns | 1.003 ns | 0.938 ns | 71.24 ns | 2.19 | 0.03 | 0.1301 | - | - | 272 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 11 | 33.48 ns | 0.087 ns | 0.073 ns | 33.46 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 11 | 70.84 ns | 0.726 ns | 0.679 ns | 70.93 ns | 2.12 | 0.02 | 0.1301 | - | - | 272 B | 1.89 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 12 | 33.62 ns | 0.043 ns | 0.038 ns | 33.63 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 12 | 70.68 ns | 1.056 ns | 0.988 ns | 70.58 ns | 2.10 | 0.03 | 0.1301 | - | - | 272 B | 1.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 13 | 34.18 ns | 0.315 ns | 0.295 ns | 34.03 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 13 | 71.71 ns | 1.133 ns | 1.060 ns | 71.75 ns | 2.10 | 0.04 | 0.1301 | - | - | 272 B | 1.70 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 14 | 34.21 ns | 0.068 ns | 0.057 ns | 34.20 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 14 | 71.65 ns | 0.601 ns | 0.562 ns | 71.85 ns | 2.10 | 0.02 | 0.1301 | - | - | 272 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 15 | 34.60 ns | 0.090 ns | 0.079 ns | 34.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 15 | 71.54 ns | 0.630 ns | 0.559 ns | 71.50 ns | 2.07 | 0.02 | 0.1301 | - | - | 272 B | 1.55 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 16 | 34.85 ns | 0.183 ns | 0.153 ns | 34.90 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 16 | 83.97 ns | 1.698 ns | 3.352 ns | 84.15 ns | 2.45 | 0.13 | 0.1301 | - | - | 272 B | 1.48 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 17 | 37.29 ns | 0.482 ns | 0.428 ns | 37.15 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 17 | 80.01 ns | 1.003 ns | 0.938 ns | 79.98 ns | 2.15 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 18 | 37.23 ns | 0.416 ns | 0.369 ns | 37.05 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 18 | 80.20 ns | 0.913 ns | 0.809 ns | 79.96 ns | 2.15 | 0.03 | 0.1912 | - | - | 400 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 19 | 37.07 ns | 0.752 ns | 0.923 ns | 36.44 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 19 | 79.43 ns | 1.586 ns | 1.697 ns | 78.90 ns | 2.14 | 0.08 | 0.1912 | - | - | 400 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 20 | 37.81 ns | 0.223 ns | 0.197 ns | 37.74 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 20 | 75.96 ns | 0.455 ns | 0.425 ns | 76.07 ns | 2.01 | 0.01 | 0.1912 | - | - | 400 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 30 | 39.59 ns | 0.038 ns | 0.032 ns | 39.59 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 30 | 76.50 ns | 0.461 ns | 0.431 ns | 76.52 ns | 1.93 | 0.01 | 0.1912 | - | - | 400 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 32 | 40.73 ns | 0.212 ns | 0.188 ns | 40.70 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 32 | 80.46 ns | 1.553 ns | 1.453 ns | 79.88 ns | 1.98 | 0.04 | 0.1912 | - | - | 400 B | 1.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 36 | 48.24 ns | 0.427 ns | 0.379 ns | 48.21 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 36 | 92.22 ns | 0.603 ns | 0.535 ns | 92.26 ns | 1.91 | 0.02 | 0.0726 | - | - | 152 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 37 | 48.88 ns | 0.511 ns | 0.478 ns | 48.72 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 37 | 91.57 ns | 1.342 ns | 1.255 ns | 91.84 ns | 1.87 | 0.03 | 0.0726 | - | - | 152 B | 0.43 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 50.61 ns | 0.450 ns | 0.421 ns | 50.55 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 50.27 ns | 0.666 ns | 0.623 ns | 50.42 ns | 0.99 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 89.80 ns | 0.940 ns | 0.834 ns | 89.91 ns | 1.77 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 40 | 90.59 ns | 0.678 ns | 0.634 ns | 90.50 ns | 1.79 | 0.01 | 0.0726 | - | - | 152 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 50 | 55.61 ns | 0.625 ns | 0.584 ns | 55.57 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 50 | 92.89 ns | 0.605 ns | 0.536 ns | 92.75 ns | 1.67 | 0.02 | 0.0726 | - | - | 152 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 60 | 59.59 ns | 0.908 ns | 0.849 ns | 59.53 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 60 | 94.27 ns | 1.429 ns | 1.337 ns | 94.09 ns | 1.58 | 0.03 | 0.0726 | - | - | 152 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 70 | 65.62 ns | 0.840 ns | 0.786 ns | 65.53 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 70 | 94.55 ns | 1.144 ns | 1.070 ns | 94.47 ns | 1.44 | 0.03 | 0.0726 | - | - | 152 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 80 | 72.59 ns | 1.420 ns | 1.578 ns | 72.16 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 80 | 96.92 ns | 1.129 ns | 1.056 ns | 96.92 ns | 1.33 | 0.03 | 0.0726 | - | - | 152 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 850000 | 2,690,855.45 ns | 53,766.571 ns | 89,831.862 ns | 2,707,524.80 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 850000 | 1,295,325.44 ns | 11,277.756 ns | 10,549.220 ns | 1,290,476.56 ns | 0.48 | 0.02 | - | - | - | 445 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 90 | 75.37 ns | 1.171 ns | 1.038 ns | 75.32 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 90 | 94.47 ns | 0.968 ns | 0.858 ns | 94.07 ns | 1.25 | 0.02 | 0.0726 | - | - | 152 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 100 | 81.25 ns | 1.056 ns | 0.988 ns | 81.46 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 100 | 95.71 ns | 1.422 ns | 1.330 ns | 96.29 ns | 1.18 | 0.02 | 0.0726 | - | - | 152 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 128 | 94.13 ns | 1.498 ns | 1.401 ns | 94.16 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 128 | 98.42 ns | 1.035 ns | 0.968 ns | 98.19 ns | 1.05 | 0.02 | 0.0726 | - | - | 152 B | 0.14 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 256 | 173.02 ns | 2.780 ns | 2.601 ns | 172.70 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 256 | 107.78 ns | 1.789 ns | 1.673 ns | 108.34 ns | 0.62 | 0.01 | 0.0726 | - | - | 152 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 512 | 291.12 ns | 5.589 ns | 5.489 ns | 290.53 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 512 | 119.91 ns | 1.360 ns | 1.273 ns | 119.55 ns | 0.41 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 1024 | 553.09 ns | 10.563 ns | 9.881 ns | 550.62 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 1024 | 152.24 ns | 0.910 ns | 0.806 ns | 152.48 ns | 0.28 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 2048 | 1,099.63 ns | 20.792 ns | 21.352 ns | 1,104.02 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 2048 | 264.14 ns | 2.546 ns | 2.381 ns | 262.97 ns | 0.24 | 0.00 | 0.0725 | - | - | 152 B | 0.009 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 4096 | 2,210.89 ns | 43.313 ns | 69.943 ns | 2,203.66 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 4096 | 657.39 ns | 1.623 ns | 1.355 ns | 657.71 ns | 0.29 | 0.01 | 0.0725 | - | - | 152 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 8192 | 4,222.80 ns | 83.294 ns | 102.293 ns | 4,181.61 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 8192 | 1,121.18 ns | 6.697 ns | 6.265 ns | 1,120.59 ns | 0.26 | 0.01 | 0.0725 | - | - | 152 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 16384 | 62,475.55 ns | 1,217.739 ns | 1,895.873 ns | 62,726.50 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 16384 | 2,489.20 ns | 19.175 ns | 17.936 ns | 2,479.10 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 32768 | 124,615.51 ns | 2,458.956 ns | 4,796.005 ns | 125,940.44 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 32768 | 5,015.98 ns | 13.517 ns | 12.644 ns | 5,019.64 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 65536 | 118,984.88 ns | 2,258.508 ns | 2,218.157 ns | 119,398.51 ns | 1.00 | 0.00 | 113.2813 | 112.1826 | 112.1826 | 524943 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 65536 | 11,137.89 ns | 15.355 ns | 12.822 ns | 11,134.98 ns | 0.09 | 0.00 | 0.1984 | - | - | 432 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)Array [25] | List | RecyclableLongList | 131072 | 359,919.53 ns | 12,722.538 ns | 37,313.001 ns | 352,663.09 ns | 1.00 | 0.00 | 161.1328 | 161.1328 | 161.1328 | 1048915 B | 1.000 | +| Actual | AddRa(...)Array [25] | List | RecyclableLongList | 131072 | 22,125.65 ns | 109.853 ns | 85.766 ns | 22,117.43 ns | 0.06 | 0.01 | 0.1831 | - | - | 432 B | 0.000 | +
+ +# `AddRange` when Source is IEnumerable Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 +``` +
+Add Entire Collection Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|---------------:|-----------------:|---------:|--------:|---------:|---------:|---------:|-----------:|------------:| +| Baseline | AddRa(...)rable [31] | List | Array | 0 | 25.78 ns | 0.196 ns | 0.184 ns | 25.74 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 0 | 17.48 ns | 0.136 ns | 0.127 ns | 17.46 ns | 0.68 | 0.01 | 0.0344 | - | - | 72 B | 0.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 1 | 38.12 ns | 0.349 ns | 0.291 ns | 38.13 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 1 | 24.81 ns | 0.521 ns | 0.659 ns | 24.97 ns | 0.65 | 0.02 | 0.0382 | - | - | 80 B | 0.59 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 2 | 47.49 ns | 0.612 ns | 0.511 ns | 47.43 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 2 | 29.58 ns | 0.108 ns | 0.084 ns | 29.59 ns | 0.62 | 0.01 | 0.0421 | - | - | 88 B | 0.65 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 3 | 56.13 ns | 0.974 ns | 1.042 ns | 55.89 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 3 | 36.85 ns | 0.745 ns | 0.969 ns | 36.63 ns | 0.66 | 0.02 | 0.0459 | - | - | 96 B | 0.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 4 | 61.79 ns | 0.925 ns | 0.865 ns | 61.74 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 4 | 42.51 ns | 0.282 ns | 0.250 ns | 42.49 ns | 0.69 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 5 | 86.55 ns | 1.156 ns | 1.025 ns | 86.76 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 5 | 48.37 ns | 0.288 ns | 0.255 ns | 48.32 ns | 0.56 | 0.01 | 0.0535 | - | - | 112 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 6 | 94.53 ns | 1.186 ns | 1.109 ns | 94.90 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 6 | 54.81 ns | 1.033 ns | 0.966 ns | 55.03 ns | 0.58 | 0.01 | 0.0573 | - | - | 120 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 7 | 99.98 ns | 0.530 ns | 0.414 ns | 100.14 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 7 | 59.97 ns | 0.803 ns | 0.712 ns | 60.19 ns | 0.60 | 0.01 | 0.0612 | - | - | 128 B | 0.57 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 8 | 106.01 ns | 0.746 ns | 0.661 ns | 106.04 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 8 | 64.79 ns | 1.301 ns | 1.217 ns | 65.19 ns | 0.61 | 0.01 | 0.0650 | - | - | 136 B | 0.61 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 9 | 126.55 ns | 2.519 ns | 2.474 ns | 125.55 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 9 | 70.74 ns | 0.618 ns | 0.548 ns | 70.85 ns | 0.56 | 0.01 | 0.0688 | - | - | 144 B | 0.38 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 10 | 133.51 ns | 0.671 ns | 0.595 ns | 133.47 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 10 | 82.73 ns | 1.655 ns | 2.265 ns | 83.34 ns | 0.62 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 11 | 138.47 ns | 0.879 ns | 0.822 ns | 138.30 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 11 | 87.00 ns | 1.704 ns | 2.093 ns | 86.12 ns | 0.63 | 0.02 | 0.0764 | - | - | 160 B | 0.43 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 12 | 145.65 ns | 0.885 ns | 0.739 ns | 145.48 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 12 | 93.81 ns | 1.888 ns | 3.048 ns | 93.70 ns | 0.64 | 0.02 | 0.0802 | - | - | 168 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 13 | 155.25 ns | 2.429 ns | 2.272 ns | 154.63 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 13 | 102.14 ns | 2.033 ns | 3.507 ns | 102.83 ns | 0.66 | 0.03 | 0.0842 | - | - | 176 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 14 | 163.47 ns | 1.738 ns | 1.540 ns | 162.92 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 14 | 107.18 ns | 2.104 ns | 2.423 ns | 107.03 ns | 0.66 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 15 | 171.24 ns | 0.837 ns | 0.742 ns | 171.10 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 15 | 112.40 ns | 2.293 ns | 3.214 ns | 113.21 ns | 0.66 | 0.02 | 0.0918 | - | - | 192 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 16 | 185.53 ns | 0.638 ns | 0.596 ns | 185.57 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 16 | 116.55 ns | 2.308 ns | 2.747 ns | 116.08 ns | 0.63 | 0.02 | 0.0956 | - | - | 200 B | 0.53 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 17 | 214.81 ns | 1.026 ns | 0.909 ns | 214.59 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 17 | 123.02 ns | 2.434 ns | 3.250 ns | 122.88 ns | 0.57 | 0.01 | 0.0994 | - | - | 208 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 18 | 222.01 ns | 1.300 ns | 1.015 ns | 221.91 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 18 | 128.66 ns | 2.550 ns | 3.404 ns | 128.47 ns | 0.57 | 0.02 | 0.1032 | - | - | 216 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 19 | 230.06 ns | 3.628 ns | 3.394 ns | 228.33 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 19 | 133.58 ns | 2.620 ns | 3.407 ns | 132.90 ns | 0.58 | 0.02 | 0.1070 | - | - | 224 B | 0.34 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 20 | 233.44 ns | 0.959 ns | 0.749 ns | 233.33 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 20 | 140.14 ns | 2.803 ns | 4.683 ns | 137.40 ns | 0.60 | 0.02 | 0.1109 | - | - | 232 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 30 | 318.50 ns | 1.697 ns | 1.417 ns | 318.70 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 30 | 190.96 ns | 3.710 ns | 3.471 ns | 188.70 ns | 0.60 | 0.01 | 0.1490 | - | - | 312 B | 0.48 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 32 | 331.76 ns | 2.712 ns | 2.537 ns | 331.16 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 32 | 207.69 ns | 4.152 ns | 7.051 ns | 206.97 ns | 0.62 | 0.02 | 0.1566 | - | - | 328 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 36 | 396.82 ns | 1.849 ns | 1.639 ns | 396.32 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 36 | 232.85 ns | 4.653 ns | 9.610 ns | 229.59 ns | 0.59 | 0.03 | 0.1721 | - | - | 360 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 37 | 406.18 ns | 4.040 ns | 3.779 ns | 404.47 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 37 | 235.24 ns | 4.679 ns | 7.689 ns | 232.85 ns | 0.58 | 0.02 | 0.1760 | - | - | 368 B | 0.31 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 40 | 436.81 ns | 3.098 ns | 2.418 ns | 436.58 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Baseline | AddRa(...)rable [31] | List | Array | 40 | 439.83 ns | 3.243 ns | 2.532 ns | 439.09 ns | 1.01 | 0.01 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 40 | 256.53 ns | 5.154 ns | 10.173 ns | 254.67 ns | 0.58 | 0.02 | 0.1874 | - | - | 392 B | 0.33 | +| Actual | AddRa(...)rable [31] | List | Array | 40 | 262.50 ns | 5.254 ns | 11.083 ns | 260.79 ns | 0.61 | 0.03 | 0.1874 | - | - | 392 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 50 | 524.34 ns | 8.310 ns | 7.773 ns | 527.23 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 50 | 299.45 ns | 1.778 ns | 1.388 ns | 299.34 ns | 0.57 | 0.01 | 0.2255 | - | - | 472 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 60 | 593.14 ns | 9.693 ns | 8.593 ns | 592.38 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 60 | 359.32 ns | 4.618 ns | 4.094 ns | 358.81 ns | 0.61 | 0.01 | 0.2637 | - | - | 552 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 70 | 734.98 ns | 11.308 ns | 10.024 ns | 733.24 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 70 | 423.04 ns | 8.270 ns | 14.044 ns | 419.54 ns | 0.57 | 0.02 | 0.3018 | - | - | 632 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 80 | 811.19 ns | 6.062 ns | 5.062 ns | 810.43 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 80 | 468.13 ns | 2.251 ns | 1.757 ns | 468.50 ns | 0.58 | 0.00 | 0.3405 | - | - | 712 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 90 | 885.58 ns | 12.728 ns | 11.283 ns | 879.70 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 90 | 535.74 ns | 9.655 ns | 12.555 ns | 529.98 ns | 0.61 | 0.02 | 0.3786 | - | - | 792 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 100 | 959.25 ns | 3.028 ns | 2.364 ns | 959.30 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 100 | 596.28 ns | 11.864 ns | 19.822 ns | 585.59 ns | 0.63 | 0.02 | 0.4168 | - | - | 872 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 128 | 1,162.04 ns | 10.489 ns | 9.298 ns | 1,162.35 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 128 | 775.89 ns | 15.377 ns | 35.022 ns | 770.03 ns | 0.70 | 0.02 | 0.5236 | - | - | 1096 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 256 | 2,256.64 ns | 12.465 ns | 11.050 ns | 2,253.95 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 256 | 1,498.60 ns | 29.755 ns | 46.325 ns | 1,482.43 ns | 0.66 | 0.02 | 1.0128 | - | - | 2120 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 512 | 4,358.50 ns | 9.234 ns | 8.186 ns | 4,359.13 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 512 | 2,969.92 ns | 59.027 ns | 93.623 ns | 2,962.38 ns | 0.68 | 0.02 | 1.9913 | - | - | 4168 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 1024 | 8,694.16 ns | 136.576 ns | 127.753 ns | 8,646.62 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 1024 | 5,914.41 ns | 116.704 ns | 155.796 ns | 5,902.23 ns | 0.68 | 0.02 | 3.9520 | - | - | 8264 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 2048 | 17,407.51 ns | 336.986 ns | 360.571 ns | 17,456.07 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 2048 | 11,558.97 ns | 225.751 ns | 241.551 ns | 11,517.43 ns | 0.66 | 0.02 | 7.8125 | - | - | 16456 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 4096 | 33,624.38 ns | 136.060 ns | 106.227 ns | 33,605.55 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 4096 | 23,179.55 ns | 457.688 ns | 670.873 ns | 22,820.25 ns | 0.69 | 0.02 | 15.5945 | - | - | 32840 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 8192 | 67,822.71 ns | 599.387 ns | 531.341 ns | 67,775.43 ns | 1.00 | 0.00 | 62.3779 | - | - | 131408 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 8192 | 47,454.62 ns | 944.141 ns | 1,628.597 ns | 47,098.79 ns | 0.69 | 0.02 | 31.1890 | - | - | 65608 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 16384 | 200,073.30 ns | 717.363 ns | 671.022 ns | 200,232.50 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262518 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 16384 | 134,030.79 ns | 2,261.644 ns | 2,513.811 ns | 133,581.35 ns | 0.67 | 0.01 | 41.5039 | 41.5039 | 41.5039 | 131158 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 32768 | 442,082.44 ns | 1,871.537 ns | 1,562.818 ns | 442,208.79 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524714 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 32768 | 265,042.58 ns | 4,573.977 ns | 4,278.501 ns | 265,496.68 ns | 0.60 | 0.01 | 83.0078 | 83.0078 | 83.0078 | 262244 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 65536 | 732,121.80 ns | 8,507.681 ns | 7,958.090 ns | 731,070.51 ns | 1.00 | 0.00 | 313.4766 | 249.0234 | 249.0234 | 1049062 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 65536 | 479,625.85 ns | 5,911.688 ns | 5,529.796 ns | 480,425.10 ns | 0.66 | 0.01 | 137.6953 | 136.7188 | 136.7188 | 524403 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 131072 | 1,511,039.33 ns | 22,986.416 ns | 20,376.859 ns | 1,503,391.89 ns | 1.00 | 0.00 | 562.5000 | 498.0469 | 496.0938 | 2097834 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 131072 | 968,246.56 ns | 12,624.990 ns | 11,191.725 ns | 968,908.69 ns | 0.64 | 0.01 | 219.7266 | 218.7500 | 218.7500 | 1048717 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | Array | 850000 | 10,320,673.85 ns | 78,151.711 ns | 73,103.159 ns | 10,298,073.44 ns | 1.00 | 0.00 | 406.2500 | 343.7500 | 343.7500 | 16777841 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | Array | 850000 | 5,935,812.81 ns | 54,384.422 ns | 50,871.222 ns | 5,947,553.91 ns | 0.58 | 0.01 | 140.6250 | 140.6250 | 140.6250 | 6800122 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 0 | 22.13 ns | 0.468 ns | 0.500 ns | 21.91 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 0 | 26.39 ns | 0.397 ns | 0.352 ns | 26.23 ns | 1.19 | 0.03 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 1 | 38.27 ns | 0.562 ns | 0.526 ns | 38.29 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 1 | 68.60 ns | 0.339 ns | 0.283 ns | 68.51 ns | 1.79 | 0.03 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 2 | 48.29 ns | 0.585 ns | 0.518 ns | 48.23 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 2 | 78.95 ns | 1.267 ns | 1.123 ns | 78.87 ns | 1.64 | 0.04 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 3 | 55.91 ns | 0.694 ns | 0.615 ns | 55.83 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 3 | 86.25 ns | 0.704 ns | 0.658 ns | 86.18 ns | 1.54 | 0.02 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 4 | 63.95 ns | 0.533 ns | 0.473 ns | 63.72 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 4 | 93.92 ns | 0.283 ns | 0.251 ns | 93.92 ns | 1.47 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 5 | 83.76 ns | 0.904 ns | 0.846 ns | 83.63 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 5 | 101.50 ns | 1.040 ns | 0.973 ns | 101.03 ns | 1.21 | 0.01 | 0.0497 | - | - | 104 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 6 | 90.04 ns | 1.748 ns | 1.635 ns | 90.32 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 6 | 108.32 ns | 0.234 ns | 0.183 ns | 108.30 ns | 1.20 | 0.02 | 0.0497 | - | - | 104 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 7 | 97.88 ns | 0.718 ns | 0.561 ns | 97.95 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 7 | 117.47 ns | 0.226 ns | 0.189 ns | 117.41 ns | 1.20 | 0.01 | 0.0496 | - | - | 104 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 8 | 105.44 ns | 0.899 ns | 0.797 ns | 105.60 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 8 | 134.12 ns | 1.176 ns | 0.982 ns | 133.95 ns | 1.27 | 0.01 | 0.0496 | - | - | 104 B | 0.46 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 9 | 125.47 ns | 2.052 ns | 1.920 ns | 124.64 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 9 | 143.63 ns | 2.001 ns | 1.872 ns | 142.54 ns | 1.14 | 0.02 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 10 | 131.83 ns | 1.060 ns | 0.885 ns | 132.02 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 10 | 150.29 ns | 0.252 ns | 0.211 ns | 150.33 ns | 1.14 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 11 | 139.68 ns | 0.733 ns | 0.650 ns | 139.44 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 11 | 158.71 ns | 0.987 ns | 0.824 ns | 158.61 ns | 1.14 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 12 | 148.03 ns | 2.537 ns | 2.373 ns | 147.21 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 12 | 165.30 ns | 0.671 ns | 0.595 ns | 165.30 ns | 1.12 | 0.02 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 13 | 156.37 ns | 2.689 ns | 2.516 ns | 156.10 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 13 | 173.10 ns | 0.579 ns | 0.513 ns | 173.10 ns | 1.11 | 0.02 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 14 | 160.24 ns | 0.885 ns | 0.739 ns | 160.26 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 14 | 180.99 ns | 0.616 ns | 0.481 ns | 181.03 ns | 1.13 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 15 | 166.65 ns | 2.013 ns | 1.883 ns | 165.98 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 15 | 187.29 ns | 0.791 ns | 0.702 ns | 187.08 ns | 1.12 | 0.01 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 16 | 182.99 ns | 0.578 ns | 0.451 ns | 182.80 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 16 | 195.45 ns | 0.525 ns | 0.410 ns | 195.58 ns | 1.07 | 0.00 | 0.0496 | - | - | 104 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 17 | 212.53 ns | 0.710 ns | 0.555 ns | 212.47 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 17 | 237.68 ns | 2.633 ns | 2.198 ns | 237.28 ns | 1.12 | 0.01 | 0.0496 | - | - | 104 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 18 | 231.13 ns | 2.722 ns | 2.413 ns | 230.55 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 18 | 243.49 ns | 2.684 ns | 2.380 ns | 242.35 ns | 1.05 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 19 | 239.03 ns | 3.811 ns | 3.565 ns | 239.00 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 19 | 255.19 ns | 2.924 ns | 2.592 ns | 255.21 ns | 1.07 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 20 | 245.17 ns | 3.168 ns | 2.808 ns | 244.56 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 20 | 261.34 ns | 3.499 ns | 3.273 ns | 261.39 ns | 1.07 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 30 | 328.00 ns | 6.292 ns | 7.246 ns | 327.58 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 30 | 336.90 ns | 3.981 ns | 3.724 ns | 335.71 ns | 1.02 | 0.02 | 0.0496 | - | - | 104 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 32 | 333.81 ns | 3.597 ns | 3.003 ns | 334.32 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 32 | 354.19 ns | 2.893 ns | 2.259 ns | 353.79 ns | 1.06 | 0.01 | 0.0496 | - | - | 104 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 36 | 409.27 ns | 6.592 ns | 5.843 ns | 408.47 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 36 | 419.60 ns | 8.023 ns | 7.505 ns | 415.52 ns | 1.03 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 37 | 408.60 ns | 1.655 ns | 1.292 ns | 408.40 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 37 | 436.01 ns | 8.149 ns | 7.623 ns | 434.52 ns | 1.07 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 40 | 450.09 ns | 9.015 ns | 8.854 ns | 449.08 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Baseline | AddRa(...)rable [31] | List | PooledList | 40 | 438.16 ns | 3.354 ns | 2.973 ns | 437.01 ns | 0.97 | 0.02 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 40 | 449.47 ns | 4.785 ns | 4.476 ns | 447.83 ns | 1.00 | 0.03 | 0.0496 | - | - | 104 B | 0.09 | +| Actual | AddRa(...)rable [31] | List | PooledList | 40 | 456.59 ns | 7.051 ns | 6.595 ns | 453.36 ns | 1.02 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 50 | 511.15 ns | 2.439 ns | 2.036 ns | 510.38 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 50 | 523.99 ns | 8.585 ns | 7.611 ns | 521.45 ns | 1.03 | 0.02 | 0.0496 | - | - | 104 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 60 | 585.25 ns | 3.570 ns | 3.165 ns | 584.66 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 60 | 593.64 ns | 5.560 ns | 5.201 ns | 591.69 ns | 1.02 | 0.01 | 0.0496 | - | - | 104 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 70 | 754.51 ns | 14.994 ns | 28.888 ns | 744.46 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 70 | 739.33 ns | 9.107 ns | 8.073 ns | 741.52 ns | 0.95 | 0.04 | 0.0496 | - | - | 104 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 80 | 800.61 ns | 6.079 ns | 5.687 ns | 798.07 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 80 | 786.55 ns | 5.322 ns | 4.979 ns | 784.31 ns | 0.98 | 0.01 | 0.0496 | - | - | 104 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 850000 | 10,880,248.44 ns | 207,548.169 ns | 269,871.245 ns | 10,855,839.84 ns | 1.00 | 0.00 | 515.6250 | 453.1250 | 453.1250 | 16777870 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 850000 | 7,411,663.28 ns | 66,913.436 ns | 59,317.019 ns | 7,386,128.12 ns | 0.68 | 0.02 | - | - | - | 111 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 90 | 887.43 ns | 9.837 ns | 8.720 ns | 885.56 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 90 | 878.82 ns | 17.381 ns | 18.597 ns | 872.73 ns | 0.99 | 0.03 | 0.0496 | - | - | 104 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 100 | 959.47 ns | 7.667 ns | 5.986 ns | 958.28 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 100 | 941.29 ns | 12.834 ns | 12.005 ns | 934.22 ns | 0.98 | 0.01 | 0.0496 | - | - | 104 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 128 | 1,184.03 ns | 15.693 ns | 13.911 ns | 1,178.43 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 128 | 1,160.77 ns | 22.821 ns | 21.347 ns | 1,158.93 ns | 0.98 | 0.02 | 0.0496 | - | - | 104 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 256 | 2,344.06 ns | 46.566 ns | 96.168 ns | 2,300.84 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 256 | 2,166.78 ns | 33.918 ns | 30.067 ns | 2,156.83 ns | 0.88 | 0.03 | 0.0496 | - | - | 104 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 512 | 4,413.86 ns | 77.967 ns | 72.930 ns | 4,384.82 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | PooledList | 512 | 4,084.52 ns | 78.821 ns | 69.873 ns | 4,053.80 ns | 0.92 | 0.02 | 0.0458 | - | - | 104 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 1024 | 9,586.15 ns | 189.269 ns | 449.817 ns | 9,654.34 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 1024 | 8,559.76 ns | 168.505 ns | 257.325 ns | 8,612.04 ns | 0.92 | 0.06 | 0.0458 | - | - | 104 B | 0.006 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 2048 | 17,335.83 ns | 329.401 ns | 308.122 ns | 17,127.51 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 2048 | 15,795.48 ns | 306.597 ns | 301.119 ns | 15,749.75 ns | 0.91 | 0.02 | 0.0305 | - | - | 104 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 4096 | 34,530.69 ns | 686.120 ns | 790.137 ns | 34,024.08 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 4096 | 31,110.49 ns | 599.677 ns | 560.938 ns | 30,929.75 ns | 0.90 | 0.02 | - | - | - | 104 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 8192 | 70,399.60 ns | 1,387.534 ns | 2,896.300 ns | 69,156.54 ns | 1.00 | 0.00 | 62.3779 | - | - | 131408 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 8192 | 60,685.22 ns | 895.972 ns | 838.093 ns | 60,283.63 ns | 0.84 | 0.05 | - | - | - | 104 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 16384 | 198,986.52 ns | 2,150.720 ns | 2,011.785 ns | 198,382.28 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262518 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 16384 | 120,307.15 ns | 1,263.434 ns | 1,120.001 ns | 119,916.37 ns | 0.60 | 0.01 | - | - | - | 104 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 32768 | 439,823.29 ns | 4,250.889 ns | 3,976.284 ns | 439,076.12 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524714 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 32768 | 256,719.65 ns | 838.695 ns | 654.798 ns | 256,754.74 ns | 0.58 | 0.01 | - | - | - | 104 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 65536 | 734,694.88 ns | 7,150.954 ns | 6,689.007 ns | 735,449.80 ns | 1.00 | 0.00 | 313.4766 | 249.0234 | 249.0234 | 1049062 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 65536 | 522,905.61 ns | 8,238.839 ns | 7,706.615 ns | 524,219.43 ns | 0.71 | 0.01 | - | - | - | 105 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | PooledList | 131072 | 1,543,131.47 ns | 29,825.765 ns | 39,816.540 ns | 1,530,327.73 ns | 1.00 | 0.00 | 552.7344 | 488.2813 | 486.3281 | 2097866 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | PooledList | 131072 | 1,035,092.20 ns | 9,494.284 ns | 8,880.960 ns | 1,031,517.58 ns | 0.66 | 0.02 | - | - | - | 106 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 0 | 21.90 ns | 0.415 ns | 0.388 ns | 21.86 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 0 | 55.07 ns | 0.785 ns | 0.656 ns | 55.06 ns | 2.51 | 0.05 | 0.0727 | - | - | 152 B | 1.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 1 | 35.50 ns | 0.340 ns | 0.301 ns | 35.36 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 1 | 87.84 ns | 1.096 ns | 0.972 ns | 87.44 ns | 2.47 | 0.02 | 0.0880 | - | - | 184 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 2 | 42.12 ns | 0.095 ns | 0.074 ns | 42.15 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 2 | 98.72 ns | 1.277 ns | 1.132 ns | 98.39 ns | 2.34 | 0.02 | 0.0880 | - | - | 184 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 3 | 49.53 ns | 0.276 ns | 0.244 ns | 49.45 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 3 | 103.72 ns | 0.683 ns | 0.570 ns | 103.84 ns | 2.09 | 0.02 | 0.0880 | - | - | 184 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 4 | 57.02 ns | 0.557 ns | 0.521 ns | 56.67 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 4 | 110.06 ns | 1.329 ns | 1.243 ns | 110.40 ns | 1.93 | 0.03 | 0.0880 | - | - | 184 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 5 | 83.75 ns | 0.579 ns | 0.484 ns | 83.87 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 5 | 114.73 ns | 1.613 ns | 1.508 ns | 114.37 ns | 1.37 | 0.02 | 0.0880 | - | - | 184 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 6 | 90.43 ns | 1.172 ns | 1.097 ns | 90.46 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 6 | 122.22 ns | 2.169 ns | 2.029 ns | 121.69 ns | 1.35 | 0.03 | 0.0880 | - | - | 184 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 7 | 100.04 ns | 0.882 ns | 0.825 ns | 100.29 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 7 | 127.21 ns | 1.125 ns | 1.053 ns | 126.82 ns | 1.27 | 0.01 | 0.0880 | - | - | 184 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 8 | 106.77 ns | 1.207 ns | 1.129 ns | 106.58 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 8 | 136.30 ns | 1.177 ns | 1.044 ns | 136.27 ns | 1.28 | 0.02 | 0.0880 | - | - | 184 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 9 | 129.93 ns | 1.997 ns | 1.868 ns | 129.06 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 9 | 143.39 ns | 1.061 ns | 0.886 ns | 143.22 ns | 1.10 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 10 | 135.18 ns | 0.565 ns | 0.501 ns | 135.08 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 10 | 151.48 ns | 1.556 ns | 1.455 ns | 151.30 ns | 1.12 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 11 | 142.75 ns | 0.637 ns | 0.564 ns | 142.71 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 11 | 158.07 ns | 2.836 ns | 2.514 ns | 156.94 ns | 1.11 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 12 | 149.21 ns | 1.017 ns | 0.901 ns | 148.88 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 12 | 163.10 ns | 1.944 ns | 1.818 ns | 162.86 ns | 1.09 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 13 | 156.64 ns | 1.298 ns | 1.150 ns | 156.25 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 13 | 168.96 ns | 1.992 ns | 1.663 ns | 169.45 ns | 1.08 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 14 | 166.04 ns | 1.523 ns | 1.272 ns | 165.93 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 14 | 177.96 ns | 2.072 ns | 1.938 ns | 178.36 ns | 1.07 | 0.02 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 15 | 173.24 ns | 0.707 ns | 0.627 ns | 173.30 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 15 | 185.99 ns | 1.904 ns | 1.688 ns | 185.60 ns | 1.07 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 16 | 192.52 ns | 2.282 ns | 2.135 ns | 191.69 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 16 | 185.35 ns | 1.169 ns | 1.093 ns | 185.18 ns | 0.96 | 0.01 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 17 | 218.49 ns | 4.210 ns | 3.938 ns | 216.26 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 17 | 196.95 ns | 2.942 ns | 2.752 ns | 195.69 ns | 0.90 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 18 | 225.27 ns | 0.959 ns | 0.850 ns | 225.21 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 18 | 196.42 ns | 2.686 ns | 2.512 ns | 196.49 ns | 0.87 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 19 | 234.68 ns | 2.296 ns | 2.148 ns | 234.06 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 19 | 206.14 ns | 2.101 ns | 1.965 ns | 206.01 ns | 0.88 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 20 | 242.55 ns | 2.033 ns | 1.802 ns | 242.21 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 20 | 237.51 ns | 3.461 ns | 3.238 ns | 236.82 ns | 0.98 | 0.01 | 0.0880 | - | - | 184 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 30 | 321.77 ns | 2.484 ns | 2.202 ns | 321.57 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 30 | 263.23 ns | 3.135 ns | 2.448 ns | 262.31 ns | 0.82 | 0.01 | 0.0877 | - | - | 184 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 32 | 341.53 ns | 4.935 ns | 4.121 ns | 340.91 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 32 | 295.66 ns | 5.933 ns | 12.384 ns | 291.02 ns | 0.87 | 0.03 | 0.0877 | - | - | 184 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 36 | 407.63 ns | 0.882 ns | 0.688 ns | 407.45 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 36 | 329.36 ns | 6.596 ns | 16.908 ns | 328.51 ns | 0.84 | 0.04 | 0.0877 | - | - | 184 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 37 | 449.41 ns | 7.363 ns | 6.887 ns | 449.20 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 37 | 307.73 ns | 1.815 ns | 1.609 ns | 307.34 ns | 0.69 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 40 | 463.89 ns | 4.803 ns | 4.492 ns | 464.07 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 40 | 464.93 ns | 3.704 ns | 3.465 ns | 464.10 ns | 1.00 | 0.01 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 40 | 322.52 ns | 2.145 ns | 1.901 ns | 322.67 ns | 0.69 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 40 | 343.96 ns | 6.690 ns | 5.586 ns | 341.43 ns | 0.74 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 50 | 545.24 ns | 6.773 ns | 6.335 ns | 543.80 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 50 | 405.50 ns | 7.173 ns | 6.710 ns | 402.56 ns | 0.74 | 0.01 | 0.0877 | - | - | 184 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 60 | 611.51 ns | 3.438 ns | 3.048 ns | 611.17 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 60 | 436.62 ns | 2.170 ns | 2.030 ns | 436.04 ns | 0.71 | 0.00 | 0.0877 | - | - | 184 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 70 | 811.47 ns | 12.280 ns | 11.487 ns | 815.18 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 70 | 603.49 ns | 11.842 ns | 11.077 ns | 599.45 ns | 0.74 | 0.02 | 0.1030 | - | - | 216 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 80 | 859.66 ns | 12.058 ns | 11.279 ns | 856.73 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 80 | 664.50 ns | 1.110 ns | 0.867 ns | 664.82 ns | 0.77 | 0.01 | 0.1030 | - | - | 216 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 90 | 991.43 ns | 18.358 ns | 16.274 ns | 997.32 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 90 | 682.24 ns | 2.378 ns | 1.986 ns | 681.82 ns | 0.69 | 0.01 | 0.1030 | - | - | 216 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 100 | 997.85 ns | 4.630 ns | 3.615 ns | 998.54 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 100 | 754.16 ns | 8.127 ns | 7.204 ns | 754.60 ns | 0.75 | 0.01 | 0.1030 | - | - | 216 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 128 | 1,208.34 ns | 8.081 ns | 7.164 ns | 1,209.08 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 128 | 976.30 ns | 5.620 ns | 5.257 ns | 973.53 ns | 0.81 | 0.00 | 0.1030 | - | - | 216 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 256 | 2,314.62 ns | 15.935 ns | 14.906 ns | 2,312.83 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 256 | 1,705.99 ns | 10.982 ns | 9.736 ns | 1,707.46 ns | 0.74 | 0.01 | 0.1183 | - | - | 248 B | 0.06 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 512 | 4,482.16 ns | 23.324 ns | 21.817 ns | 4,483.14 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 512 | 3,443.71 ns | 31.391 ns | 29.363 ns | 3,434.95 ns | 0.77 | 0.01 | 0.1335 | - | - | 280 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 1024 | 8,850.27 ns | 76.433 ns | 67.756 ns | 8,837.98 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 1024 | 6,524.08 ns | 24.421 ns | 20.393 ns | 6,518.63 ns | 0.74 | 0.01 | 0.1450 | - | - | 312 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 2048 | 17,638.01 ns | 208.425 ns | 194.961 ns | 17,645.52 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 2048 | 12,827.77 ns | 55.197 ns | 48.931 ns | 12,800.81 ns | 0.73 | 0.01 | 0.1526 | - | - | 344 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 4096 | 34,696.09 ns | 103.430 ns | 96.748 ns | 34,698.35 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 4096 | 25,527.50 ns | 276.994 ns | 259.100 ns | 25,384.84 ns | 0.74 | 0.01 | 0.1526 | - | - | 376 B | 0.006 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 8192 | 69,429.80 ns | 342.425 ns | 303.551 ns | 69,411.41 ns | 1.00 | 0.00 | 62.5000 | - | - | 131409 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 8192 | 50,481.98 ns | 445.098 ns | 347.504 ns | 50,357.37 ns | 0.73 | 0.01 | 0.1831 | - | - | 408 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 16384 | 205,825.44 ns | 1,126.992 ns | 1,054.189 ns | 206,108.84 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262532 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 16384 | 100,040.85 ns | 406.472 ns | 360.327 ns | 99,968.49 ns | 0.49 | 0.00 | 0.1221 | - | - | 442 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 32768 | 449,865.22 ns | 2,775.842 ns | 2,596.524 ns | 450,479.15 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524756 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 32768 | 205,285.65 ns | 4,037.102 ns | 5,526.031 ns | 204,362.44 ns | 0.46 | 0.01 | - | - | - | 474 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 65536 | 755,415.23 ns | 4,934.526 ns | 4,374.329 ns | 754,912.65 ns | 1.00 | 0.00 | 312.5000 | 248.0469 | 248.0469 | 1049153 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 65536 | 435,044.38 ns | 8,629.603 ns | 16,626.316 ns | 437,810.94 ns | 0.57 | 0.02 | - | - | - | 510 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 131072 | 1,545,422.10 ns | 18,672.077 ns | 16,552.310 ns | 1,544,944.14 ns | 1.00 | 0.00 | 550.7813 | 484.3750 | 484.3750 | 2097978 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 131072 | 854,004.41 ns | 16,611.239 ns | 27,753.649 ns | 860,179.05 ns | 0.55 | 0.02 | - | - | - | 549 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableList | 850000 | 10,686,702.49 ns | 211,218.496 ns | 251,440.595 ns | 10,719,078.91 ns | 1.00 | 0.00 | 546.8750 | 484.3750 | 484.3750 | 16778122 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableList | 850000 | 5,293,758.75 ns | 105,482.908 ns | 121,474.273 ns | 5,290,523.44 ns | 0.50 | 0.02 | - | - | - | 733 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 0 | 21.24 ns | 0.244 ns | 0.228 ns | 21.13 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 0 | 54.83 ns | 0.480 ns | 0.426 ns | 54.65 ns | 2.59 | 0.03 | 0.0650 | - | - | 136 B | 1.70 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 1 | 35.78 ns | 0.167 ns | 0.130 ns | 35.80 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 1 | 242,173.38 ns | 3,287.264 ns | 2,914.074 ns | 241,949.76 ns | 6,777.87 | 87.70 | 114.2578 | 70.0684 | - | 524459 B | 3,856.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 2 | 53.84 ns | 1.091 ns | 1.911 ns | 52.91 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 2 | 122,843.62 ns | 1,234.305 ns | 1,094.179 ns | 122,945.24 ns | 2,249.03 | 78.42 | 95.4590 | 38.8184 | - | 327850 B | 2,410.66 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 3 | 58.63 ns | 0.553 ns | 0.517 ns | 58.34 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 3 | 61,344.96 ns | 1,218.905 ns | 1,897.688 ns | 61,452.93 ns | 1,044.48 | 27.67 | 100.0977 | 20.1416 | - | 229545 B | 1,687.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 4 | 68.42 ns | 1.289 ns | 1.205 ns | 67.96 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 4 | 59,795.14 ns | 1,134.297 ns | 1,393.019 ns | 59,428.66 ns | 875.17 | 30.02 | 99.3652 | 19.8975 | - | 229545 B | 1,687.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 5 | 82.28 ns | 1.431 ns | 1.338 ns | 82.43 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 5 | 35,056.88 ns | 698.299 ns | 1,223.015 ns | 35,204.66 ns | 427.77 | 18.13 | 75.8667 | 15.6250 | - | 180392 B | 805.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 6 | 89.10 ns | 0.985 ns | 0.769 ns | 89.13 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 6 | 33,834.12 ns | 665.554 ns | 1,130.162 ns | 33,915.81 ns | 380.65 | 14.30 | 73.9746 | 17.6392 | - | 180392 B | 805.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 7 | 96.52 ns | 1.241 ns | 1.100 ns | 96.19 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 7 | 33,956.83 ns | 659.700 ns | 903.005 ns | 34,282.02 ns | 353.59 | 9.06 | 73.9136 | 17.6392 | - | 180392 B | 805.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 8 | 105.82 ns | 1.046 ns | 0.978 ns | 105.92 ns | 1.00 | 0.00 | 0.1070 | - | - | 224 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 8 | 35,307.64 ns | 703.489 ns | 1,194.578 ns | 35,641.86 ns | 335.20 | 11.22 | 78.2471 | 13.3667 | - | 180392 B | 805.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 9 | 132.11 ns | 1.115 ns | 1.043 ns | 131.76 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 9 | 22,396.56 ns | 434.944 ns | 427.173 ns | 22,480.55 ns | 169.68 | 3.07 | 69.0918 | 11.7493 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 10 | 138.59 ns | 0.640 ns | 0.534 ns | 138.74 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 10 | 21,191.67 ns | 412.212 ns | 550.292 ns | 21,252.59 ns | 154.51 | 1.67 | 69.0308 | 11.9019 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 11 | 143.74 ns | 1.239 ns | 1.159 ns | 143.80 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 11 | 22,157.14 ns | 281.844 ns | 249.848 ns | 22,126.26 ns | 154.17 | 2.38 | 69.0613 | 11.8408 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 12 | 152.09 ns | 1.092 ns | 1.022 ns | 151.77 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 12 | 21,624.86 ns | 308.173 ns | 288.265 ns | 21,742.89 ns | 142.19 | 2.55 | 69.1528 | 11.1694 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 13 | 158.74 ns | 1.942 ns | 1.817 ns | 158.17 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 13 | 22,351.98 ns | 440.161 ns | 556.663 ns | 22,411.38 ns | 141.28 | 4.31 | 69.1528 | 10.6201 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 14 | 165.96 ns | 1.955 ns | 1.829 ns | 165.31 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 14 | 22,125.00 ns | 268.176 ns | 237.731 ns | 22,113.45 ns | 133.46 | 2.49 | 69.1223 | 11.6577 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 15 | 172.85 ns | 0.881 ns | 0.824 ns | 172.80 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 15 | 22,542.99 ns | 288.220 ns | 269.601 ns | 22,454.91 ns | 130.42 | 1.84 | 69.0918 | 11.8713 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 16 | 190.23 ns | 1.139 ns | 1.009 ns | 189.73 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 16 | 21,964.76 ns | 288.056 ns | 255.354 ns | 21,966.31 ns | 115.47 | 1.31 | 69.0002 | 11.9629 | - | 155816 B | 414.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 17 | 222.08 ns | 2.240 ns | 1.986 ns | 221.45 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 17 | 15,371.35 ns | 71.041 ns | 55.464 ns | 15,377.95 ns | 69.16 | 0.81 | 65.2771 | 10.1624 | - | 143528 B | 218.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 18 | 229.75 ns | 2.799 ns | 2.618 ns | 229.02 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 18 | 15,488.06 ns | 143.398 ns | 134.135 ns | 15,465.51 ns | 67.42 | 0.82 | 65.3076 | 10.2234 | - | 143528 B | 218.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 19 | 239.92 ns | 3.669 ns | 3.253 ns | 240.21 ns | 1.00 | 0.00 | 0.3135 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 19 | 15,231.72 ns | 157.506 ns | 131.524 ns | 15,283.70 ns | 63.50 | 0.91 | 65.2771 | 10.1929 | - | 143528 B | 218.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 20 | 263.46 ns | 5.282 ns | 9.658 ns | 262.57 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 20 | 15,521.44 ns | 248.027 ns | 219.869 ns | 15,575.36 ns | 59.67 | 2.39 | 65.3076 | 10.1624 | - | 143528 B | 218.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 30 | 328.38 ns | 1.578 ns | 1.232 ns | 328.04 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 30 | 15,413.99 ns | 144.819 ns | 128.379 ns | 15,427.34 ns | 46.91 | 0.46 | 65.2771 | 10.2234 | - | 143528 B | 218.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 32 | 342.78 ns | 1.281 ns | 1.136 ns | 342.68 ns | 1.00 | 0.00 | 0.3133 | - | - | 656 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 32 | 15,420.49 ns | 268.032 ns | 275.249 ns | 15,392.94 ns | 45.09 | 0.90 | 65.3381 | 10.1624 | - | 143528 B | 218.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 36 | 444.55 ns | 5.822 ns | 5.446 ns | 445.02 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 36 | 6,310.06 ns | 123.759 ns | 206.774 ns | 6,274.89 ns | 14.59 | 0.51 | 3.9978 | - | - | 8360 B | 7.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 37 | 470.02 ns | 8.695 ns | 15.900 ns | 466.01 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 37 | 6,093.13 ns | 80.585 ns | 67.292 ns | 6,081.89 ns | 12.65 | 0.60 | 3.9978 | - | - | 8360 B | 7.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 475.02 ns | 7.382 ns | 6.905 ns | 472.17 ns | 1.00 | 0.00 | 0.5698 | - | - | 1192 B | 1.00 | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 473.66 ns | 8.149 ns | 7.622 ns | 472.11 ns | 1.00 | 0.02 | 0.5698 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 6,197.49 ns | 115.232 ns | 113.173 ns | 6,206.49 ns | 13.06 | 0.32 | 3.9978 | - | - | 8360 B | 7.01 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 40 | 6,199.03 ns | 93.113 ns | 87.098 ns | 6,202.28 ns | 13.05 | 0.24 | 3.9978 | - | - | 8360 B | 7.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 50 | 557.49 ns | 6.963 ns | 6.172 ns | 555.00 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 50 | 6,220.45 ns | 63.771 ns | 59.651 ns | 6,209.36 ns | 11.17 | 0.17 | 3.9978 | - | - | 8360 B | 7.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 60 | 648.63 ns | 11.410 ns | 10.673 ns | 650.46 ns | 1.00 | 0.00 | 0.5693 | - | - | 1192 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 60 | 6,211.75 ns | 124.239 ns | 116.213 ns | 6,169.68 ns | 9.58 | 0.20 | 3.9978 | - | - | 8360 B | 7.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 70 | 791.11 ns | 11.140 ns | 10.420 ns | 789.19 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 70 | 3,609.18 ns | 70.427 ns | 109.647 ns | 3,591.62 ns | 4.52 | 0.14 | 2.0370 | - | - | 4264 B | 1.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 80 | 879.72 ns | 17.456 ns | 20.103 ns | 876.60 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 80 | 3,583.09 ns | 66.536 ns | 71.192 ns | 3,601.66 ns | 4.08 | 0.11 | 2.0370 | - | - | 4264 B | 1.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 850000 | 10,953,562.99 ns | 212,093.928 ns | 208,304.596 ns | 10,946,453.91 ns | 1.00 | 0.00 | 531.2500 | 468.7500 | 468.7500 | 16778108 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 850000 | 5,458,793.54 ns | 43,884.873 ns | 36,645.856 ns | 5,474,311.33 ns | 0.50 | 0.01 | - | - | - | 709 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 90 | 943.68 ns | 9.147 ns | 8.557 ns | 942.25 ns | 1.00 | 0.00 | 1.0710 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 90 | 3,644.09 ns | 72.228 ns | 67.562 ns | 3,650.08 ns | 3.86 | 0.09 | 2.0370 | - | - | 4264 B | 1.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 100 | 1,050.13 ns | 16.040 ns | 15.004 ns | 1,045.07 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 100 | 3,684.75 ns | 49.622 ns | 43.989 ns | 3,695.76 ns | 3.52 | 0.07 | 2.0370 | - | - | 4264 B | 1.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 128 | 1,282.23 ns | 24.572 ns | 29.252 ns | 1,276.40 ns | 1.00 | 0.00 | 1.0700 | - | - | 2240 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 128 | 3,778.82 ns | 74.092 ns | 69.306 ns | 3,790.09 ns | 2.92 | 0.07 | 2.0370 | - | - | 4264 B | 1.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 256 | 2,357.15 ns | 42.713 ns | 49.189 ns | 2,345.21 ns | 1.00 | 0.00 | 2.0599 | - | - | 4312 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 256 | 3,183.61 ns | 36.248 ns | 33.906 ns | 3,179.15 ns | 1.35 | 0.03 | 1.0567 | - | - | 2216 B | 0.51 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 512 | 4,703.72 ns | 88.811 ns | 91.202 ns | 4,677.37 ns | 1.00 | 0.00 | 4.0283 | - | - | 8432 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 512 | 4,093.94 ns | 44.875 ns | 39.781 ns | 4,082.82 ns | 0.87 | 0.02 | 0.6866 | - | - | 1440 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 1024 | 9,174.73 ns | 173.419 ns | 162.216 ns | 9,171.58 ns | 1.00 | 0.00 | 7.9346 | - | - | 16648 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 1024 | 6,896.65 ns | 57.148 ns | 47.721 ns | 6,879.62 ns | 0.75 | 0.02 | 0.3815 | - | - | 800 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 2048 | 18,196.37 ns | 348.065 ns | 427.455 ns | 18,175.82 ns | 1.00 | 0.00 | 15.7471 | - | - | 33056 B | 1.00 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 2048 | 13,153.41 ns | 257.285 ns | 240.665 ns | 13,162.01 ns | 0.73 | 0.02 | 0.2289 | - | - | 480 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 4096 | 35,512.05 ns | 616.418 ns | 576.598 ns | 35,353.27 ns | 1.00 | 0.00 | 31.2500 | - | - | 65848 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 4096 | 26,149.69 ns | 291.788 ns | 243.656 ns | 26,149.77 ns | 0.74 | 0.01 | 0.1526 | - | - | 320 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 8192 | 70,448.28 ns | 1,119.298 ns | 1,046.992 ns | 70,225.56 ns | 1.00 | 0.00 | 62.5000 | - | - | 131409 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 8192 | 50,466.32 ns | 452.676 ns | 401.285 ns | 50,323.60 ns | 0.72 | 0.01 | 0.0610 | - | - | 241 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 16384 | 208,264.65 ns | 3,608.785 ns | 3,375.659 ns | 207,562.87 ns | 1.00 | 0.00 | 83.0078 | 41.5039 | 41.5039 | 262533 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 16384 | 98,150.09 ns | 770.966 ns | 643.791 ns | 97,931.35 ns | 0.47 | 0.01 | 0.1221 | - | - | 482 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 32768 | 451,749.03 ns | 4,315.140 ns | 4,036.385 ns | 452,396.39 ns | 1.00 | 0.00 | 124.5117 | 124.5117 | 124.5117 | 524756 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 32768 | 197,399.79 ns | 3,121.955 ns | 3,340.457 ns | 196,038.61 ns | 0.44 | 0.01 | 0.2441 | - | - | 538 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 65536 | 786,029.00 ns | 14,590.367 ns | 12,933.980 ns | 785,717.87 ns | 1.00 | 0.00 | 313.4766 | 249.0234 | 249.0234 | 1049210 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 65536 | 414,940.61 ns | 7,805.086 ns | 7,300.882 ns | 416,898.93 ns | 0.53 | 0.01 | - | - | - | 582 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)rable [31] | List | RecyclableLongList | 131072 | 1,572,647.55 ns | 29,371.341 ns | 30,162.205 ns | 1,570,304.49 ns | 1.00 | 0.00 | 548.8281 | 482.4219 | 482.4219 | 2097989 B | 1.000 | +| Actual | AddRa(...)rable [31] | List | RecyclableLongList | 131072 | 845,513.99 ns | 11,990.075 ns | 10,012.256 ns | 840,984.47 ns | 0.54 | 0.01 | - | - | - | 621 B | 0.000 | +
+ +# `AddRange` when Source is IList Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 +``` +
+Add Entire Collection Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|----------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | AddRa(...)IList [25] | List | Array | 0 | 11.561 ns | 0.0952 ns | 0.0890 ns | 11.533 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 0 | 9.782 ns | 0.0406 ns | 0.0360 ns | 9.774 ns | 0.85 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 1 | 30.887 ns | 0.2160 ns | 0.1915 ns | 30.816 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 1 | 16.521 ns | 0.1141 ns | 0.1011 ns | 16.478 ns | 0.53 | 0.00 | 0.0153 | - | - | 32 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 2 | 30.927 ns | 0.1817 ns | 0.1611 ns | 30.939 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 2 | 16.872 ns | 0.1693 ns | 0.1584 ns | 16.816 ns | 0.55 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 3 | 31.020 ns | 0.3183 ns | 0.2978 ns | 30.927 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 3 | 16.985 ns | 0.1386 ns | 0.1297 ns | 16.958 ns | 0.55 | 0.01 | 0.0229 | - | - | 48 B | 0.55 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 4 | 30.893 ns | 0.1192 ns | 0.1057 ns | 30.900 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 4 | 17.427 ns | 0.1497 ns | 0.1327 ns | 17.423 ns | 0.56 | 0.00 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 5 | 31.337 ns | 0.3092 ns | 0.2741 ns | 31.228 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 5 | 17.753 ns | 0.3123 ns | 0.2921 ns | 17.764 ns | 0.57 | 0.01 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 6 | 31.526 ns | 0.1789 ns | 0.1494 ns | 31.487 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 6 | 17.893 ns | 0.1490 ns | 0.1320 ns | 17.843 ns | 0.57 | 0.00 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 7 | 31.588 ns | 0.0404 ns | 0.0316 ns | 31.584 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 7 | 18.253 ns | 0.1078 ns | 0.1009 ns | 18.210 ns | 0.58 | 0.00 | 0.0382 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 8 | 31.822 ns | 0.1194 ns | 0.0997 ns | 31.807 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 8 | 18.796 ns | 0.1734 ns | 0.1537 ns | 18.760 ns | 0.59 | 0.00 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 9 | 32.727 ns | 0.1830 ns | 0.1622 ns | 32.705 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 9 | 19.057 ns | 0.0349 ns | 0.0291 ns | 19.053 ns | 0.58 | 0.00 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 10 | 32.955 ns | 0.0982 ns | 0.0918 ns | 32.977 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 10 | 19.487 ns | 0.0434 ns | 0.0406 ns | 19.481 ns | 0.59 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 11 | 33.982 ns | 0.0925 ns | 0.0820 ns | 33.960 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 11 | 20.028 ns | 0.0508 ns | 0.0451 ns | 20.036 ns | 0.59 | 0.00 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 12 | 34.230 ns | 0.1326 ns | 0.1175 ns | 34.239 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 12 | 20.367 ns | 0.0507 ns | 0.0423 ns | 20.363 ns | 0.60 | 0.00 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 13 | 34.708 ns | 0.0795 ns | 0.0705 ns | 34.702 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 13 | 20.585 ns | 0.0638 ns | 0.0533 ns | 20.605 ns | 0.59 | 0.00 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 14 | 34.910 ns | 0.2307 ns | 0.1927 ns | 34.852 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 14 | 20.834 ns | 0.1324 ns | 0.1174 ns | 20.801 ns | 0.60 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 15 | 35.028 ns | 0.2072 ns | 0.1837 ns | 34.957 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 15 | 21.328 ns | 0.1690 ns | 0.1498 ns | 21.361 ns | 0.61 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 16 | 35.412 ns | 0.3122 ns | 0.2921 ns | 35.398 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 16 | 21.820 ns | 0.2015 ns | 0.1682 ns | 21.786 ns | 0.62 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 17 | 36.019 ns | 0.1591 ns | 0.1242 ns | 36.007 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 17 | 21.641 ns | 0.0269 ns | 0.0210 ns | 21.645 ns | 0.60 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 18 | 35.666 ns | 0.1202 ns | 0.1066 ns | 35.651 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 18 | 22.160 ns | 0.0412 ns | 0.0365 ns | 22.162 ns | 0.62 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 19 | 36.616 ns | 0.1072 ns | 0.1002 ns | 36.616 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 19 | 22.770 ns | 0.0372 ns | 0.0291 ns | 22.766 ns | 0.62 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 20 | 37.018 ns | 0.1070 ns | 0.0893 ns | 37.009 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 20 | 23.053 ns | 0.0319 ns | 0.0267 ns | 23.058 ns | 0.62 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 30 | 40.198 ns | 0.0746 ns | 0.0698 ns | 40.209 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 30 | 26.306 ns | 0.0476 ns | 0.0397 ns | 26.306 ns | 0.65 | 0.00 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 32 | 41.025 ns | 0.0718 ns | 0.0560 ns | 41.034 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 32 | 27.334 ns | 0.0474 ns | 0.0443 ns | 27.329 ns | 0.67 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 36 | 49.029 ns | 0.4502 ns | 0.4211 ns | 48.973 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 36 | 33.956 ns | 0.3211 ns | 0.3003 ns | 33.924 ns | 0.69 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 37 | 49.276 ns | 0.3163 ns | 0.2469 ns | 49.330 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 37 | 35.178 ns | 0.3446 ns | 0.3055 ns | 35.098 ns | 0.71 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 40 | 50.841 ns | 0.5103 ns | 0.4524 ns | 50.682 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)IList [25] | List | Array | 40 | 50.833 ns | 0.5447 ns | 0.5095 ns | 50.910 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 40 | 36.350 ns | 0.3127 ns | 0.2772 ns | 36.325 ns | 0.72 | 0.01 | 0.1644 | - | - | 344 B | 0.91 | +| Actual | AddRa(...)IList [25] | List | Array | 40 | 35.943 ns | 0.2114 ns | 0.1978 ns | 35.984 ns | 0.71 | 0.01 | 0.1644 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 50 | 55.876 ns | 0.5287 ns | 0.4687 ns | 55.975 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 50 | 41.327 ns | 0.3464 ns | 0.3240 ns | 41.384 ns | 0.74 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 60 | 60.153 ns | 1.1107 ns | 1.0390 ns | 60.539 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 60 | 46.532 ns | 0.4100 ns | 0.3835 ns | 46.534 ns | 0.77 | 0.02 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 70 | 64.312 ns | 0.8018 ns | 0.7500 ns | 64.353 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 70 | 51.531 ns | 0.5393 ns | 0.5045 ns | 51.358 ns | 0.80 | 0.01 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 80 | 69.591 ns | 0.8384 ns | 0.7842 ns | 69.782 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 80 | 53.840 ns | 1.0982 ns | 1.3889 ns | 53.336 ns | 0.78 | 0.02 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 90 | 75.388 ns | 1.0285 ns | 0.9117 ns | 75.309 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 90 | 58.507 ns | 0.3529 ns | 0.3301 ns | 58.386 ns | 0.78 | 0.01 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 100 | 81.709 ns | 0.8223 ns | 0.7692 ns | 81.595 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 100 | 64.289 ns | 1.0734 ns | 1.0041 ns | 64.239 ns | 0.79 | 0.01 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 128 | 92.710 ns | 1.4550 ns | 1.3610 ns | 92.521 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 128 | 78.214 ns | 0.5141 ns | 0.4809 ns | 78.205 ns | 0.84 | 0.01 | 0.5009 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 256 | 158.083 ns | 2.0865 ns | 1.9517 ns | 158.151 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 256 | 138.683 ns | 1.2822 ns | 1.1366 ns | 138.785 ns | 0.88 | 0.01 | 0.9899 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 512 | 281.664 ns | 5.5848 ns | 5.7352 ns | 282.142 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 512 | 255.959 ns | 2.0557 ns | 1.7166 ns | 256.302 ns | 0.91 | 0.02 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 1024 | 549.075 ns | 10.9479 ns | 11.7141 ns | 549.289 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 1024 | 509.102 ns | 5.6384 ns | 5.2741 ns | 508.597 ns | 0.92 | 0.02 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 2048 | 1,064.091 ns | 20.2860 ns | 24.1491 ns | 1,060.544 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 2048 | 951.449 ns | 18.6972 ns | 17.4894 ns | 946.171 ns | 0.89 | 0.02 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 4096 | 2,116.288 ns | 31.3652 ns | 27.8044 ns | 2,114.965 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 4096 | 1,983.915 ns | 39.7221 ns | 37.1561 ns | 1,998.955 ns | 0.94 | 0.02 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 8192 | 3,953.464 ns | 44.5599 ns | 45.7598 ns | 3,936.942 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 8192 | 3,806.840 ns | 64.6403 ns | 53.9776 ns | 3,812.026 ns | 0.96 | 0.02 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 16384 | 65,027.839 ns | 1,313.6789 ns | 3,873.4120 ns | 65,996.844 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 16384 | 64,941.044 ns | 1,287.4233 ns | 3,755.4741 ns | 65,528.821 ns | 1.00 | 0.08 | 41.6260 | 41.6260 | 41.6260 | 131123 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 32768 | 129,345.736 ns | 2,683.2450 ns | 7,911.6083 ns | 129,610.901 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 32768 | 125,133.467 ns | 2,474.2627 ns | 5,685.0300 ns | 125,954.346 ns | 0.97 | 0.07 | 83.2520 | 83.2520 | 83.2520 | 262222 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 65536 | 124,025.820 ns | 2,445.4793 ns | 2,718.1437 ns | 123,502.734 ns | 1.00 | 0.00 | 125.2441 | 124.2676 | 124.2676 | 524893 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 65536 | 125,483.961 ns | 2,483.1422 ns | 3,140.3799 ns | 124,636.328 ns | 1.01 | 0.04 | 116.6992 | 116.4551 | 116.4551 | 524387 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 131072 | 306,819.266 ns | 6,118.1585 ns | 8,374.6044 ns | 307,005.542 ns | 1.00 | 0.00 | 191.8945 | 190.4297 | 190.4297 | 1049230 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 131072 | 309,582.061 ns | 6,102.8761 ns | 8,555.3800 ns | 308,461.304 ns | 1.01 | 0.04 | 201.6602 | 201.1719 | 201.1719 | 1048723 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | Array | 850000 | 3,451,548.203 ns | 120,204.4577 ns | 354,425.5555 ns | 3,522,158.594 ns | 1.00 | 0.00 | 171.8750 | 171.8750 | 171.8750 | 6800215 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | Array | 850000 | 3,492,861.539 ns | 87,128.2228 ns | 256,899.5307 ns | 3,480,016.016 ns | 1.02 | 0.12 | 175.7813 | 175.7813 | 175.7813 | 6800182 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 0 | 10.109 ns | 0.0399 ns | 0.0334 ns | 10.100 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 0 | 14.650 ns | 0.0529 ns | 0.0442 ns | 14.650 ns | 1.45 | 0.01 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 1 | 30.894 ns | 0.0484 ns | 0.0404 ns | 30.900 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 1 | 54.664 ns | 0.4874 ns | 0.4559 ns | 54.757 ns | 1.77 | 0.02 | 0.0267 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 2 | 31.072 ns | 0.3179 ns | 0.2818 ns | 31.117 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 2 | 54.812 ns | 0.6247 ns | 0.5844 ns | 54.656 ns | 1.76 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 3 | 31.067 ns | 0.1880 ns | 0.1468 ns | 31.092 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 3 | 55.097 ns | 0.3519 ns | 0.3119 ns | 55.057 ns | 1.77 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 4 | 30.937 ns | 0.2062 ns | 0.1722 ns | 30.972 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 4 | 53.967 ns | 0.5870 ns | 0.5204 ns | 53.788 ns | 1.74 | 0.02 | 0.0267 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 5 | 31.492 ns | 0.2808 ns | 0.2626 ns | 31.462 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 5 | 55.160 ns | 0.6057 ns | 0.5665 ns | 55.190 ns | 1.75 | 0.02 | 0.0267 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 6 | 31.581 ns | 0.2464 ns | 0.2185 ns | 31.486 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 6 | 55.440 ns | 0.9516 ns | 0.8901 ns | 55.658 ns | 1.75 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 7 | 31.885 ns | 0.1909 ns | 0.1692 ns | 31.807 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 7 | 53.472 ns | 0.5804 ns | 0.5145 ns | 53.528 ns | 1.68 | 0.02 | 0.0267 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 8 | 31.843 ns | 0.1115 ns | 0.0988 ns | 31.852 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 8 | 54.059 ns | 0.5702 ns | 0.5333 ns | 54.221 ns | 1.70 | 0.02 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 9 | 32.882 ns | 0.2576 ns | 0.2284 ns | 32.841 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 9 | 56.155 ns | 0.8924 ns | 0.8347 ns | 56.340 ns | 1.71 | 0.03 | 0.0267 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 10 | 33.201 ns | 0.3842 ns | 0.3594 ns | 33.010 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 10 | 57.274 ns | 0.8838 ns | 0.8267 ns | 57.432 ns | 1.73 | 0.04 | 0.0267 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 11 | 34.248 ns | 0.4626 ns | 0.4327 ns | 34.008 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 11 | 56.770 ns | 0.6994 ns | 0.6542 ns | 56.878 ns | 1.66 | 0.02 | 0.0267 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 12 | 34.345 ns | 0.1920 ns | 0.1702 ns | 34.262 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 12 | 56.465 ns | 0.7831 ns | 0.7325 ns | 56.272 ns | 1.65 | 0.02 | 0.0267 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 13 | 34.667 ns | 0.2287 ns | 0.2139 ns | 34.596 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 13 | 57.184 ns | 0.5465 ns | 0.4844 ns | 57.189 ns | 1.65 | 0.01 | 0.0267 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 14 | 35.081 ns | 0.1810 ns | 0.1693 ns | 35.067 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 14 | 56.229 ns | 0.5598 ns | 0.5237 ns | 56.276 ns | 1.60 | 0.01 | 0.0267 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 15 | 35.284 ns | 0.0622 ns | 0.0519 ns | 35.263 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 15 | 56.588 ns | 0.8965 ns | 0.8386 ns | 56.413 ns | 1.61 | 0.02 | 0.0267 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 16 | 35.556 ns | 0.1859 ns | 0.1648 ns | 35.519 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 16 | 56.044 ns | 0.6294 ns | 0.5888 ns | 56.125 ns | 1.58 | 0.02 | 0.0267 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 17 | 35.601 ns | 0.0829 ns | 0.0735 ns | 35.607 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 17 | 56.008 ns | 0.6647 ns | 0.6218 ns | 55.821 ns | 1.57 | 0.02 | 0.0267 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 18 | 35.894 ns | 0.3423 ns | 0.3034 ns | 35.740 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 18 | 56.599 ns | 0.6876 ns | 0.6096 ns | 56.450 ns | 1.58 | 0.02 | 0.0267 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 19 | 36.732 ns | 0.1739 ns | 0.1452 ns | 36.684 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 19 | 73.265 ns | 0.3722 ns | 0.3299 ns | 73.190 ns | 1.99 | 0.01 | 0.0267 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 20 | 37.093 ns | 0.2831 ns | 0.2510 ns | 36.971 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 20 | 58.017 ns | 0.4944 ns | 0.4129 ns | 58.121 ns | 1.56 | 0.02 | 0.0267 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 30 | 40.556 ns | 0.2538 ns | 0.2374 ns | 40.508 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 30 | 58.084 ns | 0.7491 ns | 0.6640 ns | 57.896 ns | 1.43 | 0.02 | 0.0267 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 32 | 41.118 ns | 0.2689 ns | 0.2515 ns | 41.099 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 32 | 57.374 ns | 1.1336 ns | 1.0604 ns | 57.057 ns | 1.40 | 0.03 | 0.0267 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 36 | 48.473 ns | 0.4292 ns | 0.4015 ns | 48.396 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 36 | 62.450 ns | 0.2505 ns | 0.2220 ns | 62.433 ns | 1.29 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 37 | 49.121 ns | 0.4816 ns | 0.4269 ns | 49.022 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 37 | 61.496 ns | 1.1423 ns | 1.0685 ns | 61.561 ns | 1.25 | 0.02 | 0.0267 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 40 | 50.690 ns | 0.5339 ns | 0.4733 ns | 50.603 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)IList [25] | List | PooledList | 40 | 51.017 ns | 0.4182 ns | 0.3912 ns | 50.976 ns | 1.01 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 40 | 60.131 ns | 0.6523 ns | 0.5783 ns | 60.192 ns | 1.19 | 0.02 | 0.0267 | - | - | 56 B | 0.15 | +| Actual | AddRa(...)IList [25] | List | PooledList | 40 | 60.715 ns | 0.5925 ns | 0.5542 ns | 60.921 ns | 1.20 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 50 | 55.576 ns | 0.3552 ns | 0.3149 ns | 55.557 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 50 | 64.926 ns | 0.7339 ns | 0.6865 ns | 64.989 ns | 1.17 | 0.01 | 0.0267 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 60 | 59.674 ns | 0.9602 ns | 0.8512 ns | 59.822 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 60 | 63.438 ns | 0.7619 ns | 0.7127 ns | 63.402 ns | 1.06 | 0.02 | 0.0267 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 70 | 66.442 ns | 1.1041 ns | 1.0328 ns | 66.359 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 70 | 66.461 ns | 0.7842 ns | 0.7335 ns | 66.596 ns | 1.00 | 0.02 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 80 | 70.782 ns | 0.8726 ns | 0.8162 ns | 70.860 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 80 | 66.146 ns | 0.2943 ns | 0.2457 ns | 66.140 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 850000 | 2,520,368.112 ns | 23,734.4002 ns | 22,201.1726 ns | 2,516,511.133 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 850000 | 1,455,313.070 ns | 5,962.7425 ns | 4,655.3171 ns | 1,453,272.168 ns | 0.58 | 0.01 | - | - | - | 82 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 90 | 76.598 ns | 1.2409 ns | 1.1000 ns | 76.878 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 90 | 66.730 ns | 0.3418 ns | 0.3030 ns | 66.654 ns | 0.87 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 100 | 80.429 ns | 0.9076 ns | 0.8490 ns | 80.258 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 100 | 66.371 ns | 0.9463 ns | 0.7902 ns | 66.440 ns | 0.82 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 128 | 93.337 ns | 1.4172 ns | 1.3256 ns | 93.539 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 128 | 66.341 ns | 0.6787 ns | 0.6349 ns | 66.462 ns | 0.71 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 256 | 156.577 ns | 2.2610 ns | 2.1149 ns | 156.954 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 256 | 77.210 ns | 1.0303 ns | 0.9638 ns | 77.487 ns | 0.49 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 512 | 285.824 ns | 5.7056 ns | 5.8592 ns | 285.271 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | PooledList | 512 | 94.687 ns | 1.6892 ns | 1.5801 ns | 94.770 ns | 0.33 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 1024 | 547.219 ns | 10.7280 ns | 13.1750 ns | 543.768 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 1024 | 125.771 ns | 0.9057 ns | 0.8472 ns | 125.709 ns | 0.23 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 2048 | 1,079.753 ns | 19.7248 ns | 18.4506 ns | 1,078.116 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 2048 | 244.736 ns | 0.3130 ns | 0.2775 ns | 244.771 ns | 0.23 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 4096 | 2,083.964 ns | 39.0491 ns | 36.5266 ns | 2,071.794 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 4096 | 599.418 ns | 2.8731 ns | 2.6875 ns | 597.939 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 8192 | 3,974.473 ns | 74.3755 ns | 65.9319 ns | 3,952.464 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 8192 | 1,150.329 ns | 5.4272 ns | 5.0766 ns | 1,148.314 ns | 0.29 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 16384 | 64,586.399 ns | 1,285.7132 ns | 2,383.1518 ns | 64,706.549 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131154 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 16384 | 2,227.499 ns | 3.7093 ns | 3.2882 ns | 2,228.010 ns | 0.03 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 32768 | 127,391.077 ns | 2,578.4185 ns | 7,602.5250 ns | 129,305.945 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 32768 | 4,719.842 ns | 12.0225 ns | 10.6576 ns | 4,719.759 ns | 0.04 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 65536 | 129,773.814 ns | 2,523.2607 ns | 3,098.7908 ns | 130,421.252 ns | 1.00 | 0.00 | 112.0605 | 111.0840 | 111.0840 | 525042 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 65536 | 10,743.036 ns | 17.4562 ns | 15.4745 ns | 10,741.354 ns | 0.08 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | PooledList | 131072 | 379,768.488 ns | 7,466.2023 ns | 10,466.5729 ns | 381,160.303 ns | 1.00 | 0.00 | 168.9453 | 167.9688 | 167.9688 | 1049081 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | PooledList | 131072 | 22,723.708 ns | 132.3462 ns | 123.7967 ns | 22,677.478 ns | 0.06 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 0 | 10.556 ns | 0.1377 ns | 0.1221 ns | 10.593 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 0 | 22.582 ns | 0.2576 ns | 0.2151 ns | 22.525 ns | 2.14 | 0.04 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 1 | 30.934 ns | 0.1036 ns | 0.0865 ns | 30.906 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 1 | 31.276 ns | 0.1281 ns | 0.1136 ns | 31.263 ns | 1.01 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 2 | 31.017 ns | 0.1996 ns | 0.1867 ns | 30.917 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 2 | 31.332 ns | 0.3444 ns | 0.3222 ns | 31.199 ns | 1.01 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 3 | 30.975 ns | 0.1415 ns | 0.1324 ns | 30.976 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 3 | 31.215 ns | 0.2941 ns | 0.2607 ns | 31.289 ns | 1.01 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 4 | 30.572 ns | 0.1119 ns | 0.1047 ns | 30.568 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 4 | 31.021 ns | 0.3081 ns | 0.2882 ns | 30.868 ns | 1.01 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 5 | 31.091 ns | 0.1006 ns | 0.0892 ns | 31.070 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 5 | 43.284 ns | 0.4728 ns | 0.4423 ns | 43.043 ns | 1.39 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 6 | 31.501 ns | 0.0543 ns | 0.0508 ns | 31.509 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 6 | 42.989 ns | 0.1585 ns | 0.1237 ns | 42.950 ns | 1.36 | 0.00 | 0.0918 | - | - | 192 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 7 | 31.793 ns | 0.2292 ns | 0.2144 ns | 31.732 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 7 | 43.253 ns | 0.2087 ns | 0.1743 ns | 43.267 ns | 1.36 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 8 | 32.056 ns | 0.2277 ns | 0.2130 ns | 32.007 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 8 | 42.991 ns | 0.2103 ns | 0.1756 ns | 42.948 ns | 1.34 | 0.01 | 0.0918 | - | - | 192 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 9 | 32.645 ns | 0.2217 ns | 0.2074 ns | 32.605 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 9 | 46.822 ns | 0.8454 ns | 0.7908 ns | 46.790 ns | 1.43 | 0.03 | 0.1224 | - | - | 256 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 10 | 32.990 ns | 0.3022 ns | 0.2827 ns | 32.853 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 10 | 47.038 ns | 0.6039 ns | 0.5354 ns | 47.053 ns | 1.43 | 0.01 | 0.1224 | - | - | 256 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 11 | 33.714 ns | 0.0654 ns | 0.0511 ns | 33.729 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 11 | 46.832 ns | 0.3533 ns | 0.3132 ns | 46.754 ns | 1.39 | 0.01 | 0.1224 | - | - | 256 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 12 | 33.891 ns | 0.1144 ns | 0.0893 ns | 33.890 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 12 | 46.540 ns | 0.4162 ns | 0.3689 ns | 46.369 ns | 1.37 | 0.01 | 0.1224 | - | - | 256 B | 1.68 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 13 | 34.447 ns | 0.1012 ns | 0.0845 ns | 34.408 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 13 | 46.713 ns | 0.4259 ns | 0.3776 ns | 46.567 ns | 1.36 | 0.01 | 0.1224 | - | - | 256 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 14 | 34.855 ns | 0.1577 ns | 0.1317 ns | 34.821 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 14 | 46.945 ns | 0.2243 ns | 0.1988 ns | 46.972 ns | 1.35 | 0.01 | 0.1224 | - | - | 256 B | 1.52 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 15 | 34.923 ns | 0.1695 ns | 0.1502 ns | 34.860 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 15 | 46.334 ns | 0.3718 ns | 0.3478 ns | 46.237 ns | 1.33 | 0.01 | 0.1224 | - | - | 256 B | 1.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 16 | 35.087 ns | 0.1825 ns | 0.1707 ns | 35.114 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 16 | 46.055 ns | 0.2463 ns | 0.2183 ns | 46.020 ns | 1.31 | 0.01 | 0.1224 | - | - | 256 B | 1.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 17 | 35.473 ns | 0.1741 ns | 0.1359 ns | 35.410 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 17 | 51.173 ns | 0.4867 ns | 0.4064 ns | 50.947 ns | 1.44 | 0.01 | 0.1836 | - | - | 384 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 18 | 35.428 ns | 0.0679 ns | 0.0567 ns | 35.428 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 18 | 50.516 ns | 0.4454 ns | 0.4167 ns | 50.472 ns | 1.43 | 0.01 | 0.1836 | - | - | 384 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 19 | 36.520 ns | 0.2362 ns | 0.2209 ns | 36.435 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 19 | 51.992 ns | 0.5031 ns | 0.4460 ns | 52.101 ns | 1.42 | 0.01 | 0.1836 | - | - | 384 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 20 | 37.032 ns | 0.1528 ns | 0.1354 ns | 37.002 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 20 | 52.423 ns | 0.4830 ns | 0.4282 ns | 52.431 ns | 1.42 | 0.01 | 0.1836 | - | - | 384 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 30 | 40.212 ns | 0.0826 ns | 0.0690 ns | 40.241 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 30 | 53.643 ns | 0.8850 ns | 0.8278 ns | 53.834 ns | 1.34 | 0.02 | 0.1836 | - | - | 384 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 32 | 40.597 ns | 0.2112 ns | 0.1872 ns | 40.583 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 32 | 51.593 ns | 0.8684 ns | 0.8123 ns | 51.203 ns | 1.27 | 0.02 | 0.1836 | - | - | 384 B | 1.23 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 36 | 49.492 ns | 0.3177 ns | 0.2972 ns | 49.488 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 36 | 69.912 ns | 0.5021 ns | 0.4193 ns | 69.921 ns | 1.41 | 0.01 | 0.0650 | - | - | 136 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 37 | 49.991 ns | 0.3507 ns | 0.3281 ns | 49.943 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 37 | 61.196 ns | 0.7443 ns | 0.6216 ns | 61.256 ns | 1.22 | 0.01 | 0.0650 | - | - | 136 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 40 | 50.410 ns | 0.5518 ns | 0.5162 ns | 50.364 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 40 | 50.093 ns | 0.4844 ns | 0.4294 ns | 50.112 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 40 | 66.396 ns | 0.6599 ns | 0.5850 ns | 66.354 ns | 1.32 | 0.02 | 0.0650 | - | - | 136 B | 0.36 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 40 | 64.040 ns | 1.2770 ns | 1.1945 ns | 64.447 ns | 1.27 | 0.03 | 0.0650 | - | - | 136 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 50 | 54.756 ns | 0.4812 ns | 0.4266 ns | 54.702 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 50 | 65.578 ns | 1.2450 ns | 1.1645 ns | 65.451 ns | 1.20 | 0.02 | 0.0650 | - | - | 136 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 60 | 58.328 ns | 0.2445 ns | 0.2287 ns | 58.339 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 60 | 68.801 ns | 0.3399 ns | 0.3013 ns | 68.802 ns | 1.18 | 0.00 | 0.0650 | - | - | 136 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 70 | 64.164 ns | 0.9150 ns | 0.8558 ns | 64.039 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 70 | 63.476 ns | 0.7882 ns | 0.7373 ns | 63.472 ns | 0.99 | 0.02 | 0.0650 | - | - | 136 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 80 | 68.632 ns | 1.0906 ns | 1.0202 ns | 68.545 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 80 | 68.444 ns | 1.0898 ns | 0.9661 ns | 68.687 ns | 1.00 | 0.02 | 0.0650 | - | - | 136 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 90 | 73.865 ns | 1.0296 ns | 0.9631 ns | 74.175 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 90 | 62.814 ns | 0.7448 ns | 0.6602 ns | 62.828 ns | 0.85 | 0.02 | 0.0650 | - | - | 136 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 100 | 78.313 ns | 1.5455 ns | 1.4456 ns | 78.142 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 100 | 66.653 ns | 0.9742 ns | 0.9113 ns | 66.687 ns | 0.85 | 0.02 | 0.0650 | - | - | 136 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 128 | 99.120 ns | 1.1909 ns | 0.9944 ns | 99.276 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 128 | 65.425 ns | 0.6866 ns | 0.6087 ns | 65.417 ns | 0.66 | 0.01 | 0.0650 | - | - | 136 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 256 | 157.757 ns | 2.7300 ns | 2.4201 ns | 157.605 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 256 | 74.849 ns | 0.2300 ns | 0.1920 ns | 74.830 ns | 0.47 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 512 | 287.147 ns | 5.5596 ns | 5.4603 ns | 286.818 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 512 | 102.657 ns | 0.7090 ns | 0.6632 ns | 102.494 ns | 0.36 | 0.01 | 0.0650 | - | - | 136 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 1024 | 544.297 ns | 10.7342 ns | 12.3616 ns | 541.139 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 1024 | 126.693 ns | 0.7221 ns | 0.6401 ns | 126.689 ns | 0.23 | 0.00 | 0.0648 | - | - | 136 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 2048 | 1,060.795 ns | 18.7660 ns | 15.6705 ns | 1,062.407 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 2048 | 241.718 ns | 1.6162 ns | 1.3496 ns | 241.483 ns | 0.23 | 0.00 | 0.0648 | - | - | 136 B | 0.008 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 4096 | 2,175.340 ns | 42.9639 ns | 40.1885 ns | 2,176.568 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 4096 | 606.627 ns | 0.7069 ns | 0.6266 ns | 606.803 ns | 0.28 | 0.00 | 0.0648 | - | - | 136 B | 0.004 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 8192 | 4,017.371 ns | 57.7421 ns | 54.0120 ns | 3,991.319 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 8192 | 1,139.919 ns | 2.6974 ns | 2.3912 ns | 1,139.340 ns | 0.28 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 16384 | 63,974.696 ns | 1,266.8082 ns | 2,379.3728 ns | 63,946.506 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 16384 | 2,214.292 ns | 5.7931 ns | 5.1354 ns | 2,212.453 ns | 0.03 | 0.00 | 0.0648 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 32768 | 126,119.643 ns | 2,489.7550 ns | 5,568.6938 ns | 126,839.966 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 32768 | 4,747.791 ns | 18.1336 ns | 16.0750 ns | 4,752.184 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 65536 | 125,046.032 ns | 1,903.5659 ns | 1,780.5967 ns | 124,956.787 ns | 1.00 | 0.00 | 121.8262 | 120.8496 | 120.8496 | 525089 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 65536 | 10,783.095 ns | 53.1563 ns | 49.7224 ns | 10,763.589 ns | 0.09 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 131072 | 454,041.977 ns | 35,108.3205 ns | 103,517.6751 ns | 394,892.920 ns | 1.00 | 0.00 | 165.0391 | 164.0625 | 164.0625 | 1048894 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 131072 | 22,479.243 ns | 28.8111 ns | 25.5403 ns | 22,477.042 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableList | 850000 | 2,506,399.051 ns | 16,140.5016 ns | 14,308.1343 ns | 2,510,799.805 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableList | 850000 | 1,458,663.991 ns | 20,268.5738 ns | 18,959.2365 ns | 1,463,663.770 ns | 0.58 | 0.01 | - | - | - | 161 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 0 | 11.427 ns | 0.1625 ns | 0.1520 ns | 11.341 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 0 | 21.876 ns | 0.3315 ns | 0.3101 ns | 21.825 ns | 1.91 | 0.04 | 0.0421 | - | - | 88 B | 2.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 1 | 30.961 ns | 0.2584 ns | 0.2291 ns | 30.885 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 1 | 96.964 ns | 1.6963 ns | 1.5867 ns | 97.019 ns | 3.13 | 0.06 | 0.0880 | - | - | 184 B | 2.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 2 | 30.974 ns | 0.3002 ns | 0.2808 ns | 30.904 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 2 | 98.452 ns | 0.8725 ns | 0.7735 ns | 98.493 ns | 3.18 | 0.04 | 0.0956 | - | - | 200 B | 2.27 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 3 | 30.894 ns | 0.2017 ns | 0.1788 ns | 30.814 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 3 | 101.677 ns | 1.3753 ns | 1.2192 ns | 101.755 ns | 3.29 | 0.04 | 0.1070 | - | - | 224 B | 2.55 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 4 | 30.737 ns | 0.3144 ns | 0.2787 ns | 30.655 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 4 | 98.949 ns | 0.9144 ns | 0.8106 ns | 98.782 ns | 3.22 | 0.03 | 0.1109 | - | - | 232 B | 2.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 5 | 31.461 ns | 0.3613 ns | 0.3380 ns | 31.286 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 5 | 104.993 ns | 1.6420 ns | 1.5359 ns | 105.024 ns | 3.34 | 0.06 | 0.1301 | - | - | 272 B | 2.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 6 | 31.591 ns | 0.1534 ns | 0.1360 ns | 31.523 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 6 | 103.441 ns | 1.8832 ns | 1.6694 ns | 103.637 ns | 3.27 | 0.06 | 0.1339 | - | - | 280 B | 2.69 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 7 | 31.676 ns | 0.1623 ns | 0.1438 ns | 31.614 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 7 | 101.432 ns | 1.7286 ns | 1.5324 ns | 101.809 ns | 3.20 | 0.04 | 0.1377 | - | - | 288 B | 2.57 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 8 | 31.728 ns | 0.0741 ns | 0.0619 ns | 31.723 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 8 | 100.853 ns | 1.5857 ns | 1.4832 ns | 101.192 ns | 3.17 | 0.05 | 0.1415 | - | - | 296 B | 2.47 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 9 | 32.739 ns | 0.1926 ns | 0.1608 ns | 32.682 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 9 | 109.329 ns | 0.9654 ns | 0.9030 ns | 109.145 ns | 3.34 | 0.03 | 0.1760 | - | - | 368 B | 2.88 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 10 | 33.114 ns | 0.0566 ns | 0.0473 ns | 33.117 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 10 | 107.779 ns | 1.1626 ns | 1.0875 ns | 107.968 ns | 3.26 | 0.04 | 0.1798 | - | - | 376 B | 2.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 11 | 34.027 ns | 0.1806 ns | 0.1601 ns | 33.962 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 11 | 112.670 ns | 1.6568 ns | 1.5497 ns | 112.423 ns | 3.31 | 0.05 | 0.1836 | - | - | 384 B | 2.67 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 12 | 34.148 ns | 0.0747 ns | 0.0662 ns | 34.133 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 12 | 112.535 ns | 1.3192 ns | 1.2340 ns | 112.265 ns | 3.29 | 0.03 | 0.1874 | - | - | 392 B | 2.58 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 13 | 34.603 ns | 0.0550 ns | 0.0459 ns | 34.588 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 13 | 113.749 ns | 0.6956 ns | 0.6506 ns | 113.741 ns | 3.29 | 0.02 | 0.1912 | - | - | 400 B | 2.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 14 | 34.777 ns | 0.0593 ns | 0.0495 ns | 34.791 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 14 | 111.589 ns | 1.1807 ns | 0.9859 ns | 111.716 ns | 3.21 | 0.03 | 0.1950 | - | - | 408 B | 2.43 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 15 | 34.990 ns | 0.1500 ns | 0.1329 ns | 34.952 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 15 | 110.815 ns | 0.7695 ns | 0.6821 ns | 110.906 ns | 3.17 | 0.02 | 0.1988 | - | - | 416 B | 2.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 16 | 35.001 ns | 0.1396 ns | 0.1237 ns | 35.032 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 16 | 106.799 ns | 1.4223 ns | 1.2608 ns | 107.128 ns | 3.05 | 0.03 | 0.2027 | - | - | 424 B | 2.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 17 | 35.472 ns | 0.2175 ns | 0.1928 ns | 35.407 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 17 | 113.563 ns | 0.5820 ns | 0.5444 ns | 113.264 ns | 3.20 | 0.02 | 0.2677 | - | - | 560 B | 2.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 18 | 35.767 ns | 0.2285 ns | 0.2138 ns | 35.699 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 18 | 113.764 ns | 0.8705 ns | 0.6796 ns | 113.648 ns | 3.18 | 0.03 | 0.2716 | - | - | 568 B | 2.84 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 19 | 36.833 ns | 0.2695 ns | 0.2521 ns | 36.687 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 19 | 118.829 ns | 1.3396 ns | 1.2531 ns | 118.823 ns | 3.23 | 0.04 | 0.2754 | - | - | 576 B | 2.77 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 20 | 36.942 ns | 0.2047 ns | 0.1815 ns | 36.858 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 20 | 118.490 ns | 2.1452 ns | 2.0066 ns | 118.753 ns | 3.21 | 0.06 | 0.2792 | - | - | 584 B | 2.70 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 30 | 40.281 ns | 0.1968 ns | 0.1643 ns | 40.215 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 30 | 121.877 ns | 1.3765 ns | 1.2876 ns | 121.663 ns | 3.02 | 0.04 | 0.3173 | - | - | 664 B | 2.24 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 32 | 41.229 ns | 0.2518 ns | 0.2103 ns | 41.236 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 32 | 120.601 ns | 2.1520 ns | 2.0130 ns | 120.556 ns | 2.93 | 0.05 | 0.3250 | - | - | 680 B | 2.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 36 | 49.076 ns | 0.7010 ns | 0.6557 ns | 48.805 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 36 | 137.030 ns | 2.0529 ns | 1.9203 ns | 136.662 ns | 2.79 | 0.05 | 0.2217 | - | - | 464 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 37 | 49.921 ns | 0.4713 ns | 0.4409 ns | 49.888 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 37 | 137.923 ns | 1.5966 ns | 1.4153 ns | 137.730 ns | 2.76 | 0.04 | 0.0880 | - | - | 184 B | 0.52 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 50.882 ns | 0.5683 ns | 0.5316 ns | 50.818 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 50.127 ns | 0.3722 ns | 0.3300 ns | 50.155 ns | 0.98 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 136.375 ns | 1.9591 ns | 1.8325 ns | 136.078 ns | 2.68 | 0.05 | 0.0880 | - | - | 184 B | 0.49 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 40 | 137.301 ns | 1.8969 ns | 1.6815 ns | 137.890 ns | 2.70 | 0.06 | 0.0880 | - | - | 184 B | 0.49 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 50 | 55.534 ns | 0.5898 ns | 0.5229 ns | 55.535 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 50 | 148.491 ns | 1.1530 ns | 1.0221 ns | 148.421 ns | 2.67 | 0.03 | 0.0880 | - | - | 184 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 60 | 59.640 ns | 1.2013 ns | 1.3834 ns | 58.841 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 60 | 140.369 ns | 0.9340 ns | 0.8737 ns | 140.442 ns | 2.34 | 0.06 | 0.0880 | - | - | 184 B | 0.34 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 70 | 64.660 ns | 0.9782 ns | 0.8672 ns | 64.609 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 70 | 150.759 ns | 1.6271 ns | 1.4424 ns | 150.359 ns | 2.33 | 0.04 | 0.0880 | - | - | 184 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 80 | 70.355 ns | 0.9071 ns | 0.8041 ns | 70.180 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 80 | 147.871 ns | 1.4497 ns | 1.2851 ns | 147.876 ns | 2.10 | 0.03 | 0.0880 | - | - | 184 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 850000 | 3,384,784.004 ns | 72,885.3393 ns | 212,609.9557 ns | 3,406,206.836 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800219 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 850000 | 2,899,466.155 ns | 10,038.6035 ns | 8,898.9605 ns | 2,900,662.695 ns | 0.93 | 0.08 | - | - | - | 514 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 90 | 74.707 ns | 1.2513 ns | 1.1705 ns | 74.637 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 90 | 148.435 ns | 1.2341 ns | 1.0940 ns | 148.388 ns | 1.99 | 0.03 | 0.0880 | - | - | 184 B | 0.24 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 100 | 81.646 ns | 1.2866 ns | 1.2035 ns | 81.741 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 100 | 151.587 ns | 1.5725 ns | 1.3940 ns | 151.394 ns | 1.86 | 0.03 | 0.0880 | - | - | 184 B | 0.21 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 128 | 93.299 ns | 1.3477 ns | 1.1254 ns | 93.623 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 128 | 163.134 ns | 0.9073 ns | 0.8487 ns | 163.007 ns | 1.75 | 0.02 | 0.0880 | - | - | 184 B | 0.17 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 256 | 157.157 ns | 2.3804 ns | 2.2267 ns | 156.437 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 256 | 175.526 ns | 1.1563 ns | 1.0816 ns | 175.576 ns | 1.12 | 0.02 | 0.0880 | - | - | 184 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 512 | 283.826 ns | 4.8978 ns | 4.5814 ns | 283.468 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 512 | 203.324 ns | 1.8002 ns | 1.6839 ns | 203.104 ns | 0.72 | 0.01 | 0.0880 | - | - | 184 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 1024 | 534.657 ns | 10.7360 ns | 13.1847 ns | 532.521 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 1024 | 292.517 ns | 1.8817 ns | 1.7602 ns | 292.501 ns | 0.55 | 0.01 | 0.0877 | - | - | 184 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 2048 | 1,077.110 ns | 20.5871 ns | 39.1690 ns | 1,067.488 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 2048 | 637.152 ns | 4.2153 ns | 3.9430 ns | 638.531 ns | 0.58 | 0.03 | 0.0877 | - | - | 184 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 4096 | 2,098.656 ns | 41.6158 ns | 54.1123 ns | 2,101.329 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 4096 | 1,190.662 ns | 2.3803 ns | 2.2265 ns | 1,190.206 ns | 0.57 | 0.02 | 0.0877 | - | - | 184 B | 0.006 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 8192 | 3,922.221 ns | 29.2421 ns | 27.3530 ns | 3,918.271 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 8192 | 2,273.528 ns | 3.0178 ns | 2.3561 ns | 2,273.366 ns | 0.58 | 0.00 | 0.0877 | - | - | 184 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 16384 | 64,771.845 ns | 1,295.0230 ns | 3,715.6637 ns | 64,796.143 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 16384 | 4,708.604 ns | 6.5462 ns | 6.1233 ns | 4,708.671 ns | 0.07 | 0.00 | 0.2213 | - | - | 464 B | 0.004 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 32768 | 126,789.227 ns | 2,532.3679 ns | 5,919.3283 ns | 128,485.181 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 32768 | 10,899.942 ns | 68.4004 ns | 63.9817 ns | 10,907.268 ns | 0.09 | 0.00 | 0.2136 | - | - | 464 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 65536 | 125,077.772 ns | 2,406.0231 ns | 3,211.9718 ns | 125,489.795 ns | 1.00 | 0.00 | 119.6289 | 118.6523 | 118.6523 | 525043 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 65536 | 22,357.269 ns | 136.9451 ns | 121.3983 ns | 22,328.387 ns | 0.18 | 0.01 | 0.2136 | - | - | 464 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)IList [25] | List | RecyclableLongList | 131072 | 312,634.663 ns | 6,159.5050 ns | 9,219.2571 ns | 311,814.404 ns | 1.00 | 0.00 | 194.8242 | 193.3594 | 193.3594 | 1049261 B | 1.000 | +| Actual | AddRa(...)IList [25] | List | RecyclableLongList | 131072 | 45,652.759 ns | 488.1634 ns | 432.7441 ns | 45,733.435 ns | 0.15 | 0.01 | 0.1831 | - | - | 464 B | 0.000 | +
+ +# `AddRange` when Source is List Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 +``` +
+Add Entire Collection Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|-----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | AddRa(...)sList [24] | List | Array | 0 | 10.900 ns | 0.1637 ns | 0.1451 ns | 10.869 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 0 | 10.968 ns | 0.0896 ns | 0.0838 ns | 10.963 ns | 1.01 | 0.01 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 1 | 24.776 ns | 0.3375 ns | 0.3157 ns | 24.744 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 1 | 10.720 ns | 0.1142 ns | 0.1068 ns | 10.690 ns | 0.43 | 0.01 | 0.0153 | - | - | 32 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 2 | 24.820 ns | 0.2216 ns | 0.2073 ns | 24.850 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 2 | 11.004 ns | 0.1534 ns | 0.1435 ns | 10.927 ns | 0.44 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 3 | 24.797 ns | 0.2301 ns | 0.2153 ns | 24.798 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 3 | 11.281 ns | 0.0378 ns | 0.0295 ns | 11.265 ns | 0.45 | 0.00 | 0.0229 | - | - | 48 B | 0.55 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 4 | 24.881 ns | 0.4802 ns | 0.4492 ns | 24.665 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 4 | 11.620 ns | 0.1667 ns | 0.1477 ns | 11.540 ns | 0.47 | 0.01 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 5 | 24.991 ns | 0.2176 ns | 0.1929 ns | 24.877 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 5 | 12.074 ns | 0.0889 ns | 0.0832 ns | 12.042 ns | 0.48 | 0.00 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 6 | 25.414 ns | 0.2014 ns | 0.1883 ns | 25.424 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 6 | 12.309 ns | 0.1137 ns | 0.1064 ns | 12.321 ns | 0.48 | 0.01 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 7 | 25.685 ns | 0.1566 ns | 0.1464 ns | 25.675 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 7 | 12.817 ns | 0.1075 ns | 0.1005 ns | 12.758 ns | 0.50 | 0.00 | 0.0383 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 8 | 26.081 ns | 0.1935 ns | 0.1715 ns | 26.036 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 8 | 13.311 ns | 0.1073 ns | 0.0951 ns | 13.279 ns | 0.51 | 0.01 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 9 | 26.749 ns | 0.1829 ns | 0.1711 ns | 26.697 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 9 | 13.823 ns | 0.2158 ns | 0.2018 ns | 13.693 ns | 0.52 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 10 | 27.004 ns | 0.2930 ns | 0.2598 ns | 26.927 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 10 | 13.900 ns | 0.0288 ns | 0.0240 ns | 13.894 ns | 0.51 | 0.01 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 11 | 28.021 ns | 0.2473 ns | 0.2065 ns | 28.072 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 11 | 14.630 ns | 0.2856 ns | 0.2532 ns | 14.500 ns | 0.52 | 0.01 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 12 | 29.109 ns | 0.5562 ns | 0.4930 ns | 28.914 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 12 | 14.959 ns | 0.1591 ns | 0.1488 ns | 14.876 ns | 0.51 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 13 | 28.415 ns | 0.1495 ns | 0.1167 ns | 28.413 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 13 | 15.367 ns | 0.1841 ns | 0.1722 ns | 15.325 ns | 0.54 | 0.01 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 14 | 28.838 ns | 0.2783 ns | 0.2467 ns | 28.762 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 14 | 15.743 ns | 0.1311 ns | 0.1227 ns | 15.689 ns | 0.55 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 15 | 29.148 ns | 0.3040 ns | 0.2843 ns | 29.188 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 15 | 15.762 ns | 0.0467 ns | 0.0390 ns | 15.751 ns | 0.54 | 0.01 | 0.0688 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 16 | 29.303 ns | 0.2234 ns | 0.1980 ns | 29.215 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 16 | 15.998 ns | 0.0984 ns | 0.0873 ns | 15.974 ns | 0.55 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 17 | 29.777 ns | 0.2377 ns | 0.2107 ns | 29.697 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 17 | 16.300 ns | 0.0523 ns | 0.0408 ns | 16.297 ns | 0.55 | 0.00 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 18 | 29.881 ns | 0.0712 ns | 0.0556 ns | 29.870 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 18 | 16.796 ns | 0.1546 ns | 0.1446 ns | 16.774 ns | 0.56 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 19 | 31.346 ns | 0.5159 ns | 0.4826 ns | 31.106 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 19 | 17.671 ns | 0.3829 ns | 0.6604 ns | 17.375 ns | 0.56 | 0.03 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 20 | 31.779 ns | 0.1795 ns | 0.1591 ns | 31.738 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 20 | 17.441 ns | 0.0667 ns | 0.0557 ns | 17.426 ns | 0.55 | 0.00 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 30 | 35.182 ns | 0.1529 ns | 0.1355 ns | 35.230 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 30 | 20.737 ns | 0.1967 ns | 0.1840 ns | 20.694 ns | 0.59 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 32 | 35.490 ns | 0.1190 ns | 0.0994 ns | 35.477 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 32 | 21.302 ns | 0.0753 ns | 0.0629 ns | 21.285 ns | 0.60 | 0.00 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 36 | 37.510 ns | 0.5145 ns | 0.4296 ns | 37.403 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 36 | 22.597 ns | 0.1680 ns | 0.1572 ns | 22.542 ns | 0.60 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 37 | 37.301 ns | 0.3142 ns | 0.2785 ns | 37.218 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 37 | 22.791 ns | 0.1320 ns | 0.1170 ns | 22.759 ns | 0.61 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 40 | 38.410 ns | 0.4096 ns | 0.3831 ns | 38.444 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)sList [24] | List | Array | 40 | 38.112 ns | 0.1304 ns | 0.1089 ns | 38.106 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 40 | 24.124 ns | 0.0481 ns | 0.0427 ns | 24.116 ns | 0.63 | 0.00 | 0.1645 | - | - | 344 B | 0.91 | +| Actual | AddRa(...)sList [24] | List | Array | 40 | 23.867 ns | 0.1469 ns | 0.1374 ns | 23.799 ns | 0.62 | 0.01 | 0.1645 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 50 | 41.406 ns | 0.2024 ns | 0.1691 ns | 41.338 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 50 | 27.083 ns | 0.1757 ns | 0.1557 ns | 26.991 ns | 0.65 | 0.00 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 60 | 45.711 ns | 0.3373 ns | 0.3155 ns | 45.805 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 60 | 30.578 ns | 0.3389 ns | 0.3170 ns | 30.387 ns | 0.67 | 0.01 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 70 | 49.032 ns | 0.3409 ns | 0.3189 ns | 49.123 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 70 | 34.046 ns | 0.3775 ns | 0.3347 ns | 33.904 ns | 0.69 | 0.01 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 80 | 52.295 ns | 0.1185 ns | 0.0925 ns | 52.295 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 80 | 36.979 ns | 0.0517 ns | 0.0403 ns | 36.977 ns | 0.71 | 0.00 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 90 | 54.656 ns | 0.0976 ns | 0.0865 ns | 54.669 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 90 | 39.972 ns | 0.1052 ns | 0.0932 ns | 39.962 ns | 0.73 | 0.00 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 100 | 57.661 ns | 0.1003 ns | 0.0838 ns | 57.690 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 100 | 44.216 ns | 0.1678 ns | 0.1487 ns | 44.239 ns | 0.77 | 0.00 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 128 | 65.674 ns | 0.1278 ns | 0.1067 ns | 65.636 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 128 | 52.699 ns | 0.3878 ns | 0.3239 ns | 52.592 ns | 0.80 | 0.00 | 0.5010 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 256 | 112.863 ns | 0.2599 ns | 0.2171 ns | 112.845 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 256 | 100.391 ns | 0.4527 ns | 0.3780 ns | 100.431 ns | 0.89 | 0.00 | 0.9900 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 512 | 200.238 ns | 0.4835 ns | 0.3775 ns | 200.203 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 512 | 179.056 ns | 0.3721 ns | 0.3107 ns | 178.973 ns | 0.89 | 0.00 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 1024 | 393.686 ns | 2.2637 ns | 2.0067 ns | 393.175 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 1024 | 353.785 ns | 0.9575 ns | 0.8488 ns | 353.542 ns | 0.90 | 0.01 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 2048 | 767.932 ns | 4.2333 ns | 3.3051 ns | 768.692 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 2048 | 675.048 ns | 2.3414 ns | 1.9552 ns | 675.147 ns | 0.88 | 0.00 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 4096 | 1,509.292 ns | 4.3506 ns | 3.6330 ns | 1,508.327 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 4096 | 1,436.992 ns | 6.1629 ns | 5.7648 ns | 1,437.866 ns | 0.95 | 0.00 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 8192 | 2,852.302 ns | 11.1977 ns | 9.9265 ns | 2,855.262 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 8192 | 2,744.862 ns | 19.3780 ns | 17.1781 ns | 2,742.430 ns | 0.96 | 0.01 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 16384 | 62,943.792 ns | 1,261.0148 ns | 3,718.1305 ns | 64,097.217 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 16384 | 60,746.212 ns | 1,213.4860 ns | 1,853.1213 ns | 60,909.015 ns | 0.97 | 0.07 | 41.6260 | 41.6260 | 41.6260 | 131110 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 32768 | 121,765.578 ns | 2,426.5001 ns | 6,087.6142 ns | 124,802.698 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 32768 | 120,947.167 ns | 2,410.9372 ns | 5,587.7135 ns | 122,273.132 ns | 1.00 | 0.07 | 83.2520 | 83.2520 | 83.2520 | 262196 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 65536 | 117,170.234 ns | 1,331.3979 ns | 1,245.3905 ns | 116,773.206 ns | 1.00 | 0.00 | 126.9531 | 125.8545 | 125.8545 | 524865 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 65536 | 116,519.789 ns | 1,538.4105 ns | 1,439.0301 ns | 116,742.932 ns | 0.99 | 0.01 | 119.0186 | 118.6523 | 118.6523 | 524347 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 131072 | 305,755.076 ns | 6,110.5995 ns | 12,619.4475 ns | 303,551.733 ns | 1.00 | 0.00 | 188.4766 | 187.0117 | 187.0117 | 1048970 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 131072 | 323,919.398 ns | 5,454.6289 ns | 11,624.2589 ns | 324,083.887 ns | 1.06 | 0.05 | 160.1563 | 159.6680 | 159.6680 | 1048648 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | Array | 850000 | 2,254,409.126 ns | 43,936.1907 ns | 53,957.5879 ns | 2,268,590.820 ns | 1.00 | 0.00 | 156.2500 | 156.2500 | 156.2500 | 6800109 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | Array | 850000 | 2,248,246.094 ns | 43,864.1089 ns | 64,295.4421 ns | 2,267,407.812 ns | 1.00 | 0.02 | 156.2500 | 156.2500 | 156.2500 | 6800077 B | 1.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 0 | 9.882 ns | 0.2216 ns | 0.2722 ns | 9.669 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 0 | 15.415 ns | 0.0826 ns | 0.0732 ns | 15.400 ns | 1.56 | 0.04 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 1 | 24.904 ns | 0.1663 ns | 0.1389 ns | 24.947 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 1 | 49.775 ns | 0.5137 ns | 0.4805 ns | 49.819 ns | 2.00 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 2 | 24.986 ns | 0.1927 ns | 0.1803 ns | 25.043 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 2 | 49.758 ns | 0.5326 ns | 0.4982 ns | 49.702 ns | 1.99 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 3 | 25.974 ns | 0.4238 ns | 0.3964 ns | 25.976 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 3 | 49.726 ns | 0.7875 ns | 0.7367 ns | 49.452 ns | 1.91 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 4 | 26.040 ns | 0.4701 ns | 0.4397 ns | 26.027 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 4 | 49.568 ns | 0.4047 ns | 0.3588 ns | 49.463 ns | 1.90 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 5 | 26.009 ns | 0.3495 ns | 0.3269 ns | 26.071 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 5 | 49.387 ns | 0.1730 ns | 0.1350 ns | 49.444 ns | 1.90 | 0.03 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 6 | 26.302 ns | 0.1916 ns | 0.1600 ns | 26.245 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 6 | 49.553 ns | 0.3185 ns | 0.2486 ns | 49.574 ns | 1.88 | 0.02 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 7 | 26.604 ns | 0.3101 ns | 0.2900 ns | 26.440 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 7 | 49.933 ns | 0.6100 ns | 0.5706 ns | 49.914 ns | 1.88 | 0.02 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 8 | 26.972 ns | 0.3871 ns | 0.3621 ns | 26.771 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 8 | 49.375 ns | 0.3325 ns | 0.3110 ns | 49.308 ns | 1.83 | 0.03 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 9 | 27.105 ns | 0.2439 ns | 0.2281 ns | 27.109 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 9 | 51.028 ns | 0.5495 ns | 0.5140 ns | 51.189 ns | 1.88 | 0.02 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 10 | 27.409 ns | 0.1752 ns | 0.1553 ns | 27.356 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 10 | 51.531 ns | 0.6790 ns | 0.6351 ns | 51.517 ns | 1.88 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 11 | 28.877 ns | 0.1809 ns | 0.1510 ns | 28.869 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 11 | 53.229 ns | 0.7354 ns | 0.6879 ns | 53.371 ns | 1.84 | 0.02 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 12 | 29.260 ns | 0.2924 ns | 0.2735 ns | 29.131 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 12 | 52.826 ns | 0.6964 ns | 0.6514 ns | 52.816 ns | 1.81 | 0.03 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 13 | 30.198 ns | 0.5388 ns | 0.7006 ns | 29.950 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 13 | 53.378 ns | 0.7139 ns | 0.6678 ns | 53.446 ns | 1.76 | 0.05 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 14 | 29.995 ns | 0.2793 ns | 0.2613 ns | 29.953 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 14 | 53.161 ns | 0.7360 ns | 0.6884 ns | 53.282 ns | 1.77 | 0.02 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 15 | 29.932 ns | 0.2170 ns | 0.1923 ns | 29.891 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 15 | 52.625 ns | 0.7510 ns | 0.7025 ns | 52.757 ns | 1.76 | 0.02 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 16 | 30.217 ns | 0.3593 ns | 0.3361 ns | 30.222 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 16 | 52.435 ns | 0.7897 ns | 0.7387 ns | 52.188 ns | 1.74 | 0.03 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 17 | 30.155 ns | 0.1668 ns | 0.1393 ns | 30.110 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 17 | 52.103 ns | 0.6692 ns | 0.6260 ns | 52.167 ns | 1.73 | 0.02 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 18 | 30.335 ns | 0.1589 ns | 0.1241 ns | 30.338 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 18 | 52.253 ns | 0.7654 ns | 0.7160 ns | 52.383 ns | 1.72 | 0.03 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 19 | 31.694 ns | 0.2620 ns | 0.2323 ns | 31.574 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 19 | 54.396 ns | 0.5447 ns | 0.4548 ns | 54.523 ns | 1.72 | 0.03 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 20 | 32.504 ns | 0.4363 ns | 0.3868 ns | 32.463 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 20 | 54.544 ns | 0.4790 ns | 0.4247 ns | 54.525 ns | 1.68 | 0.02 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 30 | 35.813 ns | 0.2891 ns | 0.2705 ns | 35.825 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 30 | 57.690 ns | 0.1816 ns | 0.1610 ns | 57.659 ns | 1.61 | 0.01 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 32 | 36.182 ns | 0.2115 ns | 0.1875 ns | 36.236 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 32 | 57.378 ns | 0.1385 ns | 0.1081 ns | 57.400 ns | 1.59 | 0.01 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 36 | 37.711 ns | 0.1443 ns | 0.1279 ns | 37.670 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 36 | 56.907 ns | 0.1475 ns | 0.1307 ns | 56.885 ns | 1.51 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 37 | 38.422 ns | 0.3862 ns | 0.3612 ns | 38.429 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 37 | 57.246 ns | 0.2016 ns | 0.1787 ns | 57.238 ns | 1.49 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 40 | 39.027 ns | 0.2808 ns | 0.2627 ns | 38.901 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)sList [24] | List | PooledList | 40 | 38.971 ns | 0.1072 ns | 0.0950 ns | 38.951 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 40 | 56.754 ns | 0.4191 ns | 0.3921 ns | 56.523 ns | 1.45 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | AddRa(...)sList [24] | List | PooledList | 40 | 57.018 ns | 0.4412 ns | 0.3684 ns | 57.026 ns | 1.46 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 50 | 42.738 ns | 0.4053 ns | 0.3593 ns | 42.534 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 50 | 57.256 ns | 0.1728 ns | 0.1349 ns | 57.227 ns | 1.34 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 60 | 46.517 ns | 0.1567 ns | 0.1389 ns | 46.491 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 60 | 57.670 ns | 0.1562 ns | 0.1219 ns | 57.704 ns | 1.24 | 0.00 | 0.0267 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 70 | 50.052 ns | 0.1401 ns | 0.1311 ns | 50.089 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 70 | 58.601 ns | 0.1619 ns | 0.1435 ns | 58.593 ns | 1.17 | 0.00 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 80 | 53.331 ns | 0.1023 ns | 0.0907 ns | 53.360 ns | 1.00 | 0.00 | 0.3328 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 80 | 59.579 ns | 0.1748 ns | 0.1549 ns | 59.610 ns | 1.12 | 0.00 | 0.0267 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 850000 | 2,694,908.501 ns | 53,517.4515 ns | 92,314.9743 ns | 2,692,474.414 ns | 1.00 | 0.00 | 101.5625 | 101.5625 | 101.5625 | 6800091 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 850000 | 989,039.557 ns | 9,391.0372 ns | 8,784.3820 ns | 990,766.406 ns | 0.36 | 0.01 | - | - | - | 57 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 90 | 57.568 ns | 0.4039 ns | 0.3778 ns | 57.402 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 90 | 61.004 ns | 0.6292 ns | 0.5886 ns | 60.635 ns | 1.06 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 100 | 60.499 ns | 0.2552 ns | 0.2131 ns | 60.479 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 100 | 60.777 ns | 0.2064 ns | 0.1611 ns | 60.733 ns | 1.01 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 128 | 68.757 ns | 0.2856 ns | 0.2671 ns | 68.720 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 128 | 62.404 ns | 0.3370 ns | 0.3152 ns | 62.392 ns | 0.91 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 256 | 107.412 ns | 0.7486 ns | 0.7003 ns | 107.122 ns | 1.00 | 0.00 | 1.0060 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 256 | 71.265 ns | 0.5534 ns | 0.5176 ns | 71.020 ns | 0.66 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 512 | 201.111 ns | 0.8833 ns | 0.8263 ns | 200.921 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | PooledList | 512 | 88.281 ns | 0.7845 ns | 0.7338 ns | 87.999 ns | 0.44 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 1024 | 394.540 ns | 2.3701 ns | 2.1010 ns | 393.890 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 1024 | 119.730 ns | 1.0994 ns | 1.0284 ns | 119.703 ns | 0.30 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 2048 | 773.346 ns | 5.3219 ns | 4.9781 ns | 771.826 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 2048 | 281.812 ns | 1.7688 ns | 1.6546 ns | 281.259 ns | 0.36 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 4096 | 1,516.986 ns | 9.1806 ns | 8.5875 ns | 1,518.081 ns | 1.00 | 0.00 | 15.6231 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 4096 | 575.893 ns | 1.2566 ns | 1.0493 ns | 576.079 ns | 0.38 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 8192 | 2,869.766 ns | 31.1670 ns | 26.0259 ns | 2,869.614 ns | 1.00 | 0.00 | 31.2462 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 8192 | 1,153.794 ns | 8.3242 ns | 7.7865 ns | 1,152.730 ns | 0.40 | 0.01 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 16384 | 62,714.785 ns | 1,244.3376 ns | 2,678.5679 ns | 62,789.398 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 16384 | 2,325.273 ns | 2.5835 ns | 2.2902 ns | 2,325.078 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 32768 | 125,288.926 ns | 2,569.4672 ns | 7,576.1320 ns | 127,289.258 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 32768 | 5,174.197 ns | 6.0723 ns | 5.6801 ns | 5,171.732 ns | 0.04 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 65536 | 117,926.163 ns | 1,727.3894 ns | 1,615.8011 ns | 118,293.427 ns | 1.00 | 0.00 | 124.0234 | 122.9248 | 122.9248 | 524941 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 65536 | 11,283.153 ns | 17.7420 ns | 15.7278 ns | 11,277.905 ns | 0.10 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | PooledList | 131072 | 339,625.593 ns | 6,762.8489 ns | 15,538.7701 ns | 340,312.451 ns | 1.00 | 0.00 | 166.9922 | 166.0156 | 166.0156 | 1048884 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | PooledList | 131072 | 22,532.876 ns | 39.9415 ns | 35.4071 ns | 22,523.160 ns | 0.07 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 0 | 10.662 ns | 0.0263 ns | 0.0246 ns | 10.664 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 0 | 20.762 ns | 0.1174 ns | 0.1098 ns | 20.768 ns | 1.95 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 1 | 23.328 ns | 0.0868 ns | 0.0770 ns | 23.342 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 1 | 19.978 ns | 0.1036 ns | 0.0918 ns | 19.985 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 2 | 23.409 ns | 0.1539 ns | 0.1439 ns | 23.377 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 2 | 20.272 ns | 0.0753 ns | 0.0705 ns | 20.274 ns | 0.87 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 3 | 23.395 ns | 0.1410 ns | 0.1250 ns | 23.407 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 3 | 19.902 ns | 0.1046 ns | 0.0874 ns | 19.922 ns | 0.85 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 4 | 23.332 ns | 0.1401 ns | 0.1242 ns | 23.297 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 4 | 19.948 ns | 0.1243 ns | 0.1038 ns | 19.963 ns | 0.85 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 5 | 23.723 ns | 0.0354 ns | 0.0295 ns | 23.721 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 5 | 31.442 ns | 0.2135 ns | 0.1893 ns | 31.472 ns | 1.33 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 6 | 24.001 ns | 0.0709 ns | 0.0554 ns | 23.993 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 6 | 31.596 ns | 0.1852 ns | 0.1732 ns | 31.654 ns | 1.32 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 7 | 24.354 ns | 0.0654 ns | 0.0511 ns | 24.353 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 7 | 31.787 ns | 0.3793 ns | 0.3548 ns | 31.605 ns | 1.31 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 8 | 24.631 ns | 0.2459 ns | 0.2300 ns | 24.744 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 8 | 31.417 ns | 0.2752 ns | 0.2440 ns | 31.305 ns | 1.28 | 0.02 | 0.0918 | - | - | 192 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 9 | 24.957 ns | 0.2966 ns | 0.2775 ns | 24.810 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 9 | 33.884 ns | 0.2777 ns | 0.2598 ns | 33.964 ns | 1.36 | 0.02 | 0.1224 | - | - | 256 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 10 | 25.360 ns | 0.3467 ns | 0.3243 ns | 25.210 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 10 | 34.029 ns | 0.3593 ns | 0.3185 ns | 33.897 ns | 1.34 | 0.02 | 0.1224 | - | - | 256 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 11 | 25.798 ns | 0.1976 ns | 0.1752 ns | 25.708 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 11 | 36.466 ns | 0.4225 ns | 0.3745 ns | 36.500 ns | 1.41 | 0.02 | 0.1224 | - | - | 256 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 12 | 26.220 ns | 0.2275 ns | 0.2128 ns | 26.247 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 12 | 36.995 ns | 0.4512 ns | 0.4000 ns | 37.087 ns | 1.41 | 0.01 | 0.1224 | - | - | 256 B | 1.68 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 13 | 27.919 ns | 0.0467 ns | 0.0364 ns | 27.932 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 13 | 36.792 ns | 0.3169 ns | 0.2964 ns | 36.742 ns | 1.32 | 0.01 | 0.1224 | - | - | 256 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 14 | 26.653 ns | 0.0511 ns | 0.0399 ns | 26.656 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 14 | 36.898 ns | 0.5461 ns | 0.5108 ns | 36.847 ns | 1.39 | 0.02 | 0.1224 | - | - | 256 B | 1.52 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 15 | 27.114 ns | 0.2327 ns | 0.2177 ns | 27.016 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 15 | 36.317 ns | 0.5650 ns | 0.5285 ns | 36.292 ns | 1.34 | 0.02 | 0.1224 | - | - | 256 B | 1.45 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 16 | 27.635 ns | 0.3074 ns | 0.2876 ns | 27.585 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 16 | 35.100 ns | 0.5421 ns | 0.5071 ns | 34.970 ns | 1.27 | 0.02 | 0.1224 | - | - | 256 B | 1.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 17 | 27.992 ns | 0.2252 ns | 0.2106 ns | 27.997 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 17 | 39.391 ns | 0.5958 ns | 0.5573 ns | 39.530 ns | 1.41 | 0.02 | 0.1836 | - | - | 384 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 18 | 28.214 ns | 0.1351 ns | 0.1198 ns | 28.203 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 18 | 39.549 ns | 0.4089 ns | 0.3625 ns | 39.612 ns | 1.40 | 0.01 | 0.1836 | - | - | 384 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 19 | 29.010 ns | 0.5537 ns | 0.5179 ns | 28.909 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 19 | 42.351 ns | 0.6433 ns | 0.6017 ns | 42.592 ns | 1.46 | 0.03 | 0.1836 | - | - | 384 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 20 | 28.822 ns | 0.2908 ns | 0.2578 ns | 28.737 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 20 | 42.102 ns | 0.4215 ns | 0.3520 ns | 42.238 ns | 1.46 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 30 | 32.216 ns | 0.2364 ns | 0.2211 ns | 32.250 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 30 | 42.758 ns | 0.4794 ns | 0.4485 ns | 42.796 ns | 1.33 | 0.01 | 0.1836 | - | - | 384 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 32 | 33.104 ns | 0.3896 ns | 0.3454 ns | 32.973 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 32 | 41.854 ns | 0.2911 ns | 0.2581 ns | 41.932 ns | 1.26 | 0.01 | 0.1836 | - | - | 384 B | 1.23 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 36 | 34.598 ns | 0.3746 ns | 0.3504 ns | 34.374 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 36 | 52.152 ns | 0.3769 ns | 0.3341 ns | 52.133 ns | 1.51 | 0.02 | 0.0650 | - | - | 136 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 37 | 42.993 ns | 0.3526 ns | 0.3126 ns | 42.984 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 37 | 48.802 ns | 0.4426 ns | 0.4140 ns | 48.916 ns | 1.14 | 0.01 | 0.0650 | - | - | 136 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 40 | 45.327 ns | 0.3848 ns | 0.3411 ns | 45.408 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 40 | 44.640 ns | 0.4487 ns | 0.4197 ns | 44.547 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 40 | 51.490 ns | 0.7919 ns | 0.7407 ns | 51.370 ns | 1.14 | 0.02 | 0.0650 | - | - | 136 B | 0.36 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 40 | 50.331 ns | 0.4084 ns | 0.3820 ns | 50.348 ns | 1.11 | 0.01 | 0.0650 | - | - | 136 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 50 | 49.686 ns | 0.5801 ns | 0.5426 ns | 49.835 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 50 | 48.861 ns | 0.3903 ns | 0.3651 ns | 48.903 ns | 0.98 | 0.01 | 0.0650 | - | - | 136 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 60 | 55.222 ns | 0.9793 ns | 0.9160 ns | 55.304 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 60 | 50.406 ns | 0.6221 ns | 0.5819 ns | 50.609 ns | 0.91 | 0.02 | 0.0650 | - | - | 136 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 70 | 59.639 ns | 0.5240 ns | 0.4902 ns | 59.674 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 70 | 51.276 ns | 0.3608 ns | 0.3374 ns | 51.342 ns | 0.86 | 0.01 | 0.0650 | - | - | 136 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 80 | 62.926 ns | 0.8099 ns | 0.7576 ns | 62.884 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 80 | 53.457 ns | 0.5823 ns | 0.5447 ns | 53.692 ns | 0.85 | 0.01 | 0.0650 | - | - | 136 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 90 | 68.657 ns | 0.7288 ns | 0.6817 ns | 68.650 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 90 | 51.996 ns | 0.7653 ns | 0.7159 ns | 51.656 ns | 0.76 | 0.01 | 0.0650 | - | - | 136 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 100 | 72.366 ns | 1.1535 ns | 1.0790 ns | 72.434 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 100 | 53.440 ns | 0.6623 ns | 0.5871 ns | 53.249 ns | 0.74 | 0.01 | 0.0650 | - | - | 136 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 128 | 86.276 ns | 1.3645 ns | 1.2763 ns | 85.931 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 128 | 54.843 ns | 0.5694 ns | 0.5326 ns | 54.729 ns | 0.64 | 0.01 | 0.0650 | - | - | 136 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 256 | 149.720 ns | 2.9365 ns | 2.7468 ns | 149.436 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 256 | 62.319 ns | 0.6457 ns | 0.5392 ns | 62.109 ns | 0.42 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 512 | 273.217 ns | 5.0212 ns | 4.6968 ns | 273.434 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 512 | 91.256 ns | 1.1094 ns | 1.0377 ns | 90.933 ns | 0.33 | 0.01 | 0.0650 | - | - | 136 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 1024 | 539.725 ns | 8.4545 ns | 7.9084 ns | 538.635 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 1024 | 121.492 ns | 0.4481 ns | 0.3742 ns | 121.587 ns | 0.23 | 0.00 | 0.0648 | - | - | 136 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 2048 | 1,071.889 ns | 20.4942 ns | 20.1280 ns | 1,067.685 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 2048 | 256.002 ns | 1.5244 ns | 1.4259 ns | 256.022 ns | 0.24 | 0.00 | 0.0648 | - | - | 136 B | 0.008 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 4096 | 2,145.019 ns | 41.4481 ns | 47.7316 ns | 2,147.316 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 4096 | 589.963 ns | 1.6652 ns | 1.3905 ns | 589.737 ns | 0.27 | 0.01 | 0.0648 | - | - | 136 B | 0.004 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 8192 | 4,068.138 ns | 68.0033 ns | 60.2832 ns | 4,061.301 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 8192 | 1,069.563 ns | 3.1950 ns | 3.9238 ns | 1,068.856 ns | 0.26 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 16384 | 64,981.147 ns | 1,295.0403 ns | 3,818.4557 ns | 65,517.908 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 16384 | 2,310.719 ns | 14.2907 ns | 13.3675 ns | 2,305.269 ns | 0.04 | 0.00 | 0.0648 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 32768 | 125,265.467 ns | 2,487.3575 ns | 5,764.8292 ns | 127,476.892 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 32768 | 5,077.521 ns | 9.3875 ns | 8.3217 ns | 5,076.466 ns | 0.04 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 65536 | 124,065.222 ns | 2,393.8944 ns | 2,939.9173 ns | 123,803.674 ns | 1.00 | 0.00 | 122.3145 | 121.3379 | 121.3379 | 524912 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 65536 | 11,772.198 ns | 47.7368 ns | 39.8624 ns | 11,757.787 ns | 0.09 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 131072 | 351,182.982 ns | 6,930.9717 ns | 15,502.1113 ns | 353,653.271 ns | 1.00 | 0.00 | 154.2969 | 153.3203 | 153.3203 | 1048960 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 131072 | 22,267.199 ns | 53.6820 ns | 44.8269 ns | 22,259.190 ns | 0.06 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableList | 850000 | 2,579,255.938 ns | 50,408.1680 ns | 67,293.4564 ns | 2,591,026.562 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableList | 850000 | 995,848.884 ns | 10,721.5975 ns | 9,504.4169 ns | 998,970.020 ns | 0.39 | 0.01 | - | - | - | 149 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 0 | 11.147 ns | 0.1650 ns | 0.1543 ns | 11.053 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 0 | 18.141 ns | 0.2743 ns | 0.2565 ns | 18.026 ns | 1.63 | 0.03 | 0.0421 | - | - | 88 B | 2.75 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 1 | 23.538 ns | 0.0832 ns | 0.0695 ns | 23.552 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 1 | 63.765 ns | 0.7577 ns | 0.7087 ns | 63.938 ns | 2.71 | 0.04 | 0.0726 | - | - | 152 B | 1.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 2 | 23.513 ns | 0.1026 ns | 0.0909 ns | 23.524 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 2 | 64.338 ns | 0.9316 ns | 0.8714 ns | 64.512 ns | 2.74 | 0.04 | 0.0764 | - | - | 160 B | 1.82 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 3 | 23.535 ns | 0.1275 ns | 0.1131 ns | 23.543 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 3 | 68.631 ns | 1.0177 ns | 0.9519 ns | 68.436 ns | 2.92 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 4 | 23.570 ns | 0.0905 ns | 0.0846 ns | 23.555 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 4 | 64.425 ns | 0.8796 ns | 0.8227 ns | 64.467 ns | 2.73 | 0.04 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 5 | 23.918 ns | 0.2214 ns | 0.2071 ns | 24.014 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 5 | 66.814 ns | 1.3700 ns | 1.3455 ns | 67.032 ns | 2.79 | 0.07 | 0.0994 | - | - | 208 B | 2.17 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 6 | 24.254 ns | 0.1073 ns | 0.0896 ns | 24.219 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 6 | 70.033 ns | 0.9243 ns | 0.8646 ns | 70.113 ns | 2.89 | 0.04 | 0.0994 | - | - | 208 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 7 | 24.519 ns | 0.1685 ns | 0.1407 ns | 24.461 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 7 | 67.891 ns | 0.6130 ns | 0.5734 ns | 67.922 ns | 2.77 | 0.03 | 0.0994 | - | - | 208 B | 1.86 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 8 | 24.830 ns | 0.2301 ns | 0.2153 ns | 24.690 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 8 | 64.382 ns | 0.4604 ns | 0.4081 ns | 64.452 ns | 2.60 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 9 | 25.104 ns | 0.1700 ns | 0.1590 ns | 25.056 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 9 | 70.498 ns | 1.4433 ns | 1.3500 ns | 70.601 ns | 2.81 | 0.05 | 0.1301 | - | - | 272 B | 2.12 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 10 | 25.497 ns | 0.2260 ns | 0.2003 ns | 25.424 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 10 | 71.201 ns | 0.9236 ns | 0.8639 ns | 71.099 ns | 2.79 | 0.04 | 0.1301 | - | - | 272 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 11 | 26.207 ns | 0.0863 ns | 0.0720 ns | 26.199 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 11 | 69.000 ns | 0.5877 ns | 0.4907 ns | 68.981 ns | 2.63 | 0.02 | 0.1301 | - | - | 272 B | 1.89 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 12 | 26.735 ns | 0.2304 ns | 0.2155 ns | 26.833 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 12 | 71.577 ns | 0.9710 ns | 0.9082 ns | 71.655 ns | 2.68 | 0.04 | 0.1301 | - | - | 272 B | 1.79 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 13 | 27.212 ns | 0.3904 ns | 0.3652 ns | 27.020 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 13 | 73.673 ns | 1.0537 ns | 0.9856 ns | 73.736 ns | 2.71 | 0.05 | 0.1301 | - | - | 272 B | 1.70 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 14 | 27.157 ns | 0.2949 ns | 0.2758 ns | 26.987 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 14 | 71.790 ns | 1.0183 ns | 0.9525 ns | 72.044 ns | 2.64 | 0.04 | 0.1301 | - | - | 272 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 15 | 27.482 ns | 0.1830 ns | 0.1528 ns | 27.459 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 15 | 73.558 ns | 1.0953 ns | 1.0245 ns | 73.547 ns | 2.68 | 0.04 | 0.1301 | - | - | 272 B | 1.55 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 16 | 28.011 ns | 0.2137 ns | 0.1999 ns | 28.026 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 16 | 68.875 ns | 1.1750 ns | 1.0991 ns | 69.155 ns | 2.46 | 0.05 | 0.1301 | - | - | 272 B | 1.48 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 17 | 28.315 ns | 0.2642 ns | 0.2472 ns | 28.384 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 17 | 73.488 ns | 0.8915 ns | 0.7445 ns | 73.282 ns | 2.59 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 18 | 28.537 ns | 0.3274 ns | 0.2902 ns | 28.366 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 18 | 78.541 ns | 1.5678 ns | 1.3898 ns | 78.484 ns | 2.75 | 0.05 | 0.1912 | - | - | 400 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 19 | 29.619 ns | 0.2659 ns | 0.2076 ns | 29.569 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 19 | 77.614 ns | 1.2187 ns | 1.1400 ns | 77.429 ns | 2.63 | 0.04 | 0.1912 | - | - | 400 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 20 | 29.412 ns | 0.2932 ns | 0.2289 ns | 29.327 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 20 | 77.507 ns | 1.5823 ns | 1.5540 ns | 77.626 ns | 2.64 | 0.05 | 0.1912 | - | - | 400 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 30 | 32.582 ns | 0.1033 ns | 0.0863 ns | 32.594 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 30 | 78.495 ns | 0.9910 ns | 0.9270 ns | 78.604 ns | 2.41 | 0.03 | 0.1912 | - | - | 400 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 32 | 33.787 ns | 0.3666 ns | 0.3250 ns | 33.748 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 32 | 73.195 ns | 0.9241 ns | 0.8192 ns | 73.104 ns | 2.17 | 0.02 | 0.1912 | - | - | 400 B | 1.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 36 | 41.292 ns | 0.7189 ns | 0.7383 ns | 41.224 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 36 | 90.454 ns | 1.1146 ns | 1.0426 ns | 90.164 ns | 2.18 | 0.05 | 0.0726 | - | - | 152 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 37 | 41.764 ns | 0.6511 ns | 0.6091 ns | 41.825 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 37 | 94.358 ns | 0.7783 ns | 0.6899 ns | 94.426 ns | 2.26 | 0.03 | 0.0726 | - | - | 152 B | 0.43 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 43.434 ns | 0.4400 ns | 0.4116 ns | 43.625 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 45.004 ns | 0.5726 ns | 0.5356 ns | 44.794 ns | 1.04 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 95.163 ns | 0.9738 ns | 0.9109 ns | 95.414 ns | 2.19 | 0.03 | 0.0726 | - | - | 152 B | 0.40 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 40 | 90.262 ns | 0.5011 ns | 0.4184 ns | 90.214 ns | 2.08 | 0.03 | 0.0726 | - | - | 152 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 50 | 48.545 ns | 0.7105 ns | 0.6646 ns | 48.394 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 50 | 86.724 ns | 0.8487 ns | 0.7939 ns | 86.569 ns | 1.79 | 0.02 | 0.0726 | - | - | 152 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 60 | 52.510 ns | 0.8905 ns | 0.8329 ns | 52.412 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 60 | 91.048 ns | 0.8719 ns | 0.8156 ns | 91.045 ns | 1.73 | 0.03 | 0.0726 | - | - | 152 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 70 | 57.998 ns | 0.8765 ns | 0.8199 ns | 58.223 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 70 | 94.418 ns | 0.8735 ns | 0.7743 ns | 94.506 ns | 1.63 | 0.02 | 0.0726 | - | - | 152 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 80 | 61.584 ns | 0.9545 ns | 0.8928 ns | 61.533 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 80 | 91.144 ns | 0.7758 ns | 0.6877 ns | 91.227 ns | 1.48 | 0.02 | 0.0726 | - | - | 152 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 850000 | 2,552,485.778 ns | 50,601.5629 ns | 124,126.4961 ns | 2,561,205.469 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 850000 | 1,402,280.221 ns | 24,938.7902 ns | 23,327.7598 ns | 1,386,580.664 ns | 0.55 | 0.04 | - | - | - | 445 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 90 | 67.744 ns | 1.4001 ns | 1.4378 ns | 67.875 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 90 | 98.338 ns | 1.0207 ns | 0.9548 ns | 98.716 ns | 1.45 | 0.04 | 0.0726 | - | - | 152 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 100 | 71.117 ns | 1.1286 ns | 1.0557 ns | 70.853 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 100 | 100.146 ns | 0.8346 ns | 0.7807 ns | 100.081 ns | 1.41 | 0.02 | 0.0726 | - | - | 152 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 128 | 86.734 ns | 1.7640 ns | 1.7325 ns | 86.405 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 128 | 98.654 ns | 0.4437 ns | 0.3933 ns | 98.680 ns | 1.14 | 0.02 | 0.0726 | - | - | 152 B | 0.14 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 256 | 151.934 ns | 2.7584 ns | 2.5802 ns | 151.490 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 256 | 107.676 ns | 1.6545 ns | 1.4666 ns | 107.006 ns | 0.71 | 0.01 | 0.0726 | - | - | 152 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 512 | 287.009 ns | 5.4882 ns | 5.8723 ns | 285.913 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 512 | 118.064 ns | 0.7037 ns | 0.6238 ns | 117.871 ns | 0.41 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 1024 | 546.254 ns | 10.5374 ns | 11.7123 ns | 545.656 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 1024 | 151.216 ns | 1.0516 ns | 0.8781 ns | 150.926 ns | 0.28 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 2048 | 1,058.532 ns | 20.4304 ns | 25.0904 ns | 1,055.086 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 2048 | 344.122 ns | 0.5488 ns | 0.4582 ns | 343.927 ns | 0.33 | 0.01 | 0.0725 | - | - | 152 B | 0.009 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 4096 | 2,084.871 ns | 35.5141 ns | 29.6559 ns | 2,082.227 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 4096 | 635.637 ns | 1.9858 ns | 1.6582 ns | 635.702 ns | 0.30 | 0.00 | 0.0725 | - | - | 152 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 8192 | 4,030.369 ns | 52.9474 ns | 44.2135 ns | 4,037.312 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 8192 | 1,227.361 ns | 1.3412 ns | 1.1890 ns | 1,227.335 ns | 0.30 | 0.00 | 0.0725 | - | - | 152 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 16384 | 63,680.482 ns | 1,269.5463 ns | 2,865.5776 ns | 64,523.438 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 16384 | 2,482.393 ns | 4.8548 ns | 4.0540 ns | 2,482.490 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 32768 | 126,205.583 ns | 2,522.8943 ns | 5,376.4935 ns | 127,686.475 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 32768 | 4,879.764 ns | 14.8785 ns | 13.1894 ns | 4,876.628 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 65536 | 125,617.547 ns | 2,428.8927 ns | 2,271.9878 ns | 126,223.145 ns | 1.00 | 0.00 | 113.7695 | 112.7930 | 112.7930 | 525098 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 65536 | 10,999.739 ns | 79.9506 ns | 74.7859 ns | 10,986.104 ns | 0.09 | 0.00 | 0.1984 | - | - | 432 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | AddRa(...)sList [24] | List | RecyclableLongList | 131072 | 368,580.983 ns | 7,330.8526 ns | 21,033.5904 ns | 372,785.938 ns | 1.00 | 0.00 | 172.3633 | 171.3867 | 171.3867 | 1048974 B | 1.000 | +| Actual | AddRa(...)sList [24] | List | RecyclableLongList | 131072 | 22,344.782 ns | 91.1245 ns | 76.0931 ns | 22,355.394 ns | 0.06 | 0.00 | 0.1831 | - | - | 432 B | 0.000 | +
+ +# `AddRange` when Source is of the Same Type Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 +``` +
+Add Entire Collection Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |--------------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | AddRa(...)eType [28] | List | Array | 0 | 11.130 ns | 0.2393 ns | 0.6046 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 0 | 11.542 ns | 0.1261 ns | 0.1118 ns | 1.03 | 0.06 | 0.0115 | - | - | 24 B | 0.75 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 1 | 25.470 ns | 0.3937 ns | 0.3682 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 1 | 11.578 ns | 0.1171 ns | 0.1038 ns | 0.45 | 0.01 | 0.0153 | - | - | 32 B | 0.36 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 2 | 25.193 ns | 0.2873 ns | 0.2687 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 2 | 11.983 ns | 0.1474 ns | 0.1307 ns | 0.48 | 0.01 | 0.0191 | - | - | 40 B | 0.45 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 3 | 26.398 ns | 0.5484 ns | 0.7864 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 3 | 13.067 ns | 0.2813 ns | 0.4035 ns | 0.50 | 0.02 | 0.0229 | - | - | 48 B | 0.55 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 4 | 26.088 ns | 0.4518 ns | 0.4005 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 4 | 13.009 ns | 0.2636 ns | 0.5841 ns | 0.51 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 5 | 26.131 ns | 0.5141 ns | 0.4808 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 5 | 13.350 ns | 0.2826 ns | 0.3254 ns | 0.51 | 0.02 | 0.0306 | - | - | 64 B | 0.67 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 6 | 26.358 ns | 0.1956 ns | 0.1734 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 6 | 18.101 ns | 0.3910 ns | 0.6202 ns | 0.69 | 0.02 | 0.0344 | - | - | 72 B | 0.69 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 7 | 27.862 ns | 0.5401 ns | 0.4510 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 7 | 15.122 ns | 0.2060 ns | 0.1927 ns | 0.54 | 0.01 | 0.0382 | - | - | 80 B | 0.71 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 8 | 26.364 ns | 0.2000 ns | 0.1773 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 8 | 13.496 ns | 0.1003 ns | 0.0837 ns | 0.51 | 0.01 | 0.0421 | - | - | 88 B | 0.73 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 9 | 27.020 ns | 0.4438 ns | 0.4151 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 9 | 14.024 ns | 0.0786 ns | 0.0614 ns | 0.52 | 0.01 | 0.0459 | - | - | 96 B | 0.75 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 10 | 27.181 ns | 0.2353 ns | 0.2086 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 10 | 14.397 ns | 0.0549 ns | 0.0487 ns | 0.53 | 0.00 | 0.0497 | - | - | 104 B | 0.76 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 11 | 28.177 ns | 0.4046 ns | 0.4659 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 11 | 14.810 ns | 0.0962 ns | 0.0803 ns | 0.52 | 0.01 | 0.0536 | - | - | 112 B | 0.78 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 12 | 28.219 ns | 0.1322 ns | 0.1104 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 12 | 15.395 ns | 0.2990 ns | 0.2937 ns | 0.55 | 0.01 | 0.0574 | - | - | 120 B | 0.79 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 13 | 29.309 ns | 0.4947 ns | 0.4628 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 13 | 15.667 ns | 0.3425 ns | 0.3204 ns | 0.53 | 0.02 | 0.0612 | - | - | 128 B | 0.80 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 14 | 28.922 ns | 0.2560 ns | 0.1999 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 14 | 15.738 ns | 0.1038 ns | 0.0811 ns | 0.54 | 0.00 | 0.0650 | - | - | 136 B | 0.81 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 15 | 29.055 ns | 0.2204 ns | 0.1840 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 15 | 17.284 ns | 0.3746 ns | 0.9190 ns | 0.63 | 0.03 | 0.0688 | - | - | 144 B | 0.82 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 16 | 29.595 ns | 0.1483 ns | 0.1387 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 16 | 16.447 ns | 0.1694 ns | 0.1502 ns | 0.56 | 0.01 | 0.0727 | - | - | 152 B | 0.83 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 17 | 30.339 ns | 0.2740 ns | 0.2139 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 17 | 17.072 ns | 0.1804 ns | 0.1599 ns | 0.56 | 0.01 | 0.0765 | - | - | 160 B | 0.83 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 18 | 30.067 ns | 0.1784 ns | 0.1581 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 18 | 16.924 ns | 0.0651 ns | 0.0544 ns | 0.56 | 0.00 | 0.0803 | - | - | 168 B | 0.84 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 19 | 30.815 ns | 0.1268 ns | 0.1059 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 19 | 17.468 ns | 0.0858 ns | 0.0803 ns | 0.57 | 0.00 | 0.0842 | - | - | 176 B | 0.85 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 20 | 31.092 ns | 0.1723 ns | 0.1612 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 20 | 18.077 ns | 0.3485 ns | 0.3423 ns | 0.58 | 0.01 | 0.0880 | - | - | 184 B | 0.85 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 30 | 34.591 ns | 0.1228 ns | 0.1026 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 30 | 21.257 ns | 0.3219 ns | 0.3011 ns | 0.61 | 0.01 | 0.1262 | - | - | 264 B | 0.89 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 32 | 35.428 ns | 0.4571 ns | 0.4276 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 32 | 21.349 ns | 0.2307 ns | 0.2158 ns | 0.60 | 0.01 | 0.1339 | - | - | 280 B | 0.90 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 36 | 37.796 ns | 0.4431 ns | 0.4145 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 36 | 22.991 ns | 0.3531 ns | 0.3130 ns | 0.61 | 0.01 | 0.1492 | - | - | 312 B | 0.91 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 37 | 45.827 ns | 0.7941 ns | 0.7428 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 37 | 29.952 ns | 0.4111 ns | 0.3645 ns | 0.65 | 0.01 | 0.1530 | - | - | 320 B | 0.91 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 40 | 43.855 ns | 0.9048 ns | 1.2976 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)eType [28] | List | Array | 40 | 44.531 ns | 0.8081 ns | 0.7559 ns | 1.00 | 0.03 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 40 | 32.028 ns | 0.4175 ns | 0.3906 ns | 0.72 | 0.02 | 0.1644 | - | - | 344 B | 0.91 | +| Actual | AddRa(...)eType [28] | List | Array | 40 | 31.861 ns | 0.4754 ns | 0.4214 ns | 0.72 | 0.02 | 0.1644 | - | - | 344 B | 0.91 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 50 | 49.180 ns | 0.4984 ns | 0.4662 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 50 | 35.845 ns | 0.4755 ns | 0.4215 ns | 0.73 | 0.01 | 0.2027 | - | - | 424 B | 0.93 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 60 | 56.015 ns | 0.9489 ns | 0.8412 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 60 | 41.637 ns | 0.5269 ns | 0.4400 ns | 0.74 | 0.01 | 0.2410 | - | - | 504 B | 0.94 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 70 | 59.495 ns | 1.2186 ns | 1.1399 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 70 | 46.731 ns | 0.7153 ns | 0.6691 ns | 0.79 | 0.02 | 0.2792 | - | - | 584 B | 0.95 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 80 | 62.753 ns | 1.3043 ns | 1.0892 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 80 | 50.285 ns | 0.4069 ns | 0.3398 ns | 0.80 | 0.02 | 0.3175 | - | - | 664 B | 0.95 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 90 | 68.272 ns | 1.3466 ns | 1.3829 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 90 | 55.361 ns | 0.8554 ns | 0.8001 ns | 0.81 | 0.02 | 0.3557 | - | - | 744 B | 0.96 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 100 | 71.997 ns | 1.2148 ns | 1.1931 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 100 | 59.530 ns | 0.4752 ns | 0.3968 ns | 0.83 | 0.02 | 0.3940 | - | - | 824 B | 0.96 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 128 | 87.677 ns | 1.4620 ns | 1.3676 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 128 | 79.391 ns | 1.0735 ns | 1.0042 ns | 0.91 | 0.02 | 0.5009 | - | - | 1048 B | 0.97 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 256 | 156.349 ns | 3.0060 ns | 3.2164 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 256 | 139.939 ns | 2.7788 ns | 3.8036 ns | 0.90 | 0.03 | 0.9899 | - | - | 2072 B | 0.98 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 512 | 285.700 ns | 4.3492 ns | 4.0683 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 512 | 254.336 ns | 3.3971 ns | 2.8368 ns | 0.89 | 0.01 | 1.9684 | - | - | 4120 B | 0.99 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 1024 | 548.307 ns | 9.5689 ns | 10.6358 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 1024 | 502.519 ns | 5.8992 ns | 5.5182 ns | 0.92 | 0.02 | 3.9215 | - | - | 8216 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 2048 | 1,091.469 ns | 20.9323 ns | 20.5583 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 2048 | 996.147 ns | 18.7552 ns | 17.5437 ns | 0.91 | 0.03 | 7.8125 | - | - | 16408 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 4096 | 2,219.535 ns | 44.1725 ns | 55.8640 ns | 1.00 | 0.00 | 15.6212 | - | - | 32824 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 4096 | 2,093.852 ns | 33.5667 ns | 29.7560 ns | 0.94 | 0.03 | 15.6250 | - | - | 32792 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 8192 | 4,137.783 ns | 67.2569 ns | 59.6215 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 8192 | 4,050.748 ns | 79.3689 ns | 74.2417 ns | 0.98 | 0.02 | 31.2500 | - | - | 65560 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 16384 | 62,361.460 ns | 1,234.4155 ns | 2,760.9472 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 16384 | 62,640.143 ns | 1,222.8484 ns | 1,143.8531 ns | 1.00 | 0.05 | 41.6260 | 41.6260 | 41.6260 | 131123 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 32768 | 124,444.963 ns | 2,209.2170 ns | 2,066.5029 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 32768 | 124,601.272 ns | 1,884.6954 ns | 1,762.9453 ns | 1.00 | 0.02 | 83.2520 | 83.2520 | 83.2520 | 262222 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 65536 | 124,986.510 ns | 2,432.2288 ns | 2,388.7739 ns | 1.00 | 0.00 | 121.8262 | 120.8496 | 120.8496 | 524915 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 65536 | 125,391.075 ns | 2,006.6992 ns | 1,778.8865 ns | 1.00 | 0.02 | 114.0137 | 113.7695 | 113.7695 | 524379 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 131072 | 349,388.666 ns | 6,956.3878 ns | 14,974.3587 ns | 1.00 | 0.00 | 171.8750 | 170.8984 | 170.8984 | 1049002 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 131072 | 351,255.893 ns | 9,386.1730 ns | 25,053.5957 ns | 1.00 | 0.08 | 151.3672 | 151.3672 | 151.3672 | 1048697 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | Array | 850000 | 2,420,456.454 ns | 47,773.4283 ns | 117,189.0337 ns | 1.00 | 0.00 | 93.7500 | 93.7500 | 93.7500 | 6800140 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | Array | 850000 | 2,445,365.667 ns | 47,758.0764 ns | 81,096.8382 ns | 1.01 | 0.06 | 93.7500 | 93.7500 | 93.7500 | 6800108 B | 1.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 0 | 10.864 ns | 0.2451 ns | 0.2517 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 0 | 18.548 ns | 0.3782 ns | 0.3158 ns | 1.71 | 0.05 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 1 | 23.588 ns | 0.1952 ns | 0.1524 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 1 | 48.688 ns | 0.8480 ns | 0.7933 ns | 2.07 | 0.04 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 2 | 23.806 ns | 0.1126 ns | 0.0941 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 2 | 48.646 ns | 0.9822 ns | 0.9647 ns | 2.03 | 0.03 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 3 | 24.054 ns | 0.2895 ns | 0.2566 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 3 | 49.753 ns | 0.3469 ns | 0.2896 ns | 2.07 | 0.02 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 4 | 24.077 ns | 0.3817 ns | 0.3570 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 4 | 48.919 ns | 0.9848 ns | 1.2455 ns | 2.03 | 0.05 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 5 | 24.336 ns | 0.0824 ns | 0.0771 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 5 | 49.869 ns | 0.5317 ns | 0.4713 ns | 2.05 | 0.02 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 6 | 24.621 ns | 0.3176 ns | 0.2971 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 6 | 50.022 ns | 0.3998 ns | 0.3338 ns | 2.03 | 0.03 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 7 | 24.859 ns | 0.3857 ns | 0.3608 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 7 | 49.068 ns | 0.8517 ns | 0.7967 ns | 1.97 | 0.04 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 8 | 25.558 ns | 0.5077 ns | 0.6235 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 8 | 49.053 ns | 0.4336 ns | 0.3844 ns | 1.93 | 0.06 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 9 | 25.654 ns | 0.2436 ns | 0.2160 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 9 | 50.699 ns | 0.4827 ns | 0.4279 ns | 1.98 | 0.03 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 10 | 25.680 ns | 0.1746 ns | 0.1363 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 10 | 49.127 ns | 0.6465 ns | 0.5731 ns | 1.91 | 0.03 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 11 | 26.616 ns | 0.2380 ns | 0.1988 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 11 | 51.448 ns | 0.8978 ns | 1.0688 ns | 1.92 | 0.04 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 12 | 27.378 ns | 0.4981 ns | 0.4159 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 12 | 50.385 ns | 0.5370 ns | 0.4760 ns | 1.84 | 0.04 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 13 | 26.974 ns | 0.2220 ns | 0.2076 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 13 | 51.002 ns | 0.5437 ns | 0.4820 ns | 1.89 | 0.03 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 14 | 27.633 ns | 0.0526 ns | 0.0411 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 14 | 51.993 ns | 0.8438 ns | 0.7893 ns | 1.88 | 0.03 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 15 | 29.526 ns | 0.0964 ns | 0.0752 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 15 | 49.912 ns | 0.3768 ns | 0.3340 ns | 1.69 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 16 | 28.423 ns | 0.2398 ns | 0.2125 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 16 | 50.269 ns | 0.5110 ns | 0.4530 ns | 1.77 | 0.02 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 17 | 28.634 ns | 0.5830 ns | 0.5169 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 17 | 51.806 ns | 0.3907 ns | 0.3463 ns | 1.81 | 0.03 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 18 | 28.709 ns | 0.1578 ns | 0.1398 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 18 | 51.321 ns | 0.6393 ns | 0.5338 ns | 1.79 | 0.02 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 19 | 29.629 ns | 0.1498 ns | 0.1169 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 19 | 51.460 ns | 0.8538 ns | 0.7987 ns | 1.74 | 0.03 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 20 | 29.696 ns | 0.0653 ns | 0.0510 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 20 | 53.873 ns | 0.5867 ns | 0.5488 ns | 1.81 | 0.02 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 30 | 33.173 ns | 0.0947 ns | 0.0739 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 30 | 52.831 ns | 0.9119 ns | 0.8084 ns | 1.59 | 0.03 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 32 | 33.970 ns | 0.3746 ns | 0.3321 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 32 | 51.453 ns | 0.5877 ns | 0.5210 ns | 1.51 | 0.02 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 36 | 35.917 ns | 0.5893 ns | 0.5224 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 36 | 53.030 ns | 0.9696 ns | 0.8596 ns | 1.48 | 0.03 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 37 | 42.025 ns | 0.3079 ns | 0.2404 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 37 | 57.318 ns | 0.6425 ns | 0.5695 ns | 1.36 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 40 | 44.006 ns | 0.5927 ns | 0.5254 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)eType [28] | List | PooledList | 40 | 45.799 ns | 0.6992 ns | 0.5838 ns | 1.04 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 40 | 56.113 ns | 0.6086 ns | 0.5693 ns | 1.28 | 0.02 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | AddRa(...)eType [28] | List | PooledList | 40 | 55.865 ns | 1.1411 ns | 1.3141 ns | 1.27 | 0.04 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 50 | 51.379 ns | 0.5447 ns | 0.5095 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 50 | 57.035 ns | 0.8954 ns | 0.8375 ns | 1.11 | 0.02 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 60 | 54.870 ns | 0.5687 ns | 0.5041 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 60 | 58.892 ns | 0.6835 ns | 0.6393 ns | 1.07 | 0.02 | 0.0268 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 70 | 60.498 ns | 1.0837 ns | 0.9606 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 70 | 57.776 ns | 0.4136 ns | 0.3869 ns | 0.96 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 80 | 62.523 ns | 1.0781 ns | 1.0084 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 80 | 57.940 ns | 0.8512 ns | 0.7963 ns | 0.93 | 0.02 | 0.0267 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 850000 | 2,066,797.500 ns | 20,523.3232 ns | 19,197.5293 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 6800131 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 850000 | 964,365.792 ns | 9,801.7259 ns | 8,688.9747 ns | 0.47 | 0.01 | - | - | - | 70 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 90 | 68.833 ns | 0.8645 ns | 0.7664 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 90 | 58.597 ns | 0.3887 ns | 0.3034 ns | 0.85 | 0.01 | 0.0268 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 100 | 74.301 ns | 1.5183 ns | 1.4912 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 100 | 64.482 ns | 0.4218 ns | 0.3739 ns | 0.87 | 0.02 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 128 | 88.448 ns | 1.4699 ns | 1.3749 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 128 | 60.385 ns | 0.7399 ns | 0.6179 ns | 0.68 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 256 | 149.847 ns | 2.5773 ns | 2.4108 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 256 | 73.161 ns | 0.5521 ns | 0.5164 ns | 0.49 | 0.01 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 512 | 283.413 ns | 5.2589 ns | 4.9192 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | PooledList | 512 | 86.162 ns | 1.2962 ns | 1.2124 ns | 0.30 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 1024 | 555.119 ns | 9.5200 ns | 8.9050 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 1024 | 119.310 ns | 1.1890 ns | 0.9928 ns | 0.21 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 2048 | 1,087.334 ns | 20.4621 ns | 21.8942 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 2048 | 268.578 ns | 1.2559 ns | 1.0487 ns | 0.25 | 0.00 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 4096 | 2,197.142 ns | 43.4581 ns | 40.6508 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 4096 | 601.797 ns | 2.5170 ns | 2.3544 ns | 0.27 | 0.01 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 8192 | 4,177.224 ns | 83.1534 ns | 81.6677 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 8192 | 1,094.748 ns | 2.9803 ns | 2.3268 ns | 0.26 | 0.01 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 16384 | 62,481.090 ns | 1,226.8973 ns | 2,421.7756 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 16384 | 2,352.365 ns | 6.4542 ns | 5.7215 ns | 0.04 | 0.00 | 0.0267 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 32768 | 60,438.673 ns | 838.5708 ns | 743.3712 ns | 1.00 | 0.00 | 64.5142 | 63.9038 | 63.9038 | 262643 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 32768 | 5,212.466 ns | 21.0913 ns | 19.7288 ns | 0.09 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 65536 | 126,815.479 ns | 2,451.5053 ns | 3,187.6494 ns | 1.00 | 0.00 | 123.0469 | 122.0703 | 122.0703 | 524855 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 65536 | 12,057.761 ns | 23.2018 ns | 19.3746 ns | 0.09 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | PooledList | 131072 | 555,120.439 ns | 16,978.8548 ns | 50,062.5365 ns | 1.00 | 0.00 | 130.8594 | 129.8828 | 129.8828 | 1048907 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | PooledList | 131072 | 24,792.478 ns | 152.7210 ns | 142.8553 ns | 0.04 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 0 | 9.984 ns | 0.1471 ns | 0.1304 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 0 | 23.295 ns | 0.0688 ns | 0.0575 ns | 2.33 | 0.03 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 1 | 24.646 ns | 0.0579 ns | 0.0484 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 1 | 23.080 ns | 0.0728 ns | 0.0608 ns | 0.94 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 2 | 25.075 ns | 0.3903 ns | 0.3651 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 2 | 23.446 ns | 0.2082 ns | 0.1846 ns | 0.93 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 3 | 25.234 ns | 0.2101 ns | 0.1755 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 3 | 23.276 ns | 0.1936 ns | 0.1811 ns | 0.92 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 4 | 24.821 ns | 0.2100 ns | 0.1862 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 4 | 23.723 ns | 0.2376 ns | 0.1984 ns | 0.96 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 5 | 25.455 ns | 0.1967 ns | 0.1643 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 5 | 24.119 ns | 0.4441 ns | 0.3937 ns | 0.95 | 0.02 | 0.0536 | - | - | 112 B | 1.17 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 6 | 25.880 ns | 0.3365 ns | 0.2983 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 6 | 24.328 ns | 0.3539 ns | 0.3310 ns | 0.94 | 0.02 | 0.0574 | - | - | 120 B | 1.15 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 7 | 26.254 ns | 0.4840 ns | 0.4527 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 7 | 24.480 ns | 0.1700 ns | 0.1590 ns | 0.93 | 0.01 | 0.0612 | - | - | 128 B | 1.14 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 8 | 26.215 ns | 0.2432 ns | 0.2275 ns | 1.00 | 0.00 | 0.0574 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 8 | 24.226 ns | 0.1506 ns | 0.1258 ns | 0.92 | 0.01 | 0.0650 | - | - | 136 B | 1.13 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 9 | 27.113 ns | 0.3339 ns | 0.2960 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 9 | 25.085 ns | 0.1451 ns | 0.1212 ns | 0.93 | 0.01 | 0.0688 | - | - | 144 B | 1.12 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 10 | 27.033 ns | 0.1833 ns | 0.1715 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 10 | 25.472 ns | 0.0927 ns | 0.0822 ns | 0.94 | 0.01 | 0.0727 | - | - | 152 B | 1.12 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 11 | 27.718 ns | 0.1791 ns | 0.1398 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 11 | 26.043 ns | 0.2054 ns | 0.1820 ns | 0.94 | 0.01 | 0.0765 | - | - | 160 B | 1.11 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 12 | 28.322 ns | 0.1488 ns | 0.1319 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 12 | 26.749 ns | 0.3152 ns | 0.2949 ns | 0.95 | 0.01 | 0.0803 | - | - | 168 B | 1.11 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 13 | 28.553 ns | 0.0852 ns | 0.0712 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 13 | 26.703 ns | 0.1340 ns | 0.1188 ns | 0.94 | 0.00 | 0.0842 | - | - | 176 B | 1.10 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 14 | 28.731 ns | 0.2008 ns | 0.1780 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 14 | 26.911 ns | 0.2181 ns | 0.2040 ns | 0.94 | 0.01 | 0.0880 | - | - | 184 B | 1.10 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 15 | 29.373 ns | 0.4128 ns | 0.3861 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 15 | 26.830 ns | 0.2702 ns | 0.2256 ns | 0.92 | 0.01 | 0.0918 | - | - | 192 B | 1.09 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 16 | 29.921 ns | 0.2043 ns | 0.1811 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 16 | 27.116 ns | 0.2464 ns | 0.2184 ns | 0.91 | 0.01 | 0.0956 | - | - | 200 B | 1.09 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 17 | 29.394 ns | 0.2128 ns | 0.1777 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 17 | 27.931 ns | 0.3428 ns | 0.3039 ns | 0.95 | 0.01 | 0.0995 | - | - | 208 B | 1.08 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 18 | 30.388 ns | 0.3601 ns | 0.3368 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 18 | 27.886 ns | 0.3436 ns | 0.3214 ns | 0.92 | 0.01 | 0.1033 | - | - | 216 B | 1.08 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 19 | 31.047 ns | 0.5781 ns | 0.5407 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 19 | 28.831 ns | 0.3529 ns | 0.3301 ns | 0.93 | 0.02 | 0.1071 | - | - | 224 B | 1.08 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 20 | 30.976 ns | 0.2613 ns | 0.2445 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 20 | 29.190 ns | 0.3043 ns | 0.2847 ns | 0.94 | 0.01 | 0.1109 | - | - | 232 B | 1.07 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 30 | 34.546 ns | 0.5836 ns | 0.5459 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 30 | 31.642 ns | 0.1564 ns | 0.1221 ns | 0.92 | 0.01 | 0.1492 | - | - | 312 B | 1.05 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 32 | 35.010 ns | 0.1142 ns | 0.1012 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 32 | 31.866 ns | 0.1098 ns | 0.0917 ns | 0.91 | 0.00 | 0.1568 | - | - | 328 B | 1.05 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 36 | 37.283 ns | 0.3699 ns | 0.3460 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 36 | 34.279 ns | 0.6879 ns | 0.5744 ns | 0.92 | 0.02 | 0.1721 | - | - | 360 B | 1.05 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 37 | 42.471 ns | 0.8034 ns | 0.9564 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 37 | 39.053 ns | 0.5582 ns | 0.4948 ns | 0.92 | 0.03 | 0.0382 | - | - | 80 B | 0.23 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 40 | 44.106 ns | 0.4028 ns | 0.3570 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 40 | 44.109 ns | 0.7584 ns | 0.7094 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 40 | 41.890 ns | 0.8572 ns | 1.1443 ns | 0.95 | 0.04 | 0.0382 | - | - | 80 B | 0.21 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 40 | 41.548 ns | 0.8442 ns | 1.2373 ns | 0.93 | 0.03 | 0.0382 | - | - | 80 B | 0.21 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 50 | 49.175 ns | 0.8146 ns | 0.7619 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 50 | 41.499 ns | 0.8199 ns | 0.9442 ns | 0.84 | 0.03 | 0.0382 | - | - | 80 B | 0.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 60 | 53.845 ns | 1.0794 ns | 1.8034 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 60 | 41.220 ns | 0.6544 ns | 0.6121 ns | 0.75 | 0.03 | 0.0382 | - | - | 80 B | 0.15 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 70 | 57.915 ns | 1.1268 ns | 1.0540 ns | 1.00 | 0.00 | 0.2945 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 70 | 42.082 ns | 0.8164 ns | 0.8019 ns | 0.73 | 0.02 | 0.0382 | - | - | 80 B | 0.13 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 80 | 63.026 ns | 1.2702 ns | 1.5599 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 80 | 44.869 ns | 0.7835 ns | 0.7329 ns | 0.72 | 0.02 | 0.0382 | - | - | 80 B | 0.11 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 90 | 66.255 ns | 0.9316 ns | 0.8259 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 90 | 44.769 ns | 0.9159 ns | 0.9800 ns | 0.68 | 0.02 | 0.0382 | - | - | 80 B | 0.10 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 100 | 73.985 ns | 1.2756 ns | 1.1932 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 100 | 46.870 ns | 0.7417 ns | 0.6575 ns | 0.63 | 0.01 | 0.0382 | - | - | 80 B | 0.09 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 128 | 85.671 ns | 1.0133 ns | 0.8462 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 128 | 45.684 ns | 0.9202 ns | 1.0597 ns | 0.53 | 0.02 | 0.0382 | - | - | 80 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 256 | 153.485 ns | 2.9825 ns | 3.0628 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 256 | 57.447 ns | 0.8614 ns | 0.8057 ns | 0.38 | 0.01 | 0.0382 | - | - | 80 B | 0.04 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 512 | 280.755 ns | 5.6056 ns | 5.7565 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 512 | 86.984 ns | 0.3941 ns | 0.3494 ns | 0.31 | 0.01 | 0.0381 | - | - | 80 B | 0.02 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 1024 | 540.902 ns | 10.5032 ns | 12.0955 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 1024 | 119.791 ns | 0.7695 ns | 0.7198 ns | 0.22 | 0.00 | 0.0381 | - | - | 80 B | 0.010 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 2048 | 1,071.924 ns | 20.7493 ns | 23.0628 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 2048 | 256.106 ns | 1.7875 ns | 1.6721 ns | 0.24 | 0.01 | 0.0381 | - | - | 80 B | 0.005 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 4096 | 2,152.656 ns | 42.3875 ns | 82.6735 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 4096 | 590.185 ns | 1.8672 ns | 1.6552 ns | 0.27 | 0.01 | 0.0381 | - | - | 80 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 8192 | 4,117.021 ns | 81.1150 ns | 102.5846 ns | 1.00 | 0.00 | 31.2500 | - | - | 65592 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 8192 | 1,057.719 ns | 3.7570 ns | 3.1373 ns | 0.26 | 0.01 | 0.0381 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 16384 | 61,909.318 ns | 1,168.6242 ns | 1,093.1318 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 16384 | 2,213.035 ns | 9.2986 ns | 8.6979 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 32768 | 124,050.279 ns | 1,854.0950 ns | 1,734.3216 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 32768 | 4,783.964 ns | 33.6396 ns | 31.4665 ns | 0.04 | 0.00 | 0.0381 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 65536 | 127,514.403 ns | 2,414.8174 ns | 2,684.0632 ns | 1.00 | 0.00 | 113.5254 | 112.5488 | 112.5488 | 525062 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 65536 | 11,186.556 ns | 63.5896 ns | 56.3706 ns | 0.09 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 131072 | 339,330.092 ns | 6,385.0031 ns | 5,660.1390 ns | 1.00 | 0.00 | 140.6250 | 139.6484 | 139.6484 | 1049099 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 131072 | 21,402.054 ns | 176.6340 ns | 165.2236 ns | 0.06 | 0.00 | 0.0305 | - | - | 80 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableList | 850000 | 2,376,119.556 ns | 47,395.7652 ns | 92,441.8000 ns | 1.00 | 0.00 | 89.8438 | 89.8438 | 89.8438 | 6800138 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableList | 850000 | 994,650.133 ns | 14,850.8560 ns | 13,891.4999 ns | 0.42 | 0.02 | - | - | - | 93 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 0 | 10.904 ns | 0.0638 ns | 0.0566 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 0 | 20.511 ns | 0.2668 ns | 0.2496 ns | 1.88 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 1 | 24.959 ns | 0.0797 ns | 0.0706 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 1 | 72.454 ns | 0.2531 ns | 0.2367 ns | 2.90 | 0.01 | 0.0726 | - | - | 152 B | 1.73 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 2 | 25.108 ns | 0.3381 ns | 0.3162 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 2 | 71.529 ns | 0.4878 ns | 0.4073 ns | 2.85 | 0.04 | 0.0764 | - | - | 160 B | 1.82 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 3 | 26.151 ns | 0.4230 ns | 0.3957 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 3 | 66.991 ns | 0.6016 ns | 0.5627 ns | 2.56 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 4 | 26.056 ns | 0.4589 ns | 0.4068 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 4 | 72.162 ns | 0.8150 ns | 0.7624 ns | 2.77 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 5 | 26.859 ns | 0.4836 ns | 0.4524 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 5 | 66.718 ns | 0.9715 ns | 0.9087 ns | 2.48 | 0.05 | 0.0994 | - | - | 208 B | 2.17 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 6 | 26.665 ns | 0.3548 ns | 0.3484 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 6 | 67.162 ns | 1.3353 ns | 1.3713 ns | 2.52 | 0.06 | 0.0994 | - | - | 208 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 7 | 26.300 ns | 0.2841 ns | 0.2658 ns | 1.00 | 0.00 | 0.0536 | - | - | 112 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 7 | 66.967 ns | 1.1590 ns | 0.9678 ns | 2.55 | 0.05 | 0.0994 | - | - | 208 B | 1.86 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 8 | 27.574 ns | 0.1915 ns | 0.1698 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 8 | 74.324 ns | 0.4434 ns | 0.3703 ns | 2.70 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 9 | 26.977 ns | 0.0502 ns | 0.0419 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 9 | 70.684 ns | 0.8233 ns | 0.7702 ns | 2.62 | 0.03 | 0.1301 | - | - | 272 B | 2.12 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 10 | 27.462 ns | 0.1436 ns | 0.1199 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 10 | 70.197 ns | 1.2714 ns | 1.1893 ns | 2.55 | 0.04 | 0.1301 | - | - | 272 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 11 | 29.863 ns | 0.5762 ns | 0.5390 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 11 | 73.540 ns | 1.4041 ns | 1.3790 ns | 2.46 | 0.06 | 0.1301 | - | - | 272 B | 1.89 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 12 | 29.872 ns | 0.1969 ns | 0.1842 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 12 | 72.325 ns | 0.8258 ns | 0.7724 ns | 2.42 | 0.03 | 0.1301 | - | - | 272 B | 1.79 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 13 | 29.975 ns | 0.2438 ns | 0.2161 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 13 | 72.729 ns | 0.9520 ns | 0.8905 ns | 2.43 | 0.04 | 0.1301 | - | - | 272 B | 1.70 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 14 | 30.268 ns | 0.2860 ns | 0.2536 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 14 | 72.482 ns | 1.0387 ns | 0.9716 ns | 2.39 | 0.04 | 0.1301 | - | - | 272 B | 1.62 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 15 | 30.054 ns | 0.3848 ns | 0.3600 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 15 | 71.198 ns | 1.1847 ns | 1.1082 ns | 2.37 | 0.04 | 0.1301 | - | - | 272 B | 1.55 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 16 | 29.915 ns | 0.1625 ns | 0.1357 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 16 | 77.678 ns | 0.7768 ns | 0.7266 ns | 2.59 | 0.03 | 0.1301 | - | - | 272 B | 1.48 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 17 | 30.334 ns | 0.4255 ns | 0.3980 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 17 | 75.712 ns | 1.3404 ns | 1.2538 ns | 2.50 | 0.05 | 0.1912 | - | - | 400 B | 2.08 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 18 | 30.239 ns | 0.4177 ns | 0.3907 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 18 | 75.437 ns | 0.9996 ns | 0.8347 ns | 2.50 | 0.04 | 0.1912 | - | - | 400 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 19 | 32.478 ns | 0.3859 ns | 0.3421 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 19 | 77.166 ns | 0.7857 ns | 0.6561 ns | 2.37 | 0.04 | 0.1912 | - | - | 400 B | 1.92 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 20 | 32.781 ns | 0.3910 ns | 0.3265 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 20 | 77.595 ns | 1.4140 ns | 1.3227 ns | 2.37 | 0.05 | 0.1912 | - | - | 400 B | 1.85 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 30 | 35.679 ns | 0.5166 ns | 0.4314 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 30 | 78.698 ns | 1.2769 ns | 1.1945 ns | 2.21 | 0.05 | 0.1912 | - | - | 400 B | 1.35 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 32 | 35.066 ns | 0.4752 ns | 0.4212 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 32 | 82.503 ns | 0.6996 ns | 0.6545 ns | 2.35 | 0.03 | 0.1912 | - | - | 400 B | 1.28 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 36 | 42.449 ns | 0.3532 ns | 0.2949 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 36 | 90.669 ns | 0.8020 ns | 0.7109 ns | 2.14 | 0.03 | 0.0726 | - | - | 152 B | 0.44 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 37 | 45.330 ns | 0.6440 ns | 0.5709 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 37 | 86.098 ns | 1.0429 ns | 0.9755 ns | 1.90 | 0.03 | 0.0726 | - | - | 152 B | 0.43 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 45.714 ns | 0.6506 ns | 0.5767 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 45.859 ns | 0.5729 ns | 0.5359 ns | 1.00 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 86.625 ns | 1.4336 ns | 1.3410 ns | 1.90 | 0.04 | 0.0726 | - | - | 152 B | 0.40 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 40 | 85.021 ns | 1.1591 ns | 1.0842 ns | 1.86 | 0.03 | 0.0726 | - | - | 152 B | 0.40 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 50 | 50.080 ns | 0.9707 ns | 1.6484 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 50 | 91.564 ns | 0.9019 ns | 0.7995 ns | 1.78 | 0.04 | 0.0726 | - | - | 152 B | 0.33 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 60 | 55.192 ns | 1.1290 ns | 1.0561 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 60 | 88.056 ns | 0.9427 ns | 0.8818 ns | 1.60 | 0.04 | 0.0726 | - | - | 152 B | 0.28 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 70 | 60.089 ns | 0.9410 ns | 0.8803 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 70 | 88.199 ns | 0.7938 ns | 0.6629 ns | 1.47 | 0.02 | 0.0726 | - | - | 152 B | 0.25 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 80 | 65.051 ns | 1.0846 ns | 1.0145 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 80 | 87.173 ns | 1.3621 ns | 1.2742 ns | 1.34 | 0.03 | 0.0726 | - | - | 152 B | 0.22 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 850000 | 2,073,757.688 ns | 35,902.6590 ns | 44,091.6896 ns | 1.00 | 0.00 | 85.9375 | 85.9375 | 85.9375 | 6800136 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 850000 | 1,397,636.775 ns | 21,279.7061 ns | 18,863.9052 ns | 0.67 | 0.02 | - | - | - | 457 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 90 | 69.863 ns | 1.2842 ns | 1.2012 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 90 | 88.215 ns | 1.2682 ns | 1.0590 ns | 1.26 | 0.03 | 0.0726 | - | - | 152 B | 0.20 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 100 | 76.827 ns | 1.5786 ns | 1.5504 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 100 | 90.378 ns | 1.3849 ns | 1.2954 ns | 1.18 | 0.03 | 0.0726 | - | - | 152 B | 0.18 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 128 | 87.659 ns | 1.6866 ns | 1.8047 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 128 | 96.360 ns | 1.9181 ns | 1.9698 ns | 1.10 | 0.03 | 0.0726 | - | - | 152 B | 0.14 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 256 | 156.419 ns | 2.9980 ns | 2.8043 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 256 | 106.052 ns | 1.3438 ns | 1.2570 ns | 0.68 | 0.01 | 0.0726 | - | - | 152 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 512 | 284.013 ns | 5.5347 ns | 7.3887 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 512 | 124.200 ns | 0.9799 ns | 0.9166 ns | 0.44 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 1024 | 548.962 ns | 10.6434 ns | 10.9300 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 1024 | 159.443 ns | 1.3463 ns | 1.1935 ns | 0.29 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 2048 | 1,082.050 ns | 20.4083 ns | 20.9578 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 2048 | 296.525 ns | 2.5386 ns | 2.3746 ns | 0.27 | 0.01 | 0.0725 | - | - | 152 B | 0.009 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 4096 | 2,162.695 ns | 41.0124 ns | 45.5851 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 4096 | 643.180 ns | 1.7082 ns | 1.4264 ns | 0.30 | 0.01 | 0.0725 | - | - | 152 B | 0.005 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 8192 | 4,173.033 ns | 76.6649 ns | 71.7124 ns | 1.00 | 0.00 | 31.2424 | 0.0076 | - | 65592 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 8192 | 1,118.365 ns | 2.7970 ns | 2.1837 ns | 0.27 | 0.00 | 0.0725 | - | - | 152 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 16384 | 62,637.616 ns | 642.2715 ns | 600.7811 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 16384 | 2,460.005 ns | 14.7731 ns | 13.8188 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 32768 | 124,466.459 ns | 2,474.2540 ns | 4,825.8424 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 32768 | 4,915.874 ns | 33.8292 ns | 29.9887 ns | 0.04 | 0.00 | 0.2060 | - | - | 432 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 65536 | 124,811.930 ns | 1,904.0356 ns | 1,781.0361 ns | 1.00 | 0.00 | 121.8262 | 120.8496 | 120.8496 | 524913 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 65536 | 11,048.069 ns | 77.3298 ns | 72.3343 ns | 0.09 | 0.00 | 0.1984 | - | - | 432 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | AddRa(...)eType [28] | List | RecyclableLongList | 131072 | 557,480.125 ns | 15,327.4575 ns | 44,952.7795 ns | 1.00 | 0.00 | 124.0234 | 124.0234 | 124.0234 | 1048847 B | 1.000 | +| Actual | AddRa(...)eType [28] | List | RecyclableLongList | 131072 | 23,189.499 ns | 157.7244 ns | 139.8186 ns | 0.04 | 0.00 | 0.1831 | - | - | 432 B | 0.000 | +
+ +# `foreach` Benchmarks +## Environment + +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.2283/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.400 + [Host] : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.11 (7.0.1123.42427), X64 RyuJIT AVX2 +``` + +
+Non-Versioned & Versioned foreach Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | +|--------- |----------------- |------------- |------------------- |---------------- |-----------------:|---------------:|----------------:|-----------------:|------:|--------:|----------:|------------:| +| Baseline | ForEach | List | Array | 0 | 3.487 ns | 0.0179 ns | 0.0150 ns | 3.482 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 0 | 3.434 ns | 0.0081 ns | 0.0072 ns | 3.434 ns | 0.98 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 1 | 5.630 ns | 0.0174 ns | 0.0163 ns | 5.627 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 1 | 4.184 ns | 0.0255 ns | 0.0226 ns | 4.178 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 2 | 7.334 ns | 0.0255 ns | 0.0226 ns | 7.331 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 2 | 5.380 ns | 0.0192 ns | 0.0170 ns | 5.372 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 3 | 9.049 ns | 0.0539 ns | 0.0450 ns | 9.029 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 3 | 6.786 ns | 0.0396 ns | 0.0370 ns | 6.798 ns | 0.75 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 4 | 11.407 ns | 0.2501 ns | 0.2977 ns | 11.303 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 4 | 7.772 ns | 0.0253 ns | 0.0224 ns | 7.768 ns | 0.68 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 5 | 12.862 ns | 0.0414 ns | 0.0367 ns | 12.845 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 5 | 9.454 ns | 0.0152 ns | 0.0127 ns | 9.448 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 6 | 15.321 ns | 0.0833 ns | 0.0696 ns | 15.326 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 6 | 10.668 ns | 0.0156 ns | 0.0138 ns | 10.665 ns | 0.70 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 7 | 17.036 ns | 0.0375 ns | 0.0293 ns | 17.043 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 7 | 11.966 ns | 0.0340 ns | 0.0301 ns | 11.965 ns | 0.70 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 8 | 18.712 ns | 0.1134 ns | 0.0947 ns | 18.676 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 8 | 14.084 ns | 0.0917 ns | 0.0858 ns | 14.068 ns | 0.75 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 9 | 20.313 ns | 0.0572 ns | 0.0478 ns | 20.325 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 9 | 14.891 ns | 0.0550 ns | 0.0488 ns | 14.889 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 10 | 22.192 ns | 0.4737 ns | 0.3956 ns | 22.071 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 10 | 16.123 ns | 0.0641 ns | 0.0569 ns | 16.114 ns | 0.73 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 11 | 23.641 ns | 0.1011 ns | 0.0946 ns | 23.669 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 11 | 17.335 ns | 0.0499 ns | 0.0417 ns | 17.327 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 12 | 25.257 ns | 0.0708 ns | 0.0662 ns | 25.251 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 12 | 18.630 ns | 0.0767 ns | 0.0717 ns | 18.630 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 13 | 26.951 ns | 0.0753 ns | 0.0629 ns | 26.954 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 13 | 19.711 ns | 0.0645 ns | 0.0603 ns | 19.727 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 14 | 31.153 ns | 0.8776 ns | 2.5877 ns | 30.424 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 14 | 21.176 ns | 0.1692 ns | 0.1583 ns | 21.133 ns | 0.67 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 15 | 30.372 ns | 0.1292 ns | 0.1208 ns | 30.368 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 15 | 22.237 ns | 0.1125 ns | 0.1053 ns | 22.237 ns | 0.73 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 16 | 32.101 ns | 0.1252 ns | 0.1171 ns | 32.097 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 16 | 23.175 ns | 0.0321 ns | 0.0268 ns | 23.164 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 17 | 33.932 ns | 0.1474 ns | 0.1307 ns | 33.933 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 17 | 24.482 ns | 0.0630 ns | 0.0589 ns | 24.484 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 18 | 38.305 ns | 1.0860 ns | 3.2022 ns | 36.323 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 18 | 25.664 ns | 0.0367 ns | 0.0325 ns | 25.654 ns | 0.67 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 19 | 37.343 ns | 0.1699 ns | 0.1589 ns | 37.291 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 19 | 26.873 ns | 0.0570 ns | 0.0533 ns | 26.840 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 20 | 38.951 ns | 0.1495 ns | 0.1399 ns | 38.977 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 20 | 28.079 ns | 0.0525 ns | 0.0465 ns | 28.084 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 30 | 62.954 ns | 0.1634 ns | 0.1276 ns | 62.929 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 30 | 40.119 ns | 0.0740 ns | 0.0692 ns | 40.091 ns | 0.64 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 32 | 76.166 ns | 1.5663 ns | 3.5988 ns | 77.714 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 32 | 50.062 ns | 0.1958 ns | 0.1831 ns | 50.081 ns | 0.66 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 36 | 86.614 ns | 1.7552 ns | 2.1555 ns | 87.531 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 36 | 53.487 ns | 0.0479 ns | 0.0448 ns | 53.469 ns | 0.62 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 37 | 75.856 ns | 0.3714 ns | 0.3102 ns | 75.819 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 37 | 54.833 ns | 0.1245 ns | 0.1164 ns | 54.792 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 40 | 80.450 ns | 0.2158 ns | 0.2018 ns | 80.410 ns | 1.00 | 0.00 | - | NA | +| Baseline | ForEach | List | Array | 40 | 95.505 ns | 1.9345 ns | 2.3757 ns | 96.241 ns | 1.18 | 0.03 | - | NA | +| Actual | ForEach | List | Array | 40 | 57.393 ns | 0.1455 ns | 0.1290 ns | 57.330 ns | 0.71 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 40 | 57.380 ns | 0.1309 ns | 0.1161 ns | 57.341 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 50 | 113.094 ns | 2.2972 ns | 5.4596 ns | 114.487 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 50 | 69.941 ns | 0.2646 ns | 0.2346 ns | 69.901 ns | 0.62 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 60 | 135.453 ns | 2.7219 ns | 3.7257 ns | 135.652 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 60 | 82.196 ns | 0.3092 ns | 0.2892 ns | 82.136 ns | 0.61 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 70 | 131.325 ns | 0.3936 ns | 0.3682 ns | 131.332 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 70 | 94.408 ns | 0.2604 ns | 0.2435 ns | 94.316 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 80 | 148.601 ns | 0.6620 ns | 0.6192 ns | 148.551 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 80 | 105.787 ns | 0.2325 ns | 0.2061 ns | 105.737 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 90 | 165.663 ns | 0.5758 ns | 0.5386 ns | 165.592 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 90 | 118.377 ns | 0.4253 ns | 0.3978 ns | 118.196 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 100 | 182.601 ns | 0.6587 ns | 0.5839 ns | 182.786 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 100 | 130.277 ns | 0.3582 ns | 0.3350 ns | 130.165 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 128 | 230.132 ns | 0.6950 ns | 0.6161 ns | 230.085 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 128 | 163.550 ns | 0.3581 ns | 0.3350 ns | 163.526 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 256 | 446.447 ns | 0.8596 ns | 0.8040 ns | 446.478 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 256 | 318.035 ns | 0.5664 ns | 0.5021 ns | 317.986 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 512 | 881.729 ns | 2.9007 ns | 2.7133 ns | 880.546 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 512 | 627.926 ns | 1.0484 ns | 0.9807 ns | 627.657 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 1024 | 1,749.543 ns | 3.1759 ns | 2.8154 ns | 1,749.770 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 1024 | 1,244.577 ns | 1.6036 ns | 1.4216 ns | 1,244.631 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 2048 | 3,479.646 ns | 7.1813 ns | 6.7174 ns | 3,477.583 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 2048 | 2,484.262 ns | 3.8278 ns | 3.5806 ns | 2,483.284 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 4096 | 6,966.203 ns | 14.6556 ns | 13.7088 ns | 6,970.947 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 4096 | 4,970.602 ns | 9.2895 ns | 8.6894 ns | 4,969.536 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 8192 | 13,932.168 ns | 38.3528 ns | 35.8753 ns | 13,919.844 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 8192 | 9,919.799 ns | 17.7701 ns | 16.6222 ns | 9,920.946 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 16384 | 27,879.434 ns | 146.9250 ns | 130.2452 ns | 27,832.965 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 16384 | 19,808.677 ns | 46.0551 ns | 43.0800 ns | 19,790.013 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 32768 | 55,575.696 ns | 129.2643 ns | 120.9139 ns | 55,538.348 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 32768 | 39,620.633 ns | 99.5818 ns | 88.2767 ns | 39,592.172 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 65536 | 111,706.166 ns | 159.1455 ns | 141.0783 ns | 111,688.910 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 65536 | 79,235.173 ns | 103.3609 ns | 91.6267 ns | 79,206.268 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 131072 | 222,985.042 ns | 722.8065 ns | 676.1137 ns | 222,746.484 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | Array | 131072 | 158,797.176 ns | 245.8026 ns | 229.9239 ns | 158,728.003 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | Array | 850000 | 1,559,428.776 ns | 3,833.1196 ns | 3,585.5025 ns | 1,559,275.586 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | ForEach | List | Array | 850000 | 1,108,570.229 ns | 3,343.2555 ns | 2,963.7089 ns | 1,108,734.277 ns | 0.71 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 0 | 3.434 ns | 0.0141 ns | 0.0132 ns | 3.429 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 0 | 3.444 ns | 0.0110 ns | 0.0103 ns | 3.448 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 1 | 5.614 ns | 0.0233 ns | 0.0218 ns | 5.614 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 1 | 5.583 ns | 0.0185 ns | 0.0173 ns | 5.587 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 2 | 7.765 ns | 0.1669 ns | 0.1479 ns | 7.798 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 2 | 7.342 ns | 0.0477 ns | 0.0398 ns | 7.332 ns | 0.95 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 3 | 9.467 ns | 0.2188 ns | 0.4615 ns | 9.411 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 3 | 9.380 ns | 0.2160 ns | 0.3949 ns | 9.224 ns | 1.00 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 4 | 11.567 ns | 0.2513 ns | 0.3087 ns | 11.491 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 4 | 11.327 ns | 0.1668 ns | 0.1560 ns | 11.260 ns | 0.98 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 5 | 12.887 ns | 0.0472 ns | 0.0394 ns | 12.882 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 5 | 12.827 ns | 0.0344 ns | 0.0321 ns | 12.827 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 6 | 15.519 ns | 0.1414 ns | 0.1181 ns | 15.496 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 6 | 15.445 ns | 0.0905 ns | 0.0803 ns | 15.428 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 7 | 17.103 ns | 0.1409 ns | 0.1177 ns | 17.108 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 7 | 17.039 ns | 0.1346 ns | 0.1259 ns | 17.020 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 8 | 19.299 ns | 0.3939 ns | 0.9661 ns | 18.764 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 8 | 18.884 ns | 0.1780 ns | 0.1486 ns | 18.830 ns | 0.96 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 9 | 20.700 ns | 0.2643 ns | 0.2343 ns | 20.647 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 9 | 20.432 ns | 0.0651 ns | 0.0544 ns | 20.435 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 10 | 22.201 ns | 0.0735 ns | 0.0574 ns | 22.197 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 10 | 22.337 ns | 0.2260 ns | 0.2114 ns | 22.364 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 11 | 23.811 ns | 0.1260 ns | 0.1052 ns | 23.796 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 11 | 23.819 ns | 0.0769 ns | 0.0719 ns | 23.809 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 12 | 25.586 ns | 0.0797 ns | 0.0707 ns | 25.574 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 12 | 25.558 ns | 0.0898 ns | 0.0796 ns | 25.559 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 13 | 27.169 ns | 0.0793 ns | 0.0703 ns | 27.160 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 13 | 27.174 ns | 0.1547 ns | 0.1292 ns | 27.117 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 14 | 28.957 ns | 0.1960 ns | 0.1737 ns | 28.968 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 14 | 29.072 ns | 0.2523 ns | 0.2237 ns | 28.988 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 15 | 30.935 ns | 0.4808 ns | 0.4015 ns | 30.814 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 15 | 30.655 ns | 0.1198 ns | 0.1062 ns | 30.629 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 16 | 35.813 ns | 1.0146 ns | 2.9916 ns | 36.201 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 16 | 32.350 ns | 0.1767 ns | 0.1566 ns | 32.320 ns | 0.91 | 0.08 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 17 | 34.243 ns | 0.2892 ns | 0.2705 ns | 34.160 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 17 | 34.064 ns | 0.1255 ns | 0.1112 ns | 34.064 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 18 | 35.583 ns | 0.1969 ns | 0.1745 ns | 35.562 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 18 | 35.784 ns | 0.1352 ns | 0.1199 ns | 35.800 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 19 | 37.909 ns | 0.7471 ns | 0.7993 ns | 37.585 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 19 | 37.530 ns | 0.1687 ns | 0.1578 ns | 37.519 ns | 0.99 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 20 | 39.243 ns | 0.1422 ns | 0.1330 ns | 39.228 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 20 | 39.426 ns | 0.2247 ns | 0.1992 ns | 39.361 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 30 | 63.002 ns | 0.2112 ns | 0.1764 ns | 62.997 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 30 | 65.206 ns | 1.2478 ns | 1.1061 ns | 65.334 ns | 1.04 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 32 | 77.233 ns | 1.5675 ns | 2.8265 ns | 77.958 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 32 | 74.176 ns | 1.5220 ns | 4.2174 ns | 74.708 ns | 0.97 | 0.07 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 36 | 76.701 ns | 1.5428 ns | 2.4471 ns | 75.445 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 36 | 73.986 ns | 0.3092 ns | 0.2741 ns | 73.994 ns | 0.97 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 37 | 77.157 ns | 1.5706 ns | 1.6129 ns | 76.256 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 37 | 76.747 ns | 0.9947 ns | 1.1056 ns | 76.332 ns | 1.00 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 40 | 94.101 ns | 1.9021 ns | 2.1142 ns | 93.753 ns | 1.00 | 0.00 | - | NA | +| Baseline | ForEach | List | PooledList | 40 | 81.920 ns | 1.0109 ns | 0.8962 ns | 81.665 ns | 0.87 | 0.02 | - | NA | +| Actual | ForEach | List | PooledList | 40 | 82.126 ns | 0.2497 ns | 0.1950 ns | 82.088 ns | 0.87 | 0.02 | - | NA | +| Actual | ForEach | List | PooledList | 40 | 81.877 ns | 0.4354 ns | 0.3400 ns | 81.879 ns | 0.87 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 50 | 114.548 ns | 2.3357 ns | 4.2709 ns | 116.251 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 50 | 97.259 ns | 0.4719 ns | 0.3940 ns | 97.210 ns | 0.85 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 60 | 115.943 ns | 0.4975 ns | 0.4155 ns | 116.023 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 60 | 115.545 ns | 0.6375 ns | 0.5652 ns | 115.333 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 70 | 132.611 ns | 0.8738 ns | 0.7746 ns | 132.364 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 70 | 132.470 ns | 0.6565 ns | 0.5820 ns | 132.474 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 80 | 149.596 ns | 0.8339 ns | 0.6510 ns | 149.639 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 80 | 150.304 ns | 0.7272 ns | 0.6072 ns | 150.155 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 90 | 168.000 ns | 1.5190 ns | 1.3466 ns | 167.437 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 90 | 169.943 ns | 3.3051 ns | 3.3941 ns | 168.897 ns | 1.02 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 100 | 184.615 ns | 0.7075 ns | 0.5908 ns | 184.613 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 100 | 183.936 ns | 0.7194 ns | 0.6729 ns | 184.181 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 128 | 277.400 ns | 5.5602 ns | 10.9753 ns | 279.962 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 128 | 234.935 ns | 3.4783 ns | 2.9045 ns | 233.790 ns | 0.85 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 256 | 463.407 ns | 9.0123 ns | 18.6120 ns | 452.785 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 256 | 448.334 ns | 2.0213 ns | 1.8907 ns | 447.834 ns | 0.95 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 512 | 900.356 ns | 15.5701 ns | 28.0761 ns | 890.155 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 512 | 885.681 ns | 1.9970 ns | 1.8680 ns | 885.209 ns | 0.96 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 1024 | 1,756.976 ns | 3.2978 ns | 3.0848 ns | 1,758.019 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 1024 | 1,749.680 ns | 3.1351 ns | 2.9325 ns | 1,749.040 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 2048 | 3,489.313 ns | 9.7968 ns | 9.1640 ns | 3,486.633 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 2048 | 3,483.028 ns | 6.0058 ns | 5.3240 ns | 3,481.583 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 4096 | 6,979.314 ns | 17.1730 ns | 16.0636 ns | 6,982.885 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 4096 | 8,763.527 ns | 166.6675 ns | 198.4059 ns | 8,845.802 ns | 1.26 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 8192 | 13,908.613 ns | 17.6154 ns | 15.6156 ns | 13,909.135 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 8192 | 13,898.685 ns | 15.3045 ns | 14.3158 ns | 13,894.859 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 16384 | 27,790.455 ns | 49.9030 ns | 44.2377 ns | 27,779.057 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 16384 | 27,824.080 ns | 72.2218 ns | 67.5563 ns | 27,794.858 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 32768 | 55,846.212 ns | 302.0570 ns | 282.5443 ns | 55,830.786 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 32768 | 68,962.246 ns | 1,358.7261 ns | 2,982.4367 ns | 70,118.353 ns | 1.25 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 65536 | 111,530.071 ns | 121.3229 ns | 94.7209 ns | 111,536.230 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 65536 | 111,566.079 ns | 406.3781 ns | 339.3442 ns | 111,462.988 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 131072 | 272,889.139 ns | 5,411.1805 ns | 13,171.5611 ns | 276,588.672 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | PooledList | 131072 | 223,426.717 ns | 466.1160 ns | 436.0052 ns | 223,518.799 ns | 0.81 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | PooledList | 850000 | 1,563,831.628 ns | 4,879.2411 ns | 4,564.0451 ns | 1,562,421.094 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | ForEach | List | PooledList | 850000 | 1,559,869.648 ns | 5,975.4829 ns | 5,589.4704 ns | 1,558,741.211 ns | 1.00 | 0.01 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 0 | 3.897 ns | 0.0079 ns | 0.0061 ns | 3.895 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 0 | 3.889 ns | 0.0093 ns | 0.0073 ns | 3.887 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 1 | 5.196 ns | 0.0596 ns | 0.0558 ns | 5.175 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 1 | 5.105 ns | 0.0202 ns | 0.0158 ns | 5.099 ns | 0.98 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 2 | 6.952 ns | 0.1676 ns | 0.1794 ns | 6.861 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 2 | 6.886 ns | 0.0452 ns | 0.0401 ns | 6.886 ns | 0.99 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 3 | 8.632 ns | 0.1190 ns | 0.1055 ns | 8.586 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 3 | 8.602 ns | 0.1814 ns | 0.2016 ns | 8.557 ns | 0.99 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 4 | 11.269 ns | 0.1537 ns | 0.1363 ns | 11.218 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 4 | 10.469 ns | 0.0791 ns | 0.0701 ns | 10.452 ns | 0.93 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 5 | 12.895 ns | 0.1120 ns | 0.1047 ns | 12.886 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 5 | 11.962 ns | 0.1177 ns | 0.0983 ns | 11.938 ns | 0.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 6 | 15.146 ns | 0.1488 ns | 0.1319 ns | 15.131 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 6 | 13.588 ns | 0.2112 ns | 0.3161 ns | 13.518 ns | 0.91 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 7 | 16.795 ns | 0.1409 ns | 0.1318 ns | 16.789 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 7 | 14.441 ns | 0.2025 ns | 0.1894 ns | 14.401 ns | 0.86 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 8 | 18.400 ns | 0.1146 ns | 0.1016 ns | 18.369 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 8 | 17.857 ns | 0.3822 ns | 0.3191 ns | 17.869 ns | 0.97 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 9 | 20.172 ns | 0.1349 ns | 0.1053 ns | 20.178 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 9 | 18.270 ns | 0.0718 ns | 0.0599 ns | 18.283 ns | 0.91 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 10 | 21.916 ns | 0.0928 ns | 0.0823 ns | 21.928 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 10 | 19.709 ns | 0.0979 ns | 0.0818 ns | 19.701 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 11 | 23.197 ns | 0.0585 ns | 0.0547 ns | 23.196 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 11 | 21.200 ns | 0.0596 ns | 0.0528 ns | 21.219 ns | 0.91 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 12 | 24.881 ns | 0.0510 ns | 0.0477 ns | 24.865 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 12 | 22.752 ns | 0.1361 ns | 0.1136 ns | 22.757 ns | 0.91 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 13 | 26.501 ns | 0.0529 ns | 0.0469 ns | 26.509 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 13 | 24.515 ns | 0.4878 ns | 0.4563 ns | 24.327 ns | 0.93 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 14 | 28.351 ns | 0.1112 ns | 0.1040 ns | 28.341 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 14 | 25.516 ns | 0.1428 ns | 0.1336 ns | 25.543 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 15 | 29.926 ns | 0.1134 ns | 0.1005 ns | 29.942 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 15 | 27.125 ns | 0.0984 ns | 0.0921 ns | 27.089 ns | 0.91 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 16 | 31.825 ns | 0.2127 ns | 0.1886 ns | 31.778 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 16 | 28.624 ns | 0.0813 ns | 0.0721 ns | 28.611 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 17 | 33.454 ns | 0.0703 ns | 0.0549 ns | 33.465 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 17 | 30.075 ns | 0.1216 ns | 0.1138 ns | 30.086 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 18 | 36.200 ns | 0.7540 ns | 1.3976 ns | 35.686 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 18 | 31.591 ns | 0.1500 ns | 0.1330 ns | 31.610 ns | 0.86 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 19 | 36.854 ns | 0.1329 ns | 0.1110 ns | 36.854 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 19 | 32.927 ns | 0.1723 ns | 0.1527 ns | 32.915 ns | 0.89 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 20 | 38.959 ns | 0.5167 ns | 0.4833 ns | 38.720 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 20 | 34.393 ns | 0.0862 ns | 0.0807 ns | 34.391 ns | 0.88 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 30 | 61.256 ns | 0.1077 ns | 0.0954 ns | 61.258 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 30 | 49.502 ns | 0.5085 ns | 0.4756 ns | 49.391 ns | 0.81 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 32 | 64.915 ns | 0.2272 ns | 0.2014 ns | 65.007 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 32 | 58.160 ns | 0.5696 ns | 0.5328 ns | 58.166 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 36 | 72.435 ns | 0.2443 ns | 0.2040 ns | 72.404 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 36 | 62.545 ns | 0.3182 ns | 0.2820 ns | 62.634 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 37 | 74.069 ns | 0.1884 ns | 0.1573 ns | 74.063 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 37 | 64.186 ns | 0.1868 ns | 0.1560 ns | 64.160 ns | 0.87 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 40 | 80.944 ns | 0.4681 ns | 0.4150 ns | 80.941 ns | 1.00 | 0.00 | - | NA | +| Baseline | ForEach | List | RecyclableList | 40 | 82.404 ns | 0.1928 ns | 0.1804 ns | 82.418 ns | 1.02 | 0.01 | - | NA | +| Actual | ForEach | List | RecyclableList | 40 | 69.077 ns | 0.2331 ns | 0.2180 ns | 69.100 ns | 0.85 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 40 | 69.334 ns | 0.2743 ns | 0.2566 ns | 69.322 ns | 0.86 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 50 | 98.201 ns | 0.3462 ns | 0.3069 ns | 98.232 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 50 | 84.078 ns | 0.3052 ns | 0.2548 ns | 84.133 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 60 | 114.693 ns | 0.3332 ns | 0.2953 ns | 114.678 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 60 | 98.711 ns | 0.3461 ns | 0.3237 ns | 98.646 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 70 | 132.078 ns | 0.5282 ns | 0.4941 ns | 132.078 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 70 | 114.073 ns | 0.3592 ns | 0.3184 ns | 113.962 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 80 | 150.952 ns | 1.7599 ns | 1.6462 ns | 150.293 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 80 | 126.950 ns | 0.5323 ns | 0.4719 ns | 126.853 ns | 0.84 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 90 | 166.176 ns | 0.7985 ns | 0.6668 ns | 166.213 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 90 | 141.332 ns | 0.4301 ns | 0.4023 ns | 141.242 ns | 0.85 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 100 | 183.225 ns | 0.7108 ns | 0.6301 ns | 183.186 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 100 | 159.109 ns | 0.4564 ns | 0.3811 ns | 158.983 ns | 0.87 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 128 | 231.789 ns | 0.8625 ns | 0.7203 ns | 231.707 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 128 | 198.749 ns | 1.1534 ns | 1.0225 ns | 198.388 ns | 0.86 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 256 | 526.449 ns | 11.2327 ns | 33.1200 ns | 535.656 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 256 | 387.056 ns | 1.9091 ns | 1.6924 ns | 387.088 ns | 0.76 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 512 | 1,095.189 ns | 21.5183 ns | 38.2488 ns | 1,110.607 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 512 | 757.916 ns | 2.6272 ns | 2.4575 ns | 758.071 ns | 0.70 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 1024 | 1,760.360 ns | 5.3118 ns | 4.7087 ns | 1,760.422 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 1024 | 1,510.912 ns | 5.9692 ns | 5.5836 ns | 1,509.651 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 2048 | 3,502.355 ns | 7.9543 ns | 6.2102 ns | 3,503.366 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 2048 | 3,023.332 ns | 9.8529 ns | 8.7343 ns | 3,023.347 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 4096 | 7,063.648 ns | 37.7039 ns | 35.2683 ns | 7,050.784 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 4096 | 6,017.671 ns | 21.8350 ns | 17.0473 ns | 6,016.796 ns | 0.85 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 8192 | 14,038.772 ns | 112.4703 ns | 99.7020 ns | 14,013.964 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 8192 | 12,272.461 ns | 185.1265 ns | 164.1098 ns | 12,257.167 ns | 0.87 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 16384 | 28,264.346 ns | 152.1960 ns | 142.3642 ns | 28,255.090 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableList | 16384 | 24,144.064 ns | 127.1945 ns | 112.7546 ns | 24,172.777 ns | 0.85 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 32768 | 55,945.263 ns | 217.6655 ns | 203.6044 ns | 55,822.766 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | ForEach | List | RecyclableList | 32768 | 48,280.504 ns | 292.4931 ns | 259.2875 ns | 48,278.644 ns | 0.86 | 0.01 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 65536 | 112,192.360 ns | 549.9817 ns | 459.2596 ns | 112,052.478 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | ForEach | List | RecyclableList | 65536 | 96,424.772 ns | 147.2971 ns | 130.5750 ns | 96,376.611 ns | 0.86 | 0.00 | 2 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 131072 | 280,593.286 ns | 5,557.9140 ns | 7,226.8581 ns | 282,078.113 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | ForEach | List | RecyclableList | 131072 | 193,267.340 ns | 602.3478 ns | 563.4365 ns | 193,258.716 ns | 0.69 | 0.02 | 3 B | 1.50 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableList | 850000 | 1,572,202.204 ns | 15,820.6387 ns | 14,024.5841 ns | 1,565,870.215 ns | 1.00 | 0.00 | 25 B | 1.00 | +| Actual | ForEach | List | RecyclableList | 850000 | 1,336,531.069 ns | 10,898.1858 ns | 9,660.9579 ns | 1,332,973.340 ns | 0.85 | 0.01 | 13 B | 0.52 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 0 | 3.920 ns | 0.0250 ns | 0.0209 ns | 3.912 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 0 | 5.460 ns | 0.0539 ns | 0.0477 ns | 5.455 ns | 1.39 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 1 | 6.337 ns | 0.1552 ns | 0.2915 ns | 6.517 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 1 | 8.225 ns | 0.1055 ns | 0.0987 ns | 8.215 ns | 1.29 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 2 | 7.344 ns | 0.0525 ns | 0.0438 ns | 7.328 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 2 | 11.911 ns | 0.2579 ns | 0.2413 ns | 11.793 ns | 1.62 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 3 | 9.086 ns | 0.0767 ns | 0.0680 ns | 9.058 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 3 | 16.080 ns | 0.3512 ns | 0.7636 ns | 16.058 ns | 1.77 | 0.08 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 4 | 11.257 ns | 0.0390 ns | 0.0326 ns | 11.257 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 4 | 18.643 ns | 0.1277 ns | 0.1066 ns | 18.662 ns | 1.66 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 5 | 13.377 ns | 0.2964 ns | 0.5192 ns | 13.175 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 5 | 23.191 ns | 0.3864 ns | 0.3017 ns | 23.221 ns | 1.77 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 6 | 15.426 ns | 0.0340 ns | 0.0284 ns | 15.425 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 6 | 26.109 ns | 0.2736 ns | 0.2425 ns | 26.118 ns | 1.69 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 7 | 17.238 ns | 0.1991 ns | 0.1663 ns | 17.188 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 7 | 29.406 ns | 0.3434 ns | 0.3212 ns | 29.397 ns | 1.71 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 8 | 18.987 ns | 0.1362 ns | 0.1274 ns | 18.938 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 8 | 32.332 ns | 0.0719 ns | 0.0637 ns | 32.334 ns | 1.70 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 9 | 20.603 ns | 0.1129 ns | 0.1001 ns | 20.592 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 9 | 36.690 ns | 0.4103 ns | 0.3838 ns | 36.684 ns | 1.78 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 10 | 22.547 ns | 0.2141 ns | 0.2003 ns | 22.540 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 10 | 39.811 ns | 0.5537 ns | 0.5179 ns | 39.642 ns | 1.77 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 11 | 24.009 ns | 0.1994 ns | 0.1767 ns | 23.955 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 11 | 43.239 ns | 0.4869 ns | 0.4554 ns | 43.032 ns | 1.80 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 12 | 25.849 ns | 0.2969 ns | 0.2479 ns | 25.848 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 12 | 47.156 ns | 0.9622 ns | 0.9881 ns | 46.710 ns | 1.83 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 13 | 27.538 ns | 0.3519 ns | 0.2748 ns | 27.473 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 13 | 51.656 ns | 1.0328 ns | 2.0145 ns | 50.958 ns | 1.86 | 0.09 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 14 | 33.262 ns | 1.2784 ns | 3.7493 ns | 32.738 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 14 | 55.363 ns | 1.1436 ns | 2.8691 ns | 54.621 ns | 1.71 | 0.23 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 15 | 32.695 ns | 0.9753 ns | 2.7186 ns | 31.360 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 15 | 66.578 ns | 0.8714 ns | 0.7276 ns | 66.439 ns | 1.95 | 0.09 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 16 | 34.387 ns | 0.8336 ns | 2.3783 ns | 33.290 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 16 | 67.789 ns | 0.6828 ns | 0.5702 ns | 67.800 ns | 1.97 | 0.11 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 17 | 36.782 ns | 1.0920 ns | 3.1333 ns | 35.205 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 17 | 71.822 ns | 0.4487 ns | 0.4198 ns | 71.845 ns | 1.94 | 0.19 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 18 | 39.311 ns | 1.0969 ns | 3.2343 ns | 39.106 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 18 | 74.991 ns | 0.5649 ns | 0.5284 ns | 75.072 ns | 1.88 | 0.16 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 19 | 37.563 ns | 0.1247 ns | 0.1042 ns | 37.530 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 19 | 78.368 ns | 0.2849 ns | 0.2665 ns | 78.339 ns | 2.09 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 20 | 39.201 ns | 0.2381 ns | 0.1859 ns | 39.152 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 20 | 81.695 ns | 0.3233 ns | 0.3024 ns | 81.616 ns | 2.08 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 30 | 63.352 ns | 0.4289 ns | 0.3348 ns | 63.300 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 30 | 117.247 ns | 1.3825 ns | 1.2932 ns | 117.002 ns | 1.85 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 32 | 75.545 ns | 1.5398 ns | 3.4755 ns | 76.149 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 32 | 124.538 ns | 2.2596 ns | 2.0031 ns | 124.019 ns | 1.66 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 36 | 73.480 ns | 0.3846 ns | 0.3409 ns | 73.532 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 36 | 138.077 ns | 1.4030 ns | 1.0954 ns | 138.365 ns | 1.88 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 37 | 75.778 ns | 0.4734 ns | 0.4196 ns | 75.679 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 37 | 141.462 ns | 1.8471 ns | 2.8757 ns | 140.394 ns | 1.88 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 40 | 80.076 ns | 0.1433 ns | 0.1119 ns | 80.111 ns | 1.00 | 0.00 | - | NA | +| Baseline | ForEach | List | RecyclableLongList | 40 | 80.585 ns | 0.3080 ns | 0.2405 ns | 80.613 ns | 1.01 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 40 | 167.978 ns | 6.7939 ns | 19.7103 ns | 159.602 ns | 2.03 | 0.08 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 40 | 154.534 ns | 2.5756 ns | 3.4383 ns | 153.739 ns | 1.93 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 50 | 99.272 ns | 1.9526 ns | 1.8264 ns | 98.170 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 50 | 184.432 ns | 1.0074 ns | 0.9423 ns | 184.027 ns | 1.86 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 60 | 113.774 ns | 0.4073 ns | 0.3810 ns | 113.630 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 60 | 219.955 ns | 3.2966 ns | 2.5737 ns | 219.345 ns | 1.93 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 70 | 130.797 ns | 0.6088 ns | 0.5695 ns | 130.696 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 70 | 253.115 ns | 0.3426 ns | 0.3037 ns | 253.111 ns | 1.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 80 | 147.581 ns | 0.3430 ns | 0.3208 ns | 147.562 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 80 | 286.753 ns | 0.7081 ns | 0.6624 ns | 286.741 ns | 1.94 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 850000 | 1,573,933.164 ns | 10,382.2066 ns | 9,711.5225 ns | 1,577,438.672 ns | 1.00 | 0.00 | 25 B | 1.00 | +| Actual | ForEach | List | RecyclableLongList | 850000 | 2,758,170.938 ns | 13,509.0478 ns | 12,636.3717 ns | 2,758,662.109 ns | 1.75 | 0.01 | 27 B | 1.08 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 90 | 164.562 ns | 0.3416 ns | 0.3028 ns | 164.540 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 90 | 321.062 ns | 0.5492 ns | 0.5137 ns | 321.053 ns | 1.95 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 100 | 183.520 ns | 0.6715 ns | 0.6281 ns | 183.629 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 100 | 354.458 ns | 0.7867 ns | 0.6974 ns | 354.207 ns | 1.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 128 | 229.202 ns | 0.9552 ns | 0.8467 ns | 229.057 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 128 | 501.192 ns | 10.0071 ns | 20.8886 ns | 489.900 ns | 2.26 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 256 | 449.720 ns | 1.9807 ns | 1.7558 ns | 449.356 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 256 | 949.606 ns | 2.7887 ns | 2.3287 ns | 949.125 ns | 2.11 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 512 | 884.885 ns | 2.4238 ns | 2.2672 ns | 883.987 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 512 | 1,882.112 ns | 6.2503 ns | 5.8466 ns | 1,880.750 ns | 2.13 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 1024 | 1,755.925 ns | 6.0778 ns | 5.3878 ns | 1,754.101 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 1024 | 3,757.980 ns | 7.7449 ns | 6.8656 ns | 3,759.209 ns | 2.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 2048 | 3,489.102 ns | 4.7328 ns | 3.6951 ns | 3,488.493 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 2048 | 7,465.174 ns | 14.6889 ns | 13.7400 ns | 7,465.691 ns | 2.14 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 4096 | 6,964.136 ns | 9.7275 ns | 8.1229 ns | 6,963.749 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 4096 | 14,998.377 ns | 34.8706 ns | 32.6179 ns | 15,003.624 ns | 2.15 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 8192 | 13,989.232 ns | 37.1075 ns | 34.7104 ns | 13,992.447 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 8192 | 29,963.563 ns | 70.8338 ns | 66.2579 ns | 29,977.522 ns | 2.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 16384 | 27,921.346 ns | 78.0018 ns | 69.1466 ns | 27,926.756 ns | 1.00 | 0.00 | - | NA | +| Actual | ForEach | List | RecyclableLongList | 16384 | 52,494.696 ns | 100.1860 ns | 88.8123 ns | 52,480.118 ns | 1.88 | 0.01 | 1 B | NA | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 32768 | 56,019.953 ns | 186.8463 ns | 174.7761 ns | 56,023.074 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | ForEach | List | RecyclableLongList | 32768 | 104,678.256 ns | 170.7997 ns | 133.3492 ns | 104,692.169 ns | 1.87 | 0.01 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 65536 | 111,453.854 ns | 190.9286 ns | 169.2533 ns | 111,418.707 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | ForEach | List | RecyclableLongList | 65536 | 209,495.001 ns | 241.5080 ns | 201.6701 ns | 209,501.685 ns | 1.88 | 0.00 | 2 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | ForEach | List | RecyclableLongList | 131072 | 223,323.181 ns | 411.2504 ns | 321.0773 ns | 223,244.727 ns | 1.00 | 0.00 | 3 B | 1.00 | +| Actual | ForEach | List | RecyclableLongList | 131072 | 419,358.031 ns | 847.6060 ns | 792.8511 ns | 419,270.996 ns | 1.88 | 0.00 | 6 B | 2.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 0 | 3.459 ns | 0.0083 ns | 0.0074 ns | 3.458 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 0 | 3.414 ns | 0.0063 ns | 0.0049 ns | 3.415 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 1 | 5.598 ns | 0.0098 ns | 0.0087 ns | 5.597 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 1 | 4.159 ns | 0.0188 ns | 0.0166 ns | 4.150 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 2 | 7.322 ns | 0.0226 ns | 0.0211 ns | 7.323 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 2 | 5.397 ns | 0.0166 ns | 0.0156 ns | 5.403 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 3 | 9.622 ns | 0.2214 ns | 0.3992 ns | 9.909 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 3 | 6.555 ns | 0.0123 ns | 0.0103 ns | 6.558 ns | 0.70 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 4 | 11.165 ns | 0.0420 ns | 0.0351 ns | 11.158 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 4 | 7.777 ns | 0.0215 ns | 0.0191 ns | 7.783 ns | 0.70 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 5 | 12.944 ns | 0.2631 ns | 0.2054 ns | 12.855 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 5 | 9.448 ns | 0.0127 ns | 0.0099 ns | 9.448 ns | 0.73 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 6 | 15.447 ns | 0.0263 ns | 0.0233 ns | 15.449 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 6 | 10.691 ns | 0.0227 ns | 0.0201 ns | 10.685 ns | 0.69 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 7 | 17.175 ns | 0.3306 ns | 0.2761 ns | 17.059 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 7 | 12.128 ns | 0.0218 ns | 0.0204 ns | 12.122 ns | 0.71 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 8 | 18.742 ns | 0.1322 ns | 0.1237 ns | 18.742 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 8 | 13.691 ns | 0.0573 ns | 0.0536 ns | 13.683 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 9 | 20.333 ns | 0.1336 ns | 0.1043 ns | 20.301 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 9 | 14.920 ns | 0.0419 ns | 0.0392 ns | 14.929 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 10 | 21.936 ns | 0.0668 ns | 0.0625 ns | 21.952 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 10 | 16.090 ns | 0.0328 ns | 0.0290 ns | 16.095 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 11 | 23.578 ns | 0.0768 ns | 0.0681 ns | 23.558 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 11 | 17.313 ns | 0.0652 ns | 0.0610 ns | 17.313 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 12 | 25.293 ns | 0.0790 ns | 0.0739 ns | 25.286 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 12 | 18.661 ns | 0.0953 ns | 0.0892 ns | 18.668 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 13 | 27.034 ns | 0.1284 ns | 0.1072 ns | 27.011 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 13 | 19.841 ns | 0.0598 ns | 0.0559 ns | 19.840 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 14 | 28.757 ns | 0.1096 ns | 0.1025 ns | 28.752 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 14 | 21.150 ns | 0.1013 ns | 0.0948 ns | 21.159 ns | 0.74 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 15 | 32.964 ns | 0.8554 ns | 2.5222 ns | 32.617 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 15 | 22.282 ns | 0.0914 ns | 0.0810 ns | 22.287 ns | 0.66 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 16 | 32.237 ns | 0.1148 ns | 0.1074 ns | 32.206 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 16 | 23.180 ns | 0.0366 ns | 0.0342 ns | 23.177 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 17 | 36.880 ns | 0.9614 ns | 2.8346 ns | 36.745 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 17 | 24.494 ns | 0.0758 ns | 0.0709 ns | 24.478 ns | 0.66 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 18 | 35.417 ns | 0.0485 ns | 0.0405 ns | 35.428 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 18 | 25.609 ns | 0.0434 ns | 0.0385 ns | 25.594 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 19 | 37.214 ns | 0.1201 ns | 0.1124 ns | 37.197 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 19 | 26.810 ns | 0.0352 ns | 0.0312 ns | 26.811 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 20 | 38.848 ns | 0.0831 ns | 0.0777 ns | 38.813 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 20 | 28.030 ns | 0.0600 ns | 0.0501 ns | 28.020 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 30 | 62.232 ns | 0.1485 ns | 0.1240 ns | 62.264 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 30 | 40.197 ns | 0.1378 ns | 0.1289 ns | 40.184 ns | 0.65 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 32 | 66.695 ns | 0.2586 ns | 0.2292 ns | 66.676 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 32 | 49.723 ns | 0.4063 ns | 0.3801 ns | 49.735 ns | 0.74 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 36 | 74.231 ns | 1.3120 ns | 2.0810 ns | 73.333 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 36 | 53.480 ns | 0.1465 ns | 0.1298 ns | 53.422 ns | 0.72 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 37 | 75.223 ns | 0.3723 ns | 0.2906 ns | 75.211 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 37 | 54.955 ns | 0.0965 ns | 0.0805 ns | 54.949 ns | 0.73 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 40 | 80.632 ns | 0.2132 ns | 0.1665 ns | 80.611 ns | 1.00 | 0.00 | - | NA | +| Baseline | VersionedForEach | List | Array | 40 | 80.928 ns | 0.3209 ns | 0.2845 ns | 81.016 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 40 | 57.571 ns | 0.1620 ns | 0.1516 ns | 57.550 ns | 0.71 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 40 | 57.567 ns | 0.2715 ns | 0.2540 ns | 57.480 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 50 | 98.337 ns | 0.4607 ns | 0.3847 ns | 98.234 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 50 | 69.918 ns | 0.3088 ns | 0.2888 ns | 69.902 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 60 | 114.727 ns | 0.3872 ns | 0.3432 ns | 114.731 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 60 | 82.549 ns | 0.2423 ns | 0.2266 ns | 82.606 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 70 | 131.907 ns | 0.3786 ns | 0.3161 ns | 131.899 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 70 | 94.562 ns | 0.2713 ns | 0.2538 ns | 94.563 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 80 | 148.123 ns | 0.4904 ns | 0.4347 ns | 148.048 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 80 | 105.933 ns | 0.2151 ns | 0.1797 ns | 105.988 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 90 | 164.847 ns | 0.5387 ns | 0.5039 ns | 164.889 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 90 | 117.819 ns | 0.3778 ns | 0.3534 ns | 117.754 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 100 | 182.306 ns | 0.5262 ns | 0.4108 ns | 182.398 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 100 | 129.732 ns | 0.1857 ns | 0.1737 ns | 129.709 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 128 | 229.294 ns | 0.5763 ns | 0.5109 ns | 229.472 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 128 | 163.568 ns | 0.4130 ns | 0.3661 ns | 163.544 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 256 | 447.474 ns | 1.0745 ns | 1.0050 ns | 447.656 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 256 | 317.788 ns | 0.7944 ns | 0.7431 ns | 317.833 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 512 | 879.350 ns | 2.0729 ns | 1.8375 ns | 878.595 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 512 | 626.624 ns | 1.5525 ns | 1.4522 ns | 626.585 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 1024 | 1,750.301 ns | 3.1932 ns | 2.9869 ns | 1,750.540 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 1024 | 1,244.438 ns | 2.3394 ns | 2.0739 ns | 1,244.519 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 2048 | 3,480.663 ns | 8.0170 ns | 6.6946 ns | 3,479.336 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 2048 | 2,486.001 ns | 3.2825 ns | 2.7410 ns | 2,485.112 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 4096 | 6,960.781 ns | 18.3644 ns | 17.1781 ns | 6,958.032 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 4096 | 4,968.435 ns | 9.0030 ns | 8.4214 ns | 4,967.094 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 8192 | 13,906.199 ns | 39.5137 ns | 36.9612 ns | 13,891.061 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 8192 | 9,922.030 ns | 16.2379 ns | 15.1890 ns | 9,917.949 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 16384 | 27,826.960 ns | 74.5928 ns | 69.7741 ns | 27,804.218 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 16384 | 19,859.062 ns | 41.2759 ns | 38.6095 ns | 19,862.294 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 32768 | 55,708.288 ns | 123.8257 ns | 96.6750 ns | 55,745.242 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 32768 | 39,844.087 ns | 89.7389 ns | 83.9418 ns | 39,847.931 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 65536 | 111,636.830 ns | 295.5719 ns | 276.4781 ns | 111,597.668 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 65536 | 79,441.596 ns | 126.6409 ns | 112.2638 ns | 79,425.519 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 131072 | 223,460.151 ns | 552.9382 ns | 490.1653 ns | 223,465.381 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | Array | 131072 | 159,437.563 ns | 498.6698 ns | 466.4560 ns | 159,408.081 ns | 0.71 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | Array | 850000 | 1,573,075.240 ns | 3,515.9662 ns | 2,935.9910 ns | 1,572,922.656 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | VersionedForEach | List | Array | 850000 | 1,112,052.201 ns | 4,512.3840 ns | 4,220.8868 ns | 1,111,925.391 ns | 0.71 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 0 | 3.605 ns | 0.0999 ns | 0.1367 ns | 3.547 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 0 | 3.387 ns | 0.0478 ns | 0.0447 ns | 3.375 ns | 0.94 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 1 | 5.572 ns | 0.0273 ns | 0.0256 ns | 5.562 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 1 | 5.754 ns | 0.0797 ns | 0.0622 ns | 5.742 ns | 1.03 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 2 | 7.342 ns | 0.0333 ns | 0.0296 ns | 7.343 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 2 | 7.338 ns | 0.0370 ns | 0.0328 ns | 7.330 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 3 | 9.520 ns | 0.2201 ns | 0.3678 ns | 9.441 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 3 | 9.495 ns | 0.2189 ns | 0.4712 ns | 9.249 ns | 1.01 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 4 | 11.648 ns | 0.1662 ns | 0.1474 ns | 11.676 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 4 | 11.274 ns | 0.1642 ns | 0.1371 ns | 11.240 ns | 0.97 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 5 | 13.066 ns | 0.2624 ns | 0.2326 ns | 12.992 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 5 | 13.068 ns | 0.1415 ns | 0.1105 ns | 13.038 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 6 | 16.836 ns | 0.4463 ns | 1.2805 ns | 16.484 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 6 | 15.372 ns | 0.0496 ns | 0.0439 ns | 15.366 ns | 0.90 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 7 | 17.412 ns | 0.3740 ns | 0.6249 ns | 17.154 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 7 | 17.030 ns | 0.1402 ns | 0.1311 ns | 17.057 ns | 0.97 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 8 | 19.288 ns | 0.3984 ns | 1.0839 ns | 18.725 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 8 | 18.846 ns | 0.1664 ns | 0.1389 ns | 18.807 ns | 0.97 | 0.07 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 9 | 20.307 ns | 0.1793 ns | 0.1498 ns | 20.339 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 9 | 20.516 ns | 0.1498 ns | 0.1169 ns | 20.501 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 10 | 22.189 ns | 0.1822 ns | 0.1422 ns | 22.153 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 10 | 22.166 ns | 0.1267 ns | 0.1058 ns | 22.165 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 11 | 23.817 ns | 0.1630 ns | 0.1273 ns | 23.791 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 11 | 24.184 ns | 0.5098 ns | 0.5870 ns | 23.968 ns | 1.01 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 12 | 26.862 ns | 0.6210 ns | 1.7515 ns | 26.071 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 12 | 26.073 ns | 0.5135 ns | 0.9390 ns | 25.633 ns | 0.96 | 0.07 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 13 | 27.434 ns | 0.5770 ns | 0.4818 ns | 27.261 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 13 | 27.357 ns | 0.1410 ns | 0.1178 ns | 27.379 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 14 | 29.172 ns | 0.6069 ns | 0.5961 ns | 28.998 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 14 | 29.223 ns | 0.1778 ns | 0.1664 ns | 29.209 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 15 | 31.018 ns | 0.2327 ns | 0.2063 ns | 30.959 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 15 | 30.791 ns | 0.1933 ns | 0.1808 ns | 30.722 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 16 | 32.697 ns | 0.4948 ns | 0.5499 ns | 32.438 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 16 | 32.477 ns | 0.3344 ns | 0.2792 ns | 32.395 ns | 0.99 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 17 | 34.414 ns | 0.5702 ns | 0.5855 ns | 34.231 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 17 | 34.495 ns | 0.6197 ns | 0.7837 ns | 34.140 ns | 1.01 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 18 | 35.883 ns | 0.3110 ns | 0.2428 ns | 35.813 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 18 | 35.834 ns | 0.2171 ns | 0.1813 ns | 35.837 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 19 | 37.951 ns | 0.6024 ns | 0.5030 ns | 37.717 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 19 | 37.936 ns | 0.3289 ns | 0.2916 ns | 37.852 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 20 | 39.294 ns | 0.1403 ns | 0.1243 ns | 39.267 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 20 | 39.747 ns | 0.3799 ns | 0.3368 ns | 39.767 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 30 | 63.651 ns | 1.2614 ns | 1.1182 ns | 63.192 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 30 | 64.080 ns | 0.2043 ns | 0.1911 ns | 64.072 ns | 1.01 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 32 | 76.701 ns | 1.5564 ns | 1.9683 ns | 76.991 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 32 | 75.454 ns | 1.6036 ns | 4.7283 ns | 77.656 ns | 0.97 | 0.07 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 36 | 73.477 ns | 0.4009 ns | 0.3130 ns | 73.432 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 36 | 73.728 ns | 0.3577 ns | 0.3346 ns | 73.750 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 37 | 77.769 ns | 1.5771 ns | 2.1053 ns | 77.206 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 37 | 76.266 ns | 0.2876 ns | 0.2402 ns | 76.303 ns | 0.98 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 40 | 82.670 ns | 1.0862 ns | 0.9070 ns | 82.414 ns | 1.00 | 0.00 | - | NA | +| Baseline | VersionedForEach | List | PooledList | 40 | 81.617 ns | 0.8529 ns | 0.7122 ns | 81.854 ns | 0.99 | 0.01 | - | NA | +| Actual | VersionedForEach | List | PooledList | 40 | 81.777 ns | 0.2407 ns | 0.2133 ns | 81.772 ns | 0.99 | 0.01 | - | NA | +| Actual | VersionedForEach | List | PooledList | 40 | 81.803 ns | 0.7038 ns | 0.6239 ns | 81.637 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 50 | 100.467 ns | 1.6927 ns | 1.5005 ns | 99.658 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 50 | 99.949 ns | 0.8722 ns | 0.6810 ns | 100.174 ns | 0.99 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 60 | 116.896 ns | 1.1950 ns | 1.0593 ns | 117.067 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 60 | 116.487 ns | 0.9138 ns | 0.8101 ns | 116.381 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 70 | 132.761 ns | 0.7028 ns | 0.6230 ns | 132.723 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 70 | 133.131 ns | 0.8565 ns | 0.8012 ns | 133.131 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 80 | 150.716 ns | 1.4505 ns | 1.1324 ns | 150.515 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 80 | 153.492 ns | 2.9405 ns | 7.1575 ns | 150.261 ns | 1.06 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 90 | 167.783 ns | 0.4266 ns | 0.3562 ns | 167.768 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 90 | 166.777 ns | 0.5967 ns | 0.5290 ns | 166.843 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 100 | 188.789 ns | 3.5107 ns | 6.9297 ns | 186.205 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 100 | 194.927 ns | 3.9297 ns | 10.8892 ns | 190.716 ns | 1.02 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 128 | 233.435 ns | 3.2857 ns | 2.5653 ns | 232.631 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 128 | 231.886 ns | 2.1358 ns | 1.7835 ns | 231.022 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 256 | 458.486 ns | 8.3274 ns | 9.9132 ns | 453.806 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 256 | 456.333 ns | 8.9321 ns | 8.7725 ns | 451.573 ns | 0.99 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 512 | 894.050 ns | 12.9499 ns | 11.4797 ns | 891.104 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 512 | 894.210 ns | 9.5158 ns | 7.9461 ns | 893.481 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 1024 | 1,794.834 ns | 32.5101 ns | 45.5747 ns | 1,776.326 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 1024 | 1,825.100 ns | 36.4056 ns | 68.3786 ns | 1,792.576 ns | 1.03 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 2048 | 3,532.782 ns | 15.0793 ns | 13.3674 ns | 3,533.941 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 2048 | 4,264.741 ns | 85.1196 ns | 207.1929 ns | 4,304.190 ns | 1.18 | 0.07 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 4096 | 7,293.178 ns | 144.5093 ns | 307.9610 ns | 7,130.396 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 4096 | 8,783.656 ns | 252.4283 ns | 744.2904 ns | 8,849.936 ns | 1.18 | 0.10 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 8192 | 14,100.054 ns | 51.6807 ns | 48.3422 ns | 14,090.756 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 8192 | 14,046.596 ns | 51.0810 ns | 42.6550 ns | 14,043.178 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 16384 | 28,099.603 ns | 173.2258 ns | 162.0355 ns | 28,026.727 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 16384 | 28,120.424 ns | 185.9701 ns | 145.1932 ns | 28,132.475 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 32768 | 56,662.055 ns | 777.0712 ns | 606.6861 ns | 56,564.575 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 32768 | 56,011.725 ns | 350.9919 ns | 293.0941 ns | 55,856.506 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 65536 | 113,660.577 ns | 1,531.6562 ns | 2,559.0534 ns | 112,542.786 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 65536 | 112,241.287 ns | 243.4347 ns | 227.7089 ns | 112,286.365 ns | 0.97 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 131072 | 225,908.205 ns | 599.1738 ns | 467.7955 ns | 225,927.820 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | PooledList | 131072 | 227,601.839 ns | 4,023.6698 ns | 3,763.7432 ns | 226,865.747 ns | 1.01 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | PooledList | 850000 | 1,582,789.760 ns | 21,303.7920 ns | 18,885.2567 ns | 1,577,323.242 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | VersionedForEach | List | PooledList | 850000 | 1,664,077.398 ns | 42,919.4063 ns | 124,516.9800 ns | 1,599,284.570 ns | 1.12 | 0.08 | 2 B | 2.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 0 | 3.970 ns | 0.0621 ns | 0.0580 ns | 3.950 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 0 | 3.698 ns | 0.0247 ns | 0.0231 ns | 3.691 ns | 0.93 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 1 | 5.259 ns | 0.0353 ns | 0.0295 ns | 5.255 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 1 | 5.039 ns | 0.0851 ns | 0.0796 ns | 5.020 ns | 0.96 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 2 | 6.904 ns | 0.0501 ns | 0.0419 ns | 6.911 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 2 | 6.440 ns | 0.1260 ns | 0.0984 ns | 6.430 ns | 0.93 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 3 | 8.567 ns | 0.0087 ns | 0.0073 ns | 8.568 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 3 | 8.208 ns | 0.1509 ns | 0.1260 ns | 8.158 ns | 0.96 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 4 | 11.028 ns | 0.1305 ns | 0.1221 ns | 10.974 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 4 | 10.133 ns | 0.1201 ns | 0.1065 ns | 10.182 ns | 0.92 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 5 | 12.580 ns | 0.0143 ns | 0.0127 ns | 12.576 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 5 | 11.299 ns | 0.1078 ns | 0.0842 ns | 11.272 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 6 | 14.986 ns | 0.0576 ns | 0.0539 ns | 15.006 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 6 | 12.754 ns | 0.0489 ns | 0.0457 ns | 12.745 ns | 0.85 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 7 | 16.643 ns | 0.0644 ns | 0.0602 ns | 16.635 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 7 | 14.213 ns | 0.0508 ns | 0.0451 ns | 14.201 ns | 0.85 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 8 | 18.626 ns | 0.2364 ns | 0.1845 ns | 18.583 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 8 | 17.240 ns | 0.3647 ns | 0.3233 ns | 17.230 ns | 0.93 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 9 | 21.199 ns | 0.3213 ns | 0.2683 ns | 21.155 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 9 | 17.922 ns | 0.0993 ns | 0.0929 ns | 17.913 ns | 0.85 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 10 | 21.629 ns | 0.0608 ns | 0.0568 ns | 21.619 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 10 | 19.547 ns | 0.1213 ns | 0.1134 ns | 19.529 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 11 | 23.106 ns | 0.0150 ns | 0.0133 ns | 23.105 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 11 | 20.744 ns | 0.1304 ns | 0.1156 ns | 20.712 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 12 | 25.102 ns | 0.1648 ns | 0.1461 ns | 25.053 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 12 | 22.379 ns | 0.0827 ns | 0.0646 ns | 22.389 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 13 | 26.654 ns | 0.0997 ns | 0.0884 ns | 26.643 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 13 | 23.560 ns | 0.0891 ns | 0.0833 ns | 23.543 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 14 | 28.335 ns | 0.1547 ns | 0.1447 ns | 28.326 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 14 | 25.344 ns | 0.1841 ns | 0.1722 ns | 25.330 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 15 | 30.100 ns | 0.1335 ns | 0.1249 ns | 30.060 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 15 | 26.750 ns | 0.2399 ns | 0.2244 ns | 26.862 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 16 | 31.844 ns | 0.1452 ns | 0.1213 ns | 31.829 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 16 | 28.104 ns | 0.0794 ns | 0.0743 ns | 28.124 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 17 | 33.357 ns | 0.0597 ns | 0.0529 ns | 33.336 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 17 | 29.440 ns | 0.1494 ns | 0.1324 ns | 29.417 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 18 | 35.044 ns | 0.0607 ns | 0.0568 ns | 35.030 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 18 | 30.911 ns | 0.1060 ns | 0.0992 ns | 30.916 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 19 | 37.121 ns | 0.7513 ns | 0.6273 ns | 36.931 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 19 | 32.346 ns | 0.0841 ns | 0.0746 ns | 32.317 ns | 0.87 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 20 | 38.447 ns | 0.0932 ns | 0.0871 ns | 38.450 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 20 | 34.287 ns | 0.2641 ns | 0.2342 ns | 34.184 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 30 | 61.889 ns | 0.1697 ns | 0.1505 ns | 61.884 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 30 | 49.046 ns | 0.0953 ns | 0.0845 ns | 49.051 ns | 0.79 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 32 | 65.466 ns | 0.4431 ns | 0.4145 ns | 65.319 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 32 | 60.715 ns | 0.4172 ns | 0.3902 ns | 60.708 ns | 0.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 36 | 72.866 ns | 0.3567 ns | 0.2978 ns | 72.726 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 36 | 65.051 ns | 0.1252 ns | 0.1046 ns | 65.020 ns | 0.89 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 37 | 75.597 ns | 0.3195 ns | 0.2494 ns | 75.523 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 37 | 66.475 ns | 0.2530 ns | 0.2366 ns | 66.528 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 40 | 80.759 ns | 0.3199 ns | 0.2671 ns | 80.718 ns | 1.00 | 0.00 | - | NA | +| Baseline | VersionedForEach | List | RecyclableList | 40 | 81.291 ns | 0.5024 ns | 0.4700 ns | 81.161 ns | 1.01 | 0.01 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 40 | 71.530 ns | 0.4066 ns | 0.3803 ns | 71.693 ns | 0.88 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 40 | 71.414 ns | 0.5790 ns | 0.5416 ns | 71.294 ns | 0.88 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 50 | 99.816 ns | 0.4537 ns | 0.3789 ns | 99.952 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 50 | 87.417 ns | 0.6406 ns | 0.5992 ns | 87.357 ns | 0.88 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 60 | 115.992 ns | 1.0125 ns | 0.8455 ns | 115.652 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 60 | 102.011 ns | 0.7450 ns | 0.6969 ns | 101.928 ns | 0.88 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 70 | 132.989 ns | 0.5903 ns | 0.5522 ns | 132.996 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 70 | 117.603 ns | 0.3780 ns | 0.3156 ns | 117.497 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 80 | 149.451 ns | 0.3851 ns | 0.3215 ns | 149.447 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 80 | 133.267 ns | 0.2987 ns | 0.2794 ns | 133.162 ns | 0.89 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 90 | 167.282 ns | 1.7481 ns | 1.4598 ns | 166.837 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 90 | 144.890 ns | 1.1595 ns | 1.0846 ns | 145.010 ns | 0.87 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 100 | 185.299 ns | 1.6608 ns | 1.5535 ns | 184.837 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 100 | 159.926 ns | 1.0142 ns | 0.8990 ns | 159.666 ns | 0.86 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 128 | 231.879 ns | 0.7997 ns | 0.7480 ns | 231.647 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 128 | 207.422 ns | 1.1795 ns | 1.0456 ns | 207.111 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 256 | 449.530 ns | 1.2971 ns | 1.0831 ns | 449.234 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 256 | 405.314 ns | 1.1871 ns | 0.9913 ns | 405.506 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 512 | 885.864 ns | 1.6311 ns | 1.4459 ns | 885.790 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 512 | 800.319 ns | 3.0087 ns | 2.8144 ns | 799.416 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 1024 | 1,756.501 ns | 6.5592 ns | 6.1355 ns | 1,754.186 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 1024 | 1,587.746 ns | 3.6591 ns | 3.0555 ns | 1,587.691 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 2048 | 3,500.671 ns | 10.6725 ns | 9.9830 ns | 3,498.656 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 2048 | 3,027.481 ns | 6.4349 ns | 5.7044 ns | 3,027.135 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 4096 | 7,005.156 ns | 21.9654 ns | 19.4717 ns | 6,999.719 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 4096 | 6,369.114 ns | 23.6503 ns | 22.1225 ns | 6,372.867 ns | 0.91 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 8192 | 14,029.178 ns | 57.5448 ns | 51.0119 ns | 14,022.577 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 8192 | 12,686.859 ns | 21.2945 ns | 18.8770 ns | 12,688.882 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 16384 | 28,901.182 ns | 535.1923 ns | 500.6192 ns | 29,047.418 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableList | 16384 | 24,076.728 ns | 55.7596 ns | 52.1575 ns | 24,056.700 ns | 0.83 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 32768 | 55,884.292 ns | 151.2645 ns | 141.4929 ns | 55,834.592 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableList | 32768 | 48,089.367 ns | 115.6123 ns | 108.1438 ns | 48,102.243 ns | 0.86 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 65536 | 111,826.643 ns | 298.9380 ns | 279.6268 ns | 111,823.712 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableList | 65536 | 96,053.915 ns | 304.9875 ns | 285.2855 ns | 96,019.458 ns | 0.86 | 0.00 | 1 B | 0.50 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 131072 | 222,706.154 ns | 228.2825 ns | 202.3665 ns | 222,666.797 ns | 1.00 | 0.00 | 3 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableList | 131072 | 201,764.692 ns | 366.2813 ns | 342.6197 ns | 201,802.710 ns | 0.91 | 0.00 | 3 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableList | 850000 | 1,548,234.675 ns | 3,936.0544 ns | 3,286.7837 ns | 1,547,516.992 ns | 1.00 | 0.00 | 13 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableList | 850000 | 1,391,042.746 ns | 3,695.1426 ns | 3,275.6477 ns | 1,390,745.801 ns | 0.90 | 0.00 | 13 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 0 | 3.892 ns | 0.0148 ns | 0.0138 ns | 3.887 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 0 | 9.195 ns | 0.0173 ns | 0.0144 ns | 9.192 ns | 2.36 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 1 | 5.705 ns | 0.1444 ns | 0.1827 ns | 5.598 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 1 | 13.761 ns | 0.1153 ns | 0.1022 ns | 13.743 ns | 2.38 | 0.08 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 2 | 7.425 ns | 0.1245 ns | 0.1103 ns | 7.397 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 2 | 18.689 ns | 0.3886 ns | 0.4772 ns | 18.674 ns | 2.51 | 0.08 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 3 | 9.111 ns | 0.0666 ns | 0.0556 ns | 9.087 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 3 | 21.205 ns | 0.2487 ns | 0.2077 ns | 21.150 ns | 2.33 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 4 | 11.537 ns | 0.2177 ns | 0.3258 ns | 11.430 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 4 | 26.664 ns | 0.5420 ns | 0.5070 ns | 26.367 ns | 2.32 | 0.09 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 5 | 12.928 ns | 0.0483 ns | 0.0429 ns | 12.929 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 5 | 28.802 ns | 0.4856 ns | 0.4055 ns | 28.648 ns | 2.23 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 6 | 15.460 ns | 0.0850 ns | 0.0710 ns | 15.460 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 6 | 32.974 ns | 0.5162 ns | 0.4310 ns | 32.935 ns | 2.13 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 7 | 17.443 ns | 0.3691 ns | 0.4394 ns | 17.203 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 7 | 36.249 ns | 0.1810 ns | 0.1605 ns | 36.207 ns | 2.06 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 8 | 18.841 ns | 0.0582 ns | 0.0545 ns | 18.821 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 8 | 42.655 ns | 0.0629 ns | 0.0557 ns | 42.640 ns | 2.26 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 9 | 20.517 ns | 0.0983 ns | 0.0821 ns | 20.526 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 9 | 43.668 ns | 0.2121 ns | 0.1656 ns | 43.622 ns | 2.13 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 10 | 22.881 ns | 0.4856 ns | 0.8245 ns | 22.553 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 10 | 48.475 ns | 0.7929 ns | 0.8143 ns | 48.224 ns | 2.10 | 0.10 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 11 | 23.744 ns | 0.2731 ns | 0.2280 ns | 23.666 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 11 | 52.220 ns | 1.0756 ns | 1.0061 ns | 51.834 ns | 2.20 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 12 | 25.488 ns | 0.1728 ns | 0.1349 ns | 25.474 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 12 | 55.805 ns | 1.1427 ns | 1.6019 ns | 55.199 ns | 2.19 | 0.07 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 13 | 27.620 ns | 0.5020 ns | 0.8248 ns | 27.260 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 13 | 59.417 ns | 1.1487 ns | 1.1281 ns | 59.065 ns | 2.13 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 14 | 29.092 ns | 0.4776 ns | 0.4690 ns | 28.971 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 14 | 62.957 ns | 0.5410 ns | 0.4517 ns | 62.894 ns | 2.16 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 15 | 30.958 ns | 0.2021 ns | 0.1578 ns | 30.915 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 15 | 74.870 ns | 0.2460 ns | 0.2181 ns | 74.813 ns | 2.42 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 16 | 32.522 ns | 0.1811 ns | 0.1694 ns | 32.450 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 16 | 84.531 ns | 0.2799 ns | 0.2337 ns | 84.556 ns | 2.60 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 17 | 34.320 ns | 0.3562 ns | 0.2974 ns | 34.276 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 17 | 82.366 ns | 0.1660 ns | 0.1386 ns | 82.364 ns | 2.40 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 18 | 36.846 ns | 0.7708 ns | 1.6920 ns | 35.953 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 18 | 87.370 ns | 1.1269 ns | 0.9989 ns | 87.418 ns | 2.34 | 0.12 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 19 | 38.133 ns | 0.7924 ns | 0.8479 ns | 37.688 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 19 | 91.029 ns | 1.0657 ns | 1.0944 ns | 90.832 ns | 2.39 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 20 | 38.930 ns | 0.2271 ns | 0.1773 ns | 38.943 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 20 | 93.896 ns | 0.2301 ns | 0.2152 ns | 93.971 ns | 2.41 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 30 | 64.492 ns | 1.0191 ns | 1.0009 ns | 64.187 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 30 | 131.506 ns | 0.2769 ns | 0.2455 ns | 131.484 ns | 2.04 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 32 | 66.829 ns | 0.3134 ns | 0.2446 ns | 66.740 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 32 | 150.896 ns | 0.4918 ns | 0.4360 ns | 150.773 ns | 2.26 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 36 | 73.890 ns | 0.1679 ns | 0.1311 ns | 73.896 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 36 | 161.593 ns | 1.8099 ns | 1.6044 ns | 161.146 ns | 2.19 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 37 | 76.400 ns | 1.4287 ns | 1.1930 ns | 75.961 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 37 | 166.064 ns | 1.3873 ns | 1.2298 ns | 166.015 ns | 2.17 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 40 | 81.358 ns | 1.6145 ns | 1.5857 ns | 80.539 ns | 1.00 | 0.00 | - | NA | +| Baseline | VersionedForEach | List | RecyclableLongList | 40 | 80.915 ns | 0.2279 ns | 0.2020 ns | 80.946 ns | 0.99 | 0.02 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 40 | 177.865 ns | 3.2432 ns | 3.4702 ns | 176.419 ns | 2.19 | 0.07 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 40 | 182.822 ns | 3.7111 ns | 9.0334 ns | 178.670 ns | 2.27 | 0.11 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 50 | 98.457 ns | 1.6879 ns | 1.4963 ns | 97.915 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 50 | 214.826 ns | 0.9471 ns | 0.7909 ns | 214.598 ns | 2.18 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 60 | 115.088 ns | 1.4579 ns | 1.2924 ns | 114.847 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 60 | 254.172 ns | 0.8529 ns | 0.7978 ns | 254.217 ns | 2.21 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 70 | 134.907 ns | 2.7435 ns | 4.2713 ns | 132.610 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 70 | 296.318 ns | 3.1690 ns | 2.6463 ns | 295.252 ns | 2.16 | 0.09 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 80 | 148.501 ns | 2.3051 ns | 1.9249 ns | 147.798 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 80 | 333.637 ns | 1.8319 ns | 1.6239 ns | 333.909 ns | 2.25 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 90 | 164.902 ns | 0.4841 ns | 0.4528 ns | 164.677 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 90 | 369.672 ns | 1.0978 ns | 1.0269 ns | 369.473 ns | 2.24 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 100 | 182.416 ns | 0.8974 ns | 0.8394 ns | 181.986 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 100 | 410.274 ns | 2.9707 ns | 2.4807 ns | 409.657 ns | 2.25 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 128 | 230.809 ns | 1.7505 ns | 1.4618 ns | 230.290 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 128 | 555.014 ns | 7.4810 ns | 6.6317 ns | 552.155 ns | 2.41 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 256 | 449.877 ns | 4.7384 ns | 3.9568 ns | 448.399 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 256 | 1,090.100 ns | 17.6323 ns | 13.7662 ns | 1,086.062 ns | 2.42 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 512 | 885.586 ns | 3.7142 ns | 3.1015 ns | 885.514 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 512 | 2,160.387 ns | 21.7008 ns | 19.2372 ns | 2,156.652 ns | 2.44 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 1024 | 1,773.035 ns | 8.2086 ns | 7.2767 ns | 1,772.021 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 1024 | 4,299.115 ns | 17.5837 ns | 16.4478 ns | 4,300.156 ns | 2.42 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 2048 | 3,513.094 ns | 9.0646 ns | 8.4790 ns | 3,511.880 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 2048 | 8,551.012 ns | 33.2680 ns | 31.1189 ns | 8,548.759 ns | 2.43 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 4096 | 7,080.465 ns | 63.2332 ns | 56.0546 ns | 7,079.928 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 4096 | 17,419.122 ns | 280.6403 ns | 402.4859 ns | 17,277.155 ns | 2.46 | 0.08 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 8192 | 14,297.834 ns | 169.8077 ns | 181.6923 ns | 14,285.627 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 8192 | 34,212.709 ns | 197.9302 ns | 154.5309 ns | 34,152.783 ns | 2.39 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 16384 | 27,984.034 ns | 65.8523 ns | 58.3764 ns | 27,978.502 ns | 1.00 | 0.00 | - | NA | +| Actual | VersionedForEach | List | RecyclableLongList | 16384 | 61,165.138 ns | 120.0942 ns | 106.4603 ns | 61,160.236 ns | 2.19 | 0.00 | 1 B | NA | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 32768 | 56,134.698 ns | 385.7995 ns | 322.1600 ns | 56,012.927 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableLongList | 32768 | 123,321.451 ns | 1,148.3178 ns | 1,017.9538 ns | 123,617.908 ns | 2.19 | 0.02 | 2 B | 2.00 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 65536 | 112,527.010 ns | 548.6837 ns | 486.3938 ns | 112,364.050 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableLongList | 65536 | 250,991.432 ns | 4,112.0996 ns | 5,200.4893 ns | 249,156.201 ns | 2.24 | 0.07 | 3 B | 1.50 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 131072 | 229,755.196 ns | 4,559.9314 ns | 4,879.0755 ns | 228,871.570 ns | 1.00 | 0.00 | 3 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableLongList | 131072 | 493,550.419 ns | 2,642.8752 ns | 2,342.8400 ns | 493,029.688 ns | 2.15 | 0.05 | 7 B | 2.33 | +| | | | | | | | | | | | | | +| Baseline | VersionedForEach | List | RecyclableLongList | 850000 | 1,569,324.137 ns | 8,203.2766 ns | 6,404.5788 ns | 1,568,688.574 ns | 1.00 | 0.00 | 13 B | 1.00 | +| Actual | VersionedForEach | List | RecyclableLongList | 850000 | 3,152,306.941 ns | 9,076.8563 ns | 7,579.5861 ns | 3,149,392.188 ns | 2.01 | 0.01 | 27 B | 2.08 | +
+ +# `IndexOf` Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.1702) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.203 + [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2 +``` +
+IndexOf Benchmark Results - click to expand + +| Method | TestCase | BaselineBenchmarkType | BenchmarkType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | +|--------- |--------------------- |---------------------- |------------------- |---------------- |----------------------:|---------------------:|-------------------:|----------------------:|------:|------------:|-----------:|------------:| +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 1 | 16.60 ns | 0.060 ns | 0.056 ns | 16.57 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 1 | 19.20 ns | 0.137 ns | 0.121 ns | 19.16 ns | 1.16 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 2 | 27.64 ns | 0.188 ns | 0.176 ns | 27.65 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 2 | 31.90 ns | 0.102 ns | 0.095 ns | 31.89 ns | 1.15 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 3 | 28.35 ns | 0.146 ns | 0.137 ns | 28.42 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 3 | 32.63 ns | 0.177 ns | 0.166 ns | 32.55 ns | 1.15 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 4 | 39.05 ns | 0.112 ns | 0.105 ns | 38.99 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 4 | 44.01 ns | 0.168 ns | 0.149 ns | 43.98 ns | 1.13 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 5 | 39.77 ns | 0.163 ns | 0.152 ns | 39.69 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 5 | 46.72 ns | 0.943 ns | 1.258 ns | 46.87 ns | 1.17 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 6 | 51.14 ns | 0.202 ns | 0.189 ns | 51.10 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 6 | 59.75 ns | 1.076 ns | 1.105 ns | 59.75 ns | 1.17 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 7 | 51.60 ns | 0.126 ns | 0.105 ns | 51.58 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 7 | 58.40 ns | 1.125 ns | 0.997 ns | 58.38 ns | 1.13 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 8 | 61.22 ns | 0.301 ns | 0.281 ns | 61.22 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 8 | 73.96 ns | 0.397 ns | 0.372 ns | 73.98 ns | 1.21 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 9 | 62.21 ns | 0.074 ns | 0.062 ns | 62.22 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 9 | 96.22 ns | 0.712 ns | 0.631 ns | 96.16 ns | 1.55 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 10 | 75.18 ns | 0.244 ns | 0.228 ns | 75.07 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 10 | 83.85 ns | 0.224 ns | 0.209 ns | 83.74 ns | 1.12 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 11 | 74.93 ns | 0.214 ns | 0.200 ns | 74.86 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 11 | 83.78 ns | 0.484 ns | 0.453 ns | 83.53 ns | 1.12 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 12 | 86.86 ns | 0.316 ns | 0.295 ns | 86.88 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 12 | 106.61 ns | 1.246 ns | 1.224 ns | 106.88 ns | 1.23 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 13 | 88.02 ns | 0.273 ns | 0.255 ns | 87.90 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 13 | 96.74 ns | 0.074 ns | 0.066 ns | 96.73 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 14 | 100.74 ns | 0.344 ns | 0.322 ns | 100.79 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 14 | 110.46 ns | 0.359 ns | 0.336 ns | 110.27 ns | 1.10 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 15 | 100.67 ns | 0.405 ns | 0.359 ns | 100.55 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 15 | 127.81 ns | 1.472 ns | 1.305 ns | 128.04 ns | 1.27 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 16 | 114.05 ns | 0.520 ns | 0.486 ns | 113.75 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 16 | 141.99 ns | 0.510 ns | 0.477 ns | 141.82 ns | 1.24 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 17 | 114.63 ns | 0.432 ns | 0.404 ns | 114.41 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 17 | 125.91 ns | 0.363 ns | 0.322 ns | 125.79 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 18 | 127.90 ns | 0.404 ns | 0.378 ns | 128.07 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 18 | 140.47 ns | 0.452 ns | 0.423 ns | 140.24 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 19 | 128.56 ns | 0.375 ns | 0.350 ns | 128.41 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 19 | 152.84 ns | 1.948 ns | 1.822 ns | 152.48 ns | 1.19 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 20 | 150.88 ns | 0.538 ns | 0.477 ns | 150.97 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 20 | 184.59 ns | 0.871 ns | 0.772 ns | 184.61 ns | 1.22 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 30 | 217.63 ns | 0.967 ns | 0.905 ns | 217.71 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 30 | 244.89 ns | 1.417 ns | 1.326 ns | 244.56 ns | 1.13 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 32 | 266.32 ns | 2.378 ns | 2.224 ns | 266.71 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 32 | 310.60 ns | 1.946 ns | 1.820 ns | 310.93 ns | 1.17 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 40 | 362.07 ns | 2.741 ns | 2.564 ns | 362.60 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 40 | 401.02 ns | 1.604 ns | 1.500 ns | 400.31 ns | 1.11 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 50 | 400.35 ns | 3.445 ns | 3.223 ns | 400.41 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 50 | 485.05 ns | 3.031 ns | 2.531 ns | 485.54 ns | 1.21 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 60 | 582.48 ns | 4.689 ns | 4.386 ns | 581.95 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 60 | 664.89 ns | 3.413 ns | 3.192 ns | 663.75 ns | 1.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 80 | 845.29 ns | 7.416 ns | 6.937 ns | 843.90 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 80 | 915.71 ns | 5.696 ns | 5.328 ns | 916.91 ns | 1.08 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 90 | 994.91 ns | 15.228 ns | 14.244 ns | 998.73 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 90 | 1,074.04 ns | 12.721 ns | 11.277 ns | 1,077.75 ns | 1.08 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 100 | 1,130.91 ns | 20.393 ns | 19.076 ns | 1,130.99 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 100 | 1,185.56 ns | 23.173 ns | 21.676 ns | 1,184.10 ns | 1.05 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 128 | 1,610.08 ns | 16.899 ns | 15.807 ns | 1,604.90 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 128 | 1,753.55 ns | 17.254 ns | 16.140 ns | 1,752.63 ns | 1.09 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 256 | 5,750.75 ns | 28.609 ns | 26.760 ns | 5,758.04 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 256 | 5,893.43 ns | 29.453 ns | 27.551 ns | 5,887.99 ns | 1.02 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 512 | 21,669.95 ns | 427.575 ns | 399.954 ns | 21,713.08 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 512 | 21,674.73 ns | 68.941 ns | 64.487 ns | 21,668.86 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 1024 | 69,740.31 ns | 838.846 ns | 932.375 ns | 69,475.32 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 1024 | 68,980.90 ns | 450.707 ns | 421.591 ns | 68,923.79 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 2048 | 244,266.95 ns | 2,449.277 ns | 2,045.257 ns | 243,462.06 ns | 1.00 | 0.00 | - | NA | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 2048 | 239,887.40 ns | 854.306 ns | 799.118 ns | 240,015.48 ns | 0.98 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 4096 | 904,644.52 ns | 3,379.464 ns | 2,638.463 ns | 904,380.27 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 4096 | 915,459.26 ns | 6,529.766 ns | 6,107.947 ns | 917,327.34 ns | 1.01 | 0.01 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 8192 | 3,513,716.89 ns | 62,893.465 ns | 90,199.928 ns | 3,474,476.56 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 8192 | 3,486,690.89 ns | 14,705.600 ns | 13,755.627 ns | 3,481,303.91 ns | 0.99 | 0.02 | 2 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 16384 | 13,736,865.85 ns | 120,702.128 ns | 106,999.292 ns | 13,714,744.53 ns | 1.00 | 0.00 | 9 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 16384 | 14,167,800.31 ns | 43,856.428 ns | 41,023.330 ns | 14,149,225.00 ns | 1.03 | 0.01 | 9 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 32768 | 53,875,332.00 ns | 245,220.180 ns | 229,379.108 ns | 53,809,450.00 ns | 1.00 | 0.00 | 60 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 32768 | 55,149,804.00 ns | 273,037.835 ns | 255,399.760 ns | 55,076,500.00 ns | 1.02 | 0.01 | 60 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 65536 | 218,431,663.33 ns | 4,265,864.273 ns | 4,912,575.640 ns | 214,920,550.00 ns | 1.00 | 0.00 | 200 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 65536 | 217,449,610.26 ns | 493,374.080 ns | 411,989.702 ns | 217,368,133.33 ns | 1.01 | 0.02 | 200 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 131072 | 936,350,615.38 ns | 2,290,617.990 ns | 1,912,769.764 ns | 936,031,100.00 ns | 1.00 | 0.00 | 600 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 131072 | 928,423,416.67 ns | 1,034,931.818 ns | 808,006.689 ns | 928,198,750.00 ns | 0.99 | 0.00 | 600 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 849999 | 99,588,892,028.57 ns | 998,348,445.797 ns | 885,009,893.256 ns | 99,218,977,100.00 ns | 1.00 | 0.00 | 600 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 849999 | 102,323,847,080.00 ns | 1,028,672,431.300 ns | 962,220,830.472 ns | 101,982,058,200.00 ns | 1.03 | 0.01 | 600 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | Index(...)Cases [25] | List | RecyclableLongList | 850000 | 113.8 s | 2.26 s | 2.69 s | | 1.00 | 0.00 | 600 B | 1.00 | +| Actual | Index(...)Cases [25] | List | RecyclableLongList | 850000 | 110.3 s | 2.11 s | 2.07 s | | 0.97 | 0.03 | 399750776 B | 666,251.29 | +
+ +# `this[]` Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 +``` +
+this[] Getter Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | +|--------- |--------- |------------- |------------------- |---------------- |-----------------:|---------------:|---------------:|-----------------:|------:|--------:|----------:|------------:| +| Baseline | GetItem | List | Array | 0 | 5.087 ns | 0.0177 ns | 0.0157 ns | 5.085 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 0 | 4.232 ns | 0.0134 ns | 0.0125 ns | 4.232 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 1 | 5.814 ns | 0.0043 ns | 0.0034 ns | 5.814 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 1 | 7.195 ns | 0.1698 ns | 0.2789 ns | 7.262 ns | 1.23 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 2 | 7.122 ns | 0.1548 ns | 0.1373 ns | 7.046 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 2 | 8.713 ns | 0.2006 ns | 0.2878 ns | 8.817 ns | 1.21 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 3 | 8.253 ns | 0.0434 ns | 0.0362 ns | 8.235 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 3 | 7.972 ns | 0.0277 ns | 0.0231 ns | 7.960 ns | 0.97 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 4 | 9.629 ns | 0.0470 ns | 0.0439 ns | 9.612 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 4 | 9.416 ns | 0.0899 ns | 0.0702 ns | 9.398 ns | 0.98 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 5 | 11.944 ns | 0.1798 ns | 0.1682 ns | 11.949 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 5 | 12.661 ns | 0.2729 ns | 0.3352 ns | 12.701 ns | 1.06 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 6 | 13.660 ns | 0.2059 ns | 0.1926 ns | 13.606 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 6 | 14.335 ns | 0.3136 ns | 0.2780 ns | 14.320 ns | 1.05 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 7 | 15.777 ns | 0.1703 ns | 0.1593 ns | 15.740 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 7 | 16.908 ns | 0.3714 ns | 0.4562 ns | 16.826 ns | 1.07 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 8 | 18.534 ns | 0.2159 ns | 0.2020 ns | 18.550 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 8 | 17.109 ns | 0.1688 ns | 0.1497 ns | 17.061 ns | 0.92 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 9 | 16.745 ns | 0.0188 ns | 0.0157 ns | 16.744 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 9 | 16.313 ns | 0.0334 ns | 0.0279 ns | 16.319 ns | 0.97 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 10 | 18.750 ns | 0.2487 ns | 0.1942 ns | 18.733 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 10 | 19.209 ns | 0.2345 ns | 0.2193 ns | 19.172 ns | 1.02 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 11 | 19.802 ns | 0.0520 ns | 0.0406 ns | 19.791 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 11 | 20.647 ns | 0.1615 ns | 0.1511 ns | 20.655 ns | 1.04 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 12 | 21.204 ns | 0.0376 ns | 0.0333 ns | 21.200 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 12 | 21.812 ns | 0.1413 ns | 0.1322 ns | 21.879 ns | 1.03 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 13 | 22.591 ns | 0.0196 ns | 0.0153 ns | 22.594 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 13 | 20.918 ns | 0.0383 ns | 0.0320 ns | 20.906 ns | 0.93 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 14 | 24.049 ns | 0.0488 ns | 0.0433 ns | 24.038 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 14 | 23.721 ns | 0.2652 ns | 0.2481 ns | 23.762 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 15 | 25.572 ns | 0.0272 ns | 0.0254 ns | 25.573 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 15 | 24.800 ns | 0.2831 ns | 0.2648 ns | 24.774 ns | 0.97 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 16 | 26.961 ns | 0.0356 ns | 0.0316 ns | 26.949 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 16 | 24.586 ns | 0.0611 ns | 0.0541 ns | 24.577 ns | 0.91 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 17 | 28.492 ns | 0.0728 ns | 0.0681 ns | 28.482 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 17 | 27.441 ns | 0.3655 ns | 0.3419 ns | 27.516 ns | 0.96 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 18 | 29.978 ns | 0.2612 ns | 0.2443 ns | 29.972 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 18 | 28.647 ns | 0.1871 ns | 0.1751 ns | 28.674 ns | 0.96 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 19 | 31.480 ns | 0.1982 ns | 0.1854 ns | 31.510 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 19 | 28.104 ns | 0.1097 ns | 0.1026 ns | 28.054 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 20 | 32.807 ns | 0.0663 ns | 0.0621 ns | 32.789 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 20 | 29.494 ns | 0.1506 ns | 0.1408 ns | 29.467 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 30 | 47.366 ns | 0.0892 ns | 0.0745 ns | 47.352 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 30 | 43.030 ns | 0.1955 ns | 0.1829 ns | 42.994 ns | 0.91 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 32 | 57.594 ns | 0.6630 ns | 0.6201 ns | 57.568 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 32 | 53.214 ns | 0.2239 ns | 0.1870 ns | 53.207 ns | 0.92 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 36 | 62.153 ns | 0.0910 ns | 0.0710 ns | 62.142 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 36 | 57.604 ns | 0.4924 ns | 0.4606 ns | 57.458 ns | 0.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 37 | 63.696 ns | 0.2617 ns | 0.2448 ns | 63.735 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 37 | 59.404 ns | 0.1440 ns | 0.1276 ns | 59.410 ns | 0.93 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 40 | 68.221 ns | 0.1968 ns | 0.1841 ns | 68.141 ns | 1.00 | 0.00 | - | NA | +| Baseline | GetItem | List | Array | 40 | 68.066 ns | 0.0598 ns | 0.0499 ns | 68.045 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 40 | 63.406 ns | 0.6025 ns | 0.5341 ns | 63.211 ns | 0.93 | 0.01 | - | NA | +| Actual | GetItem | List | Array | 40 | 63.601 ns | 0.4482 ns | 0.4193 ns | 63.531 ns | 0.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 50 | 82.718 ns | 0.5956 ns | 0.5571 ns | 82.387 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 50 | 74.547 ns | 0.2905 ns | 0.2718 ns | 74.573 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 60 | 96.421 ns | 0.0519 ns | 0.0433 ns | 96.410 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 60 | 85.857 ns | 0.2068 ns | 0.1834 ns | 85.801 ns | 0.89 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 70 | 112.740 ns | 0.7200 ns | 0.6735 ns | 112.641 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 70 | 101.227 ns | 0.4075 ns | 0.3612 ns | 101.190 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 80 | 129.546 ns | 1.9844 ns | 1.7591 ns | 129.675 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 80 | 115.180 ns | 0.9878 ns | 0.9240 ns | 115.047 ns | 0.89 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 90 | 147.359 ns | 2.9076 ns | 2.7198 ns | 147.580 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 90 | 124.477 ns | 0.4122 ns | 0.3856 ns | 124.388 ns | 0.84 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 100 | 156.162 ns | 0.3327 ns | 0.3112 ns | 156.075 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 100 | 136.660 ns | 0.2034 ns | 0.1903 ns | 136.679 ns | 0.88 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 128 | 196.667 ns | 0.6222 ns | 0.5820 ns | 196.618 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 128 | 170.684 ns | 0.4582 ns | 0.4286 ns | 170.689 ns | 0.87 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 256 | 382.457 ns | 1.3733 ns | 1.2846 ns | 381.805 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 256 | 323.661 ns | 1.1383 ns | 1.0647 ns | 323.394 ns | 0.85 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 512 | 755.104 ns | 2.3256 ns | 2.1753 ns | 756.165 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 512 | 631.467 ns | 1.2068 ns | 1.0698 ns | 631.219 ns | 0.84 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 1024 | 1,498.234 ns | 2.7609 ns | 2.4475 ns | 1,497.659 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 1024 | 1,246.530 ns | 1.6971 ns | 1.5875 ns | 1,246.584 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 2048 | 2,981.924 ns | 7.2251 ns | 6.4049 ns | 2,979.765 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 2048 | 2,477.137 ns | 5.4560 ns | 4.8366 ns | 2,476.553 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 4096 | 5,954.708 ns | 9.8748 ns | 9.2369 ns | 5,954.871 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 4096 | 4,933.807 ns | 8.7286 ns | 8.1648 ns | 4,934.590 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 8192 | 11,904.955 ns | 36.3822 ns | 32.2519 ns | 11,905.228 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 8192 | 9,851.273 ns | 20.8854 ns | 19.5362 ns | 9,845.271 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 16384 | 23,781.046 ns | 43.5231 ns | 36.3438 ns | 23,769.757 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 16384 | 19,668.344 ns | 27.3351 ns | 22.8260 ns | 19,665.826 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 32768 | 47,508.092 ns | 87.7922 ns | 82.1209 ns | 47,492.511 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 32768 | 39,421.193 ns | 92.0761 ns | 86.1280 ns | 39,445.734 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 65536 | 95,220.745 ns | 156.8450 ns | 139.0390 ns | 95,246.021 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 65536 | 78,557.533 ns | 216.2659 ns | 191.7141 ns | 78,526.147 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 131072 | 190,923.184 ns | 652.4912 ns | 610.3407 ns | 190,601.953 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | Array | 131072 | 157,503.108 ns | 633.5713 ns | 561.6444 ns | 157,280.652 ns | 0.83 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | Array | 850000 | 1,312,717.285 ns | 4,791.6643 ns | 4,247.6856 ns | 1,311,580.078 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | GetItem | List | Array | 850000 | 1,019,788.542 ns | 3,424.5043 ns | 3,203.2835 ns | 1,017,995.508 ns | 0.78 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 0 | 4.117 ns | 0.0070 ns | 0.0066 ns | 4.115 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 0 | 4.119 ns | 0.0057 ns | 0.0048 ns | 4.119 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 1 | 5.825 ns | 0.0081 ns | 0.0076 ns | 5.821 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 1 | 5.825 ns | 0.0115 ns | 0.0096 ns | 5.827 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 2 | 7.168 ns | 0.1676 ns | 0.2119 ns | 7.072 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 2 | 7.480 ns | 0.1789 ns | 0.3735 ns | 7.391 ns | 1.03 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 3 | 8.307 ns | 0.0384 ns | 0.0340 ns | 8.303 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 3 | 8.340 ns | 0.1233 ns | 0.1093 ns | 8.285 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 4 | 10.137 ns | 0.2287 ns | 0.3423 ns | 10.359 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 4 | 9.653 ns | 0.0598 ns | 0.0499 ns | 9.635 ns | 0.95 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 5 | 11.171 ns | 0.0370 ns | 0.0289 ns | 11.158 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 5 | 11.174 ns | 0.0436 ns | 0.0364 ns | 11.157 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 6 | 12.544 ns | 0.0204 ns | 0.0191 ns | 12.544 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 6 | 12.538 ns | 0.0176 ns | 0.0156 ns | 12.543 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 7 | 13.975 ns | 0.0346 ns | 0.0324 ns | 13.968 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 7 | 13.980 ns | 0.0405 ns | 0.0338 ns | 13.964 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 8 | 15.676 ns | 0.1732 ns | 0.1620 ns | 15.616 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 8 | 15.500 ns | 0.1084 ns | 0.0961 ns | 15.459 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 9 | 16.861 ns | 0.0587 ns | 0.0520 ns | 16.855 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 9 | 16.850 ns | 0.0381 ns | 0.0297 ns | 16.842 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 10 | 18.294 ns | 0.0538 ns | 0.0477 ns | 18.297 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 10 | 18.267 ns | 0.0683 ns | 0.0605 ns | 18.235 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 11 | 19.683 ns | 0.0245 ns | 0.0191 ns | 19.680 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 11 | 19.666 ns | 0.0256 ns | 0.0214 ns | 19.661 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 12 | 21.111 ns | 0.0237 ns | 0.0198 ns | 21.107 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 12 | 21.213 ns | 0.0288 ns | 0.0269 ns | 21.205 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 13 | 22.598 ns | 0.0774 ns | 0.0724 ns | 22.640 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 13 | 22.572 ns | 0.0645 ns | 0.0572 ns | 22.547 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 14 | 23.998 ns | 0.0388 ns | 0.0324 ns | 23.994 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 14 | 24.114 ns | 0.1768 ns | 0.1654 ns | 23.989 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 15 | 25.598 ns | 0.1708 ns | 0.1598 ns | 25.679 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 15 | 25.522 ns | 0.0816 ns | 0.0763 ns | 25.531 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 16 | 26.972 ns | 0.0606 ns | 0.0567 ns | 26.975 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 16 | 26.907 ns | 0.0739 ns | 0.0655 ns | 26.877 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 17 | 28.509 ns | 0.1739 ns | 0.1627 ns | 28.462 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 17 | 28.473 ns | 0.0705 ns | 0.0625 ns | 28.461 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 18 | 29.861 ns | 0.0414 ns | 0.0367 ns | 29.849 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 18 | 29.962 ns | 0.0770 ns | 0.0683 ns | 29.977 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 19 | 31.301 ns | 0.0757 ns | 0.0671 ns | 31.294 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 19 | 31.314 ns | 0.0390 ns | 0.0326 ns | 31.311 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 20 | 32.772 ns | 0.0438 ns | 0.0366 ns | 32.775 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 20 | 32.755 ns | 0.0465 ns | 0.0412 ns | 32.742 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 30 | 47.182 ns | 0.0429 ns | 0.0381 ns | 47.183 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 30 | 47.291 ns | 0.1582 ns | 0.1480 ns | 47.246 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 32 | 57.025 ns | 0.8559 ns | 0.8006 ns | 56.924 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 32 | 57.772 ns | 0.5754 ns | 0.5382 ns | 57.897 ns | 1.01 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 36 | 61.567 ns | 0.0479 ns | 0.0374 ns | 61.573 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 36 | 62.487 ns | 0.0577 ns | 0.0540 ns | 62.475 ns | 1.01 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 37 | 63.278 ns | 0.1242 ns | 0.1101 ns | 63.273 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 37 | 63.194 ns | 0.0406 ns | 0.0339 ns | 63.190 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 40 | 68.423 ns | 0.1422 ns | 0.1260 ns | 68.409 ns | 1.00 | 0.00 | - | NA | +| Baseline | GetItem | List | PooledList | 40 | 67.996 ns | 0.1221 ns | 0.1083 ns | 67.986 ns | 0.99 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 40 | 67.655 ns | 0.1196 ns | 0.1119 ns | 67.650 ns | 0.99 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 40 | 68.598 ns | 0.0818 ns | 0.0725 ns | 68.575 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 50 | 82.089 ns | 0.3763 ns | 0.3520 ns | 81.961 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 50 | 81.547 ns | 0.1177 ns | 0.0983 ns | 81.516 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 60 | 95.908 ns | 0.0945 ns | 0.0789 ns | 95.912 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 60 | 96.614 ns | 0.0965 ns | 0.0806 ns | 96.602 ns | 1.01 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 70 | 110.347 ns | 0.0897 ns | 0.0839 ns | 110.350 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 70 | 110.410 ns | 0.1133 ns | 0.1060 ns | 110.399 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 80 | 124.762 ns | 0.1451 ns | 0.1287 ns | 124.716 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 80 | 125.374 ns | 0.8244 ns | 0.7711 ns | 124.923 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 850000 | 1,354,564.314 ns | 27,077.9151 ns | 24,003.8665 ns | 1,347,315.918 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | GetItem | List | PooledList | 850000 | 1,326,081.070 ns | 6,365.8240 ns | 5,315.7514 ns | 1,327,350.977 ns | 0.98 | 0.02 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 90 | 139.951 ns | 0.9460 ns | 0.8849 ns | 139.496 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 90 | 139.727 ns | 0.2896 ns | 0.2568 ns | 139.645 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 100 | 154.239 ns | 0.4053 ns | 0.3791 ns | 154.060 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 100 | 154.055 ns | 0.0729 ns | 0.0682 ns | 154.040 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 128 | 194.694 ns | 0.4205 ns | 0.3934 ns | 194.532 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 128 | 194.594 ns | 0.2835 ns | 0.2652 ns | 194.535 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 256 | 379.100 ns | 0.3344 ns | 0.2792 ns | 379.071 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 256 | 380.014 ns | 1.2398 ns | 1.1597 ns | 379.366 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 512 | 747.765 ns | 0.9277 ns | 0.7747 ns | 748.063 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 512 | 748.483 ns | 0.3634 ns | 0.2837 ns | 748.391 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 1024 | 1,488.274 ns | 8.3175 ns | 7.7802 ns | 1,486.584 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 1024 | 1,482.692 ns | 2.8880 ns | 2.5601 ns | 1,482.041 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 2048 | 2,950.451 ns | 2.8768 ns | 2.4022 ns | 2,949.803 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 2048 | 2,950.227 ns | 2.2722 ns | 1.8974 ns | 2,950.386 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 4096 | 5,915.946 ns | 28.4765 ns | 26.6369 ns | 5,898.267 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 4096 | 5,900.795 ns | 19.5014 ns | 17.2875 ns | 5,890.962 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 8192 | 11,780.438 ns | 15.4387 ns | 12.0535 ns | 11,775.958 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 8192 | 11,800.539 ns | 50.7679 ns | 45.0044 ns | 11,778.336 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 16384 | 23,558.218 ns | 39.3738 ns | 34.9038 ns | 23,547.809 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 16384 | 23,645.565 ns | 151.1512 ns | 141.3869 ns | 23,578.395 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 32768 | 47,322.243 ns | 281.7861 ns | 263.5829 ns | 47,229.657 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 32768 | 47,980.978 ns | 272.9394 ns | 255.3077 ns | 47,993.085 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 65536 | 95,987.704 ns | 330.8700 ns | 309.4960 ns | 95,971.948 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 65536 | 97,397.487 ns | 529.5201 ns | 495.3135 ns | 97,361.578 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | PooledList | 131072 | 198,227.028 ns | 3,922.3737 ns | 3,668.9908 ns | 196,667.847 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | PooledList | 131072 | 192,520.435 ns | 865.3927 ns | 809.4889 ns | 192,155.615 ns | 0.97 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 0 | 5.085 ns | 0.0236 ns | 0.0197 ns | 5.080 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 0 | 4.599 ns | 0.0061 ns | 0.0047 ns | 4.600 ns | 0.90 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 1 | 5.274 ns | 0.0054 ns | 0.0048 ns | 5.273 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 1 | 5.280 ns | 0.0305 ns | 0.0286 ns | 5.291 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 2 | 6.722 ns | 0.0140 ns | 0.0117 ns | 6.722 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 2 | 6.715 ns | 0.0227 ns | 0.0212 ns | 6.709 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 3 | 8.195 ns | 0.0120 ns | 0.0101 ns | 8.196 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 3 | 8.150 ns | 0.0181 ns | 0.0151 ns | 8.149 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 4 | 9.606 ns | 0.0201 ns | 0.0179 ns | 9.599 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 4 | 9.585 ns | 0.0228 ns | 0.0213 ns | 9.575 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 5 | 11.149 ns | 0.0717 ns | 0.0599 ns | 11.125 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 5 | 12.228 ns | 0.1114 ns | 0.1042 ns | 12.222 ns | 1.10 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 6 | 12.548 ns | 0.0161 ns | 0.0143 ns | 12.547 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 6 | 12.488 ns | 0.0234 ns | 0.0207 ns | 12.484 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 7 | 13.947 ns | 0.0128 ns | 0.0113 ns | 13.946 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 7 | 15.282 ns | 0.0590 ns | 0.0523 ns | 15.296 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 8 | 16.790 ns | 0.0271 ns | 0.0254 ns | 16.792 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 8 | 16.042 ns | 0.0416 ns | 0.0389 ns | 16.050 ns | 0.96 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 9 | 17.513 ns | 0.0537 ns | 0.0502 ns | 17.507 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 9 | 17.584 ns | 0.0616 ns | 0.0576 ns | 17.607 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 10 | 18.919 ns | 0.0365 ns | 0.0323 ns | 18.915 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 10 | 18.762 ns | 0.0227 ns | 0.0201 ns | 18.765 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 11 | 20.308 ns | 0.0576 ns | 0.0510 ns | 20.308 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 11 | 20.207 ns | 0.0531 ns | 0.0471 ns | 20.189 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 12 | 21.734 ns | 0.0816 ns | 0.0763 ns | 21.704 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 12 | 21.670 ns | 0.0323 ns | 0.0270 ns | 21.669 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 13 | 23.181 ns | 0.0650 ns | 0.0543 ns | 23.169 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 13 | 23.064 ns | 0.0344 ns | 0.0287 ns | 23.073 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 14 | 24.619 ns | 0.1182 ns | 0.1106 ns | 24.554 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 14 | 24.519 ns | 0.0463 ns | 0.0387 ns | 24.516 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 15 | 26.005 ns | 0.0487 ns | 0.0381 ns | 25.990 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 15 | 25.846 ns | 0.0358 ns | 0.0299 ns | 25.833 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 16 | 27.394 ns | 0.0714 ns | 0.0668 ns | 27.361 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 16 | 27.284 ns | 0.0207 ns | 0.0173 ns | 27.285 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 17 | 28.792 ns | 0.0231 ns | 0.0205 ns | 28.788 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 17 | 28.791 ns | 0.1407 ns | 0.1317 ns | 28.724 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 18 | 30.166 ns | 0.0363 ns | 0.0303 ns | 30.159 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 18 | 30.282 ns | 0.2122 ns | 0.1985 ns | 30.179 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 19 | 31.688 ns | 0.0499 ns | 0.0442 ns | 31.675 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 19 | 31.597 ns | 0.0369 ns | 0.0288 ns | 31.597 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 20 | 33.054 ns | 0.0457 ns | 0.0405 ns | 33.041 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 20 | 33.021 ns | 0.0292 ns | 0.0228 ns | 33.016 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 30 | 47.640 ns | 0.1029 ns | 0.0912 ns | 47.667 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 30 | 47.383 ns | 0.0397 ns | 0.0331 ns | 47.385 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 32 | 57.208 ns | 0.4838 ns | 0.4525 ns | 57.237 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 32 | 56.609 ns | 0.1218 ns | 0.1080 ns | 56.608 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 36 | 61.133 ns | 0.2587 ns | 0.2293 ns | 61.073 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 36 | 61.769 ns | 0.1004 ns | 0.0939 ns | 61.821 ns | 1.01 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 37 | 62.414 ns | 0.1317 ns | 0.1100 ns | 62.406 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 37 | 62.584 ns | 0.0700 ns | 0.0620 ns | 62.594 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 40 | 68.118 ns | 0.1447 ns | 0.1354 ns | 68.122 ns | 1.00 | 0.00 | - | NA | +| Baseline | GetItem | List | RecyclableList | 40 | 68.463 ns | 0.1350 ns | 0.1197 ns | 68.425 ns | 1.01 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 40 | 67.786 ns | 0.2085 ns | 0.1849 ns | 67.760 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 40 | 67.491 ns | 0.0914 ns | 0.0810 ns | 67.458 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 50 | 81.537 ns | 0.1361 ns | 0.1206 ns | 81.526 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 50 | 82.324 ns | 0.1428 ns | 0.1335 ns | 82.324 ns | 1.01 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 60 | 97.050 ns | 0.0760 ns | 0.0593 ns | 97.036 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 60 | 98.003 ns | 0.3562 ns | 0.3332 ns | 97.851 ns | 1.01 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 70 | 111.475 ns | 0.1881 ns | 0.1760 ns | 111.486 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 70 | 109.756 ns | 0.1914 ns | 0.1791 ns | 109.753 ns | 0.98 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 80 | 124.764 ns | 0.1937 ns | 0.1812 ns | 124.764 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 80 | 124.409 ns | 0.2905 ns | 0.2717 ns | 124.451 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 90 | 139.293 ns | 0.1760 ns | 0.1646 ns | 139.286 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 90 | 139.193 ns | 0.1773 ns | 0.1481 ns | 139.212 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 100 | 152.969 ns | 0.2109 ns | 0.1761 ns | 152.943 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 100 | 152.321 ns | 0.1998 ns | 0.1668 ns | 152.244 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 128 | 193.298 ns | 0.3859 ns | 0.3610 ns | 193.127 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 128 | 194.086 ns | 0.1932 ns | 0.1613 ns | 194.017 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 256 | 377.865 ns | 1.2921 ns | 1.2087 ns | 377.181 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 256 | 377.518 ns | 1.4666 ns | 1.3719 ns | 376.818 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 512 | 746.404 ns | 2.2184 ns | 2.0751 ns | 746.010 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 512 | 745.610 ns | 1.1743 ns | 0.9806 ns | 745.053 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 1024 | 1,479.600 ns | 1.2165 ns | 1.0158 ns | 1,479.302 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 1024 | 1,480.707 ns | 1.9632 ns | 1.7403 ns | 1,480.032 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 2048 | 2,958.204 ns | 10.9250 ns | 9.6847 ns | 2,954.479 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 2048 | 2,950.894 ns | 4.0534 ns | 3.5932 ns | 2,949.265 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 4096 | 5,894.618 ns | 4.8885 ns | 4.3335 ns | 5,893.645 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 4096 | 5,892.491 ns | 6.0143 ns | 4.6955 ns | 5,891.155 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 8192 | 11,778.814 ns | 13.8052 ns | 10.7782 ns | 11,773.432 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 8192 | 11,806.300 ns | 25.0434 ns | 23.4256 ns | 11,798.613 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 16384 | 23,686.530 ns | 51.3596 ns | 48.0418 ns | 23,661.995 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableList | 16384 | 23,757.159 ns | 158.5130 ns | 148.2732 ns | 23,694.806 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 32768 | 47,500.045 ns | 49.8326 ns | 46.6134 ns | 47,493.164 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | GetItem | List | RecyclableList | 32768 | 47,516.522 ns | 250.4994 ns | 234.3173 ns | 47,379.025 ns | 1.00 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 65536 | 94,967.463 ns | 437.7486 ns | 409.4703 ns | 94,752.344 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | GetItem | List | RecyclableList | 65536 | 94,393.466 ns | 153.9536 ns | 128.5582 ns | 94,378.235 ns | 0.99 | 0.01 | 2 B | 2.00 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 131072 | 189,674.316 ns | 614.7607 ns | 513.3531 ns | 189,466.650 ns | 1.00 | 0.00 | 3 B | 1.00 | +| Actual | GetItem | List | RecyclableList | 131072 | 189,207.023 ns | 327.4955 ns | 290.3162 ns | 189,054.089 ns | 1.00 | 0.00 | 2 B | 0.67 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableList | 850000 | 1,307,223.870 ns | 3,683.7814 ns | 3,265.5763 ns | 1,306,491.016 ns | 1.00 | 0.00 | 25 B | 1.00 | +| Actual | GetItem | List | RecyclableList | 850000 | 1,304,507.917 ns | 6,212.3585 ns | 5,811.0440 ns | 1,303,131.641 ns | 1.00 | 0.00 | 13 B | 0.52 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 0 | 4.112 ns | 0.0057 ns | 0.0045 ns | 4.112 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 0 | 4.223 ns | 0.0110 ns | 0.0103 ns | 4.226 ns | 1.03 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 1 | 5.266 ns | 0.0086 ns | 0.0081 ns | 5.265 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 1 | 5.521 ns | 0.0103 ns | 0.0097 ns | 5.519 ns | 1.05 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 2 | 6.753 ns | 0.0705 ns | 0.0625 ns | 6.750 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 2 | 7.217 ns | 0.0464 ns | 0.0411 ns | 7.193 ns | 1.07 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 3 | 8.137 ns | 0.0116 ns | 0.0097 ns | 8.137 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 3 | 8.903 ns | 0.0135 ns | 0.0105 ns | 8.903 ns | 1.09 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 4 | 9.820 ns | 0.2233 ns | 0.2193 ns | 9.685 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 4 | 10.604 ns | 0.0489 ns | 0.0434 ns | 10.606 ns | 1.08 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 5 | 11.133 ns | 0.0284 ns | 0.0237 ns | 11.129 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 5 | 12.244 ns | 0.0196 ns | 0.0163 ns | 12.245 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 6 | 12.677 ns | 0.1375 ns | 0.1286 ns | 12.715 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 6 | 13.930 ns | 0.0193 ns | 0.0161 ns | 13.930 ns | 1.10 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 7 | 14.129 ns | 0.1588 ns | 0.1485 ns | 14.125 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 7 | 15.614 ns | 0.0219 ns | 0.0194 ns | 15.606 ns | 1.11 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 8 | 16.617 ns | 0.2342 ns | 0.2190 ns | 16.638 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 8 | 17.294 ns | 0.0177 ns | 0.0165 ns | 17.293 ns | 1.04 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 9 | 17.509 ns | 0.0326 ns | 0.0272 ns | 17.517 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 9 | 19.082 ns | 0.0857 ns | 0.0802 ns | 19.090 ns | 1.09 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 10 | 18.892 ns | 0.0508 ns | 0.0450 ns | 18.888 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 10 | 20.767 ns | 0.0418 ns | 0.0391 ns | 20.775 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 11 | 20.391 ns | 0.0607 ns | 0.0568 ns | 20.379 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 11 | 22.497 ns | 0.0267 ns | 0.0237 ns | 22.502 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 12 | 21.825 ns | 0.0927 ns | 0.0867 ns | 21.798 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 12 | 24.147 ns | 0.1502 ns | 0.1405 ns | 24.095 ns | 1.11 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 13 | 23.246 ns | 0.0808 ns | 0.0716 ns | 23.267 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 13 | 25.689 ns | 0.0190 ns | 0.0159 ns | 25.681 ns | 1.10 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 14 | 24.643 ns | 0.0978 ns | 0.0915 ns | 24.653 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 14 | 27.515 ns | 0.1318 ns | 0.1233 ns | 27.472 ns | 1.12 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 15 | 25.970 ns | 0.0522 ns | 0.0436 ns | 25.953 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 15 | 29.022 ns | 0.0610 ns | 0.0509 ns | 29.024 ns | 1.12 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 16 | 27.393 ns | 0.0110 ns | 0.0098 ns | 27.395 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 16 | 30.788 ns | 0.0274 ns | 0.0229 ns | 30.794 ns | 1.12 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 17 | 28.958 ns | 0.0263 ns | 0.0246 ns | 28.950 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 17 | 32.607 ns | 0.0340 ns | 0.0284 ns | 32.608 ns | 1.13 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 18 | 30.409 ns | 0.0726 ns | 0.0679 ns | 30.382 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 18 | 34.341 ns | 0.0637 ns | 0.0565 ns | 34.325 ns | 1.13 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 19 | 31.874 ns | 0.0591 ns | 0.0494 ns | 31.878 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 19 | 36.036 ns | 0.2199 ns | 0.2057 ns | 35.994 ns | 1.13 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 20 | 33.260 ns | 0.1194 ns | 0.1116 ns | 33.276 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 20 | 37.555 ns | 0.1829 ns | 0.1527 ns | 37.509 ns | 1.13 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 30 | 47.583 ns | 0.1002 ns | 0.0782 ns | 47.549 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 30 | 54.365 ns | 0.1154 ns | 0.0963 ns | 54.343 ns | 1.14 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 32 | 58.103 ns | 0.5050 ns | 0.4723 ns | 57.943 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 32 | 64.688 ns | 0.4897 ns | 0.4581 ns | 64.627 ns | 1.11 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 36 | 61.619 ns | 0.3959 ns | 0.3703 ns | 61.606 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 36 | 70.398 ns | 0.1161 ns | 0.0969 ns | 70.421 ns | 1.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 37 | 63.308 ns | 0.1311 ns | 0.1162 ns | 63.293 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 37 | 71.494 ns | 0.1497 ns | 0.1400 ns | 71.492 ns | 1.13 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 40 | 67.560 ns | 0.3628 ns | 0.3216 ns | 67.570 ns | 1.00 | 0.00 | - | NA | +| Baseline | GetItem | List | RecyclableLongList | 40 | 67.491 ns | 0.3148 ns | 0.2791 ns | 67.545 ns | 1.00 | 0.01 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 40 | 77.774 ns | 0.0789 ns | 0.0659 ns | 77.765 ns | 1.15 | 0.01 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 40 | 77.104 ns | 0.3463 ns | 0.3240 ns | 76.935 ns | 1.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 50 | 81.792 ns | 0.2041 ns | 0.1593 ns | 81.743 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 50 | 93.817 ns | 0.4548 ns | 0.4254 ns | 93.567 ns | 1.15 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 60 | 97.014 ns | 0.6810 ns | 0.6370 ns | 96.785 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 60 | 110.467 ns | 0.2460 ns | 0.2180 ns | 110.366 ns | 1.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 70 | 110.847 ns | 0.3054 ns | 0.2857 ns | 110.753 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 70 | 127.364 ns | 0.1797 ns | 0.1501 ns | 127.334 ns | 1.15 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 80 | 125.678 ns | 0.7599 ns | 0.7108 ns | 125.640 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 80 | 144.256 ns | 0.6348 ns | 0.5938 ns | 143.939 ns | 1.15 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 850000 | 1,311,320.417 ns | 4,379.8630 ns | 4,096.9266 ns | 1,312,105.078 ns | 1.00 | 0.00 | 25 B | 1.00 | +| Actual | GetItem | List | RecyclableLongList | 850000 | 1,525,118.770 ns | 5,882.0910 ns | 5,502.1116 ns | 1,524,297.949 ns | 1.16 | 0.00 | 25 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 90 | 139.942 ns | 0.3684 ns | 0.3446 ns | 139.905 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 90 | 161.519 ns | 0.4139 ns | 0.3231 ns | 161.579 ns | 1.15 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 100 | 154.718 ns | 0.9467 ns | 0.8856 ns | 154.611 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 100 | 177.538 ns | 0.3023 ns | 0.2525 ns | 177.482 ns | 1.15 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 128 | 195.013 ns | 0.6922 ns | 0.6474 ns | 194.905 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 128 | 224.850 ns | 0.5712 ns | 0.4770 ns | 224.749 ns | 1.15 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 256 | 380.907 ns | 0.6343 ns | 0.5934 ns | 380.787 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 256 | 441.945 ns | 0.4077 ns | 0.3614 ns | 442.131 ns | 1.16 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 512 | 751.199 ns | 0.9536 ns | 0.8920 ns | 751.228 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 512 | 875.576 ns | 1.4739 ns | 1.3787 ns | 875.572 ns | 1.17 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 1024 | 1,492.466 ns | 2.5022 ns | 2.3406 ns | 1,491.752 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 1024 | 1,747.504 ns | 3.1965 ns | 2.9900 ns | 1,747.231 ns | 1.17 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 2048 | 2,969.723 ns | 6.2703 ns | 5.8652 ns | 2,967.258 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 2048 | 3,472.481 ns | 5.6621 ns | 5.2963 ns | 3,470.974 ns | 1.17 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 4096 | 5,940.363 ns | 7.1239 ns | 6.3151 ns | 5,939.664 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 4096 | 6,960.118 ns | 16.1488 ns | 15.1056 ns | 6,958.694 ns | 1.17 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 8192 | 11,866.370 ns | 18.7284 ns | 15.6391 ns | 11,867.043 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 8192 | 13,881.169 ns | 31.8584 ns | 29.8004 ns | 13,876.588 ns | 1.17 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 16384 | 23,727.698 ns | 115.5709 ns | 108.1051 ns | 23,667.245 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 16384 | 27,590.594 ns | 28.8522 ns | 22.5259 ns | 27,592.171 ns | 1.16 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 32768 | 47,279.877 ns | 74.6557 ns | 62.3409 ns | 47,266.443 ns | 1.00 | 0.00 | - | NA | +| Actual | GetItem | List | RecyclableLongList | 32768 | 55,343.465 ns | 263.3131 ns | 246.3032 ns | 55,241.559 ns | 1.17 | 0.00 | 1 B | NA | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 65536 | 95,354.230 ns | 324.4000 ns | 303.4440 ns | 95,391.040 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | GetItem | List | RecyclableLongList | 65536 | 111,175.301 ns | 711.9269 ns | 665.9368 ns | 110,790.015 ns | 1.17 | 0.01 | 2 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | GetItem | List | RecyclableLongList | 131072 | 190,302.858 ns | 259.6908 ns | 202.7495 ns | 190,348.962 ns | 1.00 | 0.00 | 3 B | 1.00 | +| Actual | GetItem | List | RecyclableLongList | 131072 | 221,654.380 ns | 593.1635 ns | 495.3184 ns | 221,454.614 ns | 1.16 | 0.00 | 3 B | 1.00 | + +
+ +
+this[] Setter Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio | +|--------- |--------- |------------- |------------------- |---------------- |-----------------:|---------------:|---------------:|-----------------:|------:|--------:|----------:|------------:| +| Baseline | SetItem | List | PooledList | 0 | 5.103 ns | 0.0171 ns | 0.0160 ns | 5.105 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 0 | 5.100 ns | 0.0237 ns | 0.0210 ns | 5.093 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 1 | 5.050 ns | 0.0284 ns | 0.0266 ns | 5.044 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 1 | 5.095 ns | 0.0802 ns | 0.0750 ns | 5.051 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 2 | 6.183 ns | 0.0384 ns | 0.0320 ns | 6.178 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 2 | 6.156 ns | 0.0085 ns | 0.0071 ns | 6.157 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 3 | 7.723 ns | 0.0139 ns | 0.0130 ns | 7.724 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 3 | 7.713 ns | 0.0390 ns | 0.0346 ns | 7.712 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 4 | 8.871 ns | 0.0244 ns | 0.0216 ns | 8.874 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 4 | 8.862 ns | 0.0164 ns | 0.0153 ns | 8.859 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 5 | 9.909 ns | 0.0681 ns | 0.0637 ns | 9.907 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 5 | 9.960 ns | 0.1300 ns | 0.1216 ns | 9.944 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 6 | 10.948 ns | 0.1666 ns | 0.1558 ns | 10.907 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 6 | 10.824 ns | 0.0642 ns | 0.0601 ns | 10.803 ns | 0.99 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 7 | 12.308 ns | 0.2760 ns | 0.4377 ns | 12.159 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 7 | 12.070 ns | 0.1569 ns | 0.1468 ns | 12.050 ns | 0.97 | 0.05 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 8 | 12.704 ns | 0.1175 ns | 0.1099 ns | 12.740 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 8 | 12.701 ns | 0.1207 ns | 0.1129 ns | 12.654 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 9 | 14.148 ns | 0.2327 ns | 0.2177 ns | 14.029 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 9 | 13.977 ns | 0.0509 ns | 0.0476 ns | 13.961 ns | 0.99 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 10 | 15.826 ns | 0.2243 ns | 0.1988 ns | 15.751 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 10 | 15.798 ns | 0.1065 ns | 0.0996 ns | 15.807 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 11 | 17.334 ns | 0.1308 ns | 0.1223 ns | 17.270 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 11 | 17.217 ns | 0.0460 ns | 0.0408 ns | 17.204 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 12 | 18.936 ns | 0.0664 ns | 0.0621 ns | 18.938 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 12 | 18.917 ns | 0.0310 ns | 0.0275 ns | 18.910 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 13 | 20.818 ns | 0.2407 ns | 0.2252 ns | 20.783 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 13 | 21.113 ns | 0.2407 ns | 0.2251 ns | 21.110 ns | 1.01 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 14 | 22.505 ns | 0.1524 ns | 0.1351 ns | 22.495 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 14 | 23.010 ns | 0.3177 ns | 0.2816 ns | 22.993 ns | 1.02 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 15 | 24.641 ns | 0.3720 ns | 0.3297 ns | 24.599 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 15 | 24.129 ns | 0.1323 ns | 0.1237 ns | 24.112 ns | 0.98 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 16 | 25.918 ns | 0.1618 ns | 0.1434 ns | 25.937 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 16 | 25.986 ns | 0.2334 ns | 0.2184 ns | 25.933 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 17 | 27.805 ns | 0.2277 ns | 0.2129 ns | 27.831 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 17 | 27.481 ns | 0.1161 ns | 0.1029 ns | 27.499 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 18 | 29.440 ns | 0.2658 ns | 0.2220 ns | 29.446 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 18 | 29.930 ns | 0.6224 ns | 0.6392 ns | 29.754 ns | 1.02 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 19 | 31.452 ns | 0.5389 ns | 0.4500 ns | 31.469 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 19 | 31.310 ns | 0.4873 ns | 0.4319 ns | 31.131 ns | 1.00 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 20 | 32.811 ns | 0.2576 ns | 0.2283 ns | 32.714 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 20 | 32.725 ns | 0.2172 ns | 0.2032 ns | 32.697 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 30 | 49.587 ns | 0.2819 ns | 0.2201 ns | 49.549 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 30 | 49.570 ns | 0.2785 ns | 0.2469 ns | 49.567 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 32 | 52.885 ns | 0.2549 ns | 0.2385 ns | 52.811 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 32 | 52.853 ns | 0.3732 ns | 0.3491 ns | 52.681 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 36 | 58.842 ns | 0.2818 ns | 0.2498 ns | 58.796 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 36 | 59.101 ns | 0.5022 ns | 0.4194 ns | 59.028 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 37 | 60.554 ns | 0.1693 ns | 0.1414 ns | 60.561 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 37 | 60.666 ns | 0.2363 ns | 0.2210 ns | 60.598 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 40 | 65.960 ns | 0.3043 ns | 0.2697 ns | 65.884 ns | 1.00 | 0.00 | - | NA | +| Baseline | SetItem | List | PooledList | 40 | 66.048 ns | 0.2830 ns | 0.2209 ns | 66.168 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 40 | 66.043 ns | 0.2166 ns | 0.1920 ns | 66.094 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 40 | 66.877 ns | 0.2354 ns | 0.2087 ns | 66.909 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 50 | 83.433 ns | 0.2620 ns | 0.2046 ns | 83.396 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 50 | 84.313 ns | 0.8985 ns | 0.8405 ns | 84.081 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 60 | 102.372 ns | 1.3392 ns | 1.1183 ns | 102.158 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 60 | 101.079 ns | 0.1732 ns | 0.1535 ns | 101.096 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 70 | 118.242 ns | 0.3427 ns | 0.3038 ns | 118.176 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 70 | 118.983 ns | 1.2317 ns | 1.0918 ns | 118.424 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 80 | 135.922 ns | 0.2631 ns | 0.2054 ns | 135.988 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 80 | 136.791 ns | 1.4803 ns | 1.3846 ns | 136.196 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 90 | 153.854 ns | 0.5985 ns | 0.5598 ns | 153.819 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 90 | 153.641 ns | 0.8821 ns | 0.7366 ns | 153.721 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 100 | 175.565 ns | 3.3769 ns | 4.1471 ns | 175.703 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 100 | 172.267 ns | 0.7617 ns | 0.6361 ns | 172.520 ns | 0.98 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 128 | 225.628 ns | 3.1487 ns | 2.9453 ns | 224.846 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 128 | 220.946 ns | 0.3092 ns | 0.2741 ns | 220.977 ns | 0.98 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 256 | 445.129 ns | 0.8922 ns | 0.8345 ns | 445.147 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 256 | 447.566 ns | 3.3103 ns | 2.9345 ns | 447.040 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 512 | 903.438 ns | 5.6756 ns | 4.7394 ns | 902.990 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 512 | 906.238 ns | 7.9669 ns | 7.0625 ns | 905.876 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 1024 | 1,814.556 ns | 14.5947 ns | 12.9378 ns | 1,813.487 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 1024 | 1,811.492 ns | 12.6903 ns | 11.2496 ns | 1,808.885 ns | 1.00 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 2048 | 3,602.719 ns | 17.9662 ns | 16.8056 ns | 3,594.394 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 2048 | 3,652.575 ns | 45.6346 ns | 42.6867 ns | 3,632.915 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 4096 | 7,198.960 ns | 15.2979 ns | 11.9436 ns | 7,198.082 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 4096 | 7,270.793 ns | 37.8028 ns | 33.5112 ns | 7,280.167 ns | 1.01 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 8192 | 14,484.956 ns | 69.2892 ns | 57.8596 ns | 14,481.416 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 8192 | 15,262.408 ns | 301.1303 ns | 721.4890 ns | 15,298.782 ns | 1.09 | 0.06 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 16384 | 29,742.475 ns | 589.9692 ns | 1,205.1507 ns | 29,057.147 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 16384 | 29,035.933 ns | 194.1147 ns | 172.0776 ns | 29,000.674 ns | 0.96 | 0.04 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 32768 | 58,708.778 ns | 260.4952 ns | 243.6674 ns | 58,758.472 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 32768 | 58,345.286 ns | 255.4219 ns | 226.4248 ns | 58,264.194 ns | 0.99 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 65536 | 117,017.933 ns | 370.1307 ns | 346.2205 ns | 116,882.086 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 65536 | 117,071.260 ns | 376.4902 ns | 314.3864 ns | 117,026.349 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 131072 | 239,911.071 ns | 4,723.9668 ns | 5,974.3055 ns | 235,766.846 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | PooledList | 131072 | 233,139.014 ns | 398.5584 ns | 372.8117 ns | 233,199.683 ns | 0.96 | 0.02 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | PooledList | 850000 | 1,614,054.311 ns | 1,881.5120 ns | 1,667.9114 ns | 1,614,055.957 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | SetItem | List | PooledList | 850000 | 1,636,356.362 ns | 1,904.0917 ns | 1,687.9277 ns | 1,635,736.133 ns | 1.01 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 0 | 4.156 ns | 0.0040 ns | 0.0033 ns | 4.156 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 0 | 4.161 ns | 0.0079 ns | 0.0062 ns | 4.162 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 1 | 5.042 ns | 0.0171 ns | 0.0143 ns | 5.035 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 1 | 4.720 ns | 0.0313 ns | 0.0293 ns | 4.701 ns | 0.94 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 2 | 6.141 ns | 0.0361 ns | 0.0338 ns | 6.131 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 2 | 5.807 ns | 0.0400 ns | 0.0375 ns | 5.819 ns | 0.95 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 3 | 7.664 ns | 0.0277 ns | 0.0259 ns | 7.656 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 3 | 7.001 ns | 0.0324 ns | 0.0303 ns | 6.992 ns | 0.91 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 4 | 8.861 ns | 0.0120 ns | 0.0113 ns | 8.862 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 4 | 8.193 ns | 0.0374 ns | 0.0350 ns | 8.175 ns | 0.92 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 5 | 9.823 ns | 0.0589 ns | 0.0551 ns | 9.817 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 5 | 8.929 ns | 0.0318 ns | 0.0298 ns | 8.935 ns | 0.91 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 6 | 10.710 ns | 0.0528 ns | 0.0494 ns | 10.690 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 6 | 9.779 ns | 0.0509 ns | 0.0476 ns | 9.797 ns | 0.91 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 7 | 11.510 ns | 0.0509 ns | 0.0477 ns | 11.537 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 7 | 10.224 ns | 0.0155 ns | 0.0129 ns | 10.224 ns | 0.89 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 8 | 12.455 ns | 0.1109 ns | 0.1038 ns | 12.464 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 8 | 11.120 ns | 0.0525 ns | 0.0491 ns | 11.120 ns | 0.89 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 9 | 13.854 ns | 0.0651 ns | 0.0609 ns | 13.864 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 9 | 11.899 ns | 0.0302 ns | 0.0283 ns | 11.888 ns | 0.86 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 10 | 15.569 ns | 0.0810 ns | 0.0758 ns | 15.537 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 10 | 12.573 ns | 0.0439 ns | 0.0410 ns | 12.567 ns | 0.81 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 11 | 17.148 ns | 0.0811 ns | 0.0758 ns | 17.151 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 11 | 13.365 ns | 0.0561 ns | 0.0525 ns | 13.377 ns | 0.78 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 12 | 18.848 ns | 0.0419 ns | 0.0372 ns | 18.854 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 12 | 14.158 ns | 0.0200 ns | 0.0187 ns | 14.151 ns | 0.75 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 13 | 20.596 ns | 0.0394 ns | 0.0369 ns | 20.600 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 13 | 14.823 ns | 0.0437 ns | 0.0409 ns | 14.826 ns | 0.72 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 14 | 22.222 ns | 0.0435 ns | 0.0407 ns | 22.226 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 14 | 15.547 ns | 0.0364 ns | 0.0323 ns | 15.545 ns | 0.70 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 15 | 23.967 ns | 0.1462 ns | 0.1367 ns | 23.979 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 15 | 16.288 ns | 0.0467 ns | 0.0390 ns | 16.288 ns | 0.68 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 16 | 25.516 ns | 0.0227 ns | 0.0190 ns | 25.518 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 16 | 17.142 ns | 0.1401 ns | 0.1311 ns | 17.076 ns | 0.67 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 17 | 27.208 ns | 0.0501 ns | 0.0418 ns | 27.207 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 17 | 17.746 ns | 0.1036 ns | 0.0969 ns | 17.727 ns | 0.65 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 18 | 28.856 ns | 0.1391 ns | 0.1301 ns | 28.818 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 18 | 18.452 ns | 0.0529 ns | 0.0469 ns | 18.440 ns | 0.64 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 19 | 30.485 ns | 0.1158 ns | 0.1083 ns | 30.439 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 19 | 19.228 ns | 0.0725 ns | 0.0679 ns | 19.238 ns | 0.63 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 20 | 32.198 ns | 0.1400 ns | 0.1309 ns | 32.177 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 20 | 20.006 ns | 0.0802 ns | 0.0750 ns | 19.984 ns | 0.62 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 30 | 48.866 ns | 0.1972 ns | 0.1844 ns | 48.786 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 30 | 27.271 ns | 0.1413 ns | 0.1322 ns | 27.330 ns | 0.56 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 32 | 52.267 ns | 0.1993 ns | 0.1865 ns | 52.185 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 32 | 28.790 ns | 0.1928 ns | 0.1804 ns | 28.730 ns | 0.55 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 36 | 59.086 ns | 0.1370 ns | 0.1069 ns | 59.062 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 36 | 32.022 ns | 0.1975 ns | 0.1751 ns | 32.011 ns | 0.54 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 37 | 60.990 ns | 0.1680 ns | 0.1571 ns | 60.938 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 37 | 32.277 ns | 0.2095 ns | 0.1960 ns | 32.182 ns | 0.53 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 40 | 66.020 ns | 0.3297 ns | 0.3084 ns | 65.898 ns | 1.00 | 0.00 | - | NA | +| Baseline | SetItem | List | RecyclableList | 40 | 65.355 ns | 0.2859 ns | 0.2674 ns | 65.212 ns | 0.99 | 0.01 | - | NA | +| Actual | SetItem | List | RecyclableList | 40 | 34.545 ns | 0.2373 ns | 0.2220 ns | 34.543 ns | 0.52 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 40 | 35.101 ns | 0.3045 ns | 0.2848 ns | 35.234 ns | 0.53 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 50 | 83.164 ns | 0.1985 ns | 0.1857 ns | 83.173 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 50 | 41.963 ns | 0.0545 ns | 0.0509 ns | 41.958 ns | 0.50 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 60 | 100.384 ns | 0.1905 ns | 0.1782 ns | 100.371 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 60 | 49.250 ns | 0.2741 ns | 0.2564 ns | 49.215 ns | 0.49 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 70 | 117.084 ns | 0.1740 ns | 0.1543 ns | 117.083 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 70 | 57.215 ns | 0.4810 ns | 0.4264 ns | 57.015 ns | 0.49 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 80 | 134.850 ns | 0.2508 ns | 0.2346 ns | 134.826 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 80 | 63.910 ns | 0.2125 ns | 0.1988 ns | 63.798 ns | 0.47 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 90 | 151.902 ns | 0.3191 ns | 0.2829 ns | 151.926 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 90 | 70.334 ns | 0.1558 ns | 0.1381 ns | 70.312 ns | 0.46 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 100 | 169.898 ns | 0.3010 ns | 0.2668 ns | 169.854 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 100 | 83.242 ns | 0.5769 ns | 0.5114 ns | 83.195 ns | 0.49 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 128 | 218.509 ns | 0.4452 ns | 0.4165 ns | 218.412 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 128 | 102.693 ns | 0.6832 ns | 0.6391 ns | 102.592 ns | 0.47 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 256 | 441.374 ns | 0.5467 ns | 0.4846 ns | 441.315 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 256 | 195.366 ns | 0.5711 ns | 0.4769 ns | 195.342 ns | 0.44 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 512 | 890.019 ns | 1.4326 ns | 1.3401 ns | 889.832 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 512 | 381.412 ns | 0.9534 ns | 0.8919 ns | 381.402 ns | 0.43 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 1024 | 1,784.926 ns | 3.5513 ns | 3.3219 ns | 1,783.905 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 1024 | 756.539 ns | 2.8184 ns | 2.6364 ns | 756.645 ns | 0.42 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 2048 | 3,560.123 ns | 5.8350 ns | 5.4580 ns | 3,559.407 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 2048 | 1,535.637 ns | 3.6021 ns | 3.3694 ns | 1,534.931 ns | 0.43 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 4096 | 7,106.307 ns | 8.0662 ns | 6.7356 ns | 7,104.748 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 4096 | 3,083.148 ns | 16.7197 ns | 14.8216 ns | 3,080.522 ns | 0.43 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 8192 | 14,244.027 ns | 38.1153 ns | 33.7882 ns | 14,224.635 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 8192 | 6,189.434 ns | 121.5271 ns | 153.6929 ns | 6,118.095 ns | 0.44 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 16384 | 28,373.944 ns | 63.4455 ns | 56.2427 ns | 28,378.809 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableList | 16384 | 12,253.457 ns | 41.7170 ns | 36.9810 ns | 12,240.319 ns | 0.43 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 32768 | 57,291.683 ns | 75.8897 ns | 70.9873 ns | 57,264.532 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | SetItem | List | RecyclableList | 32768 | 52,664.990 ns | 1,600.4152 ns | 4,718.8604 ns | 54,821.466 ns | 0.89 | 0.10 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 65536 | 114,542.764 ns | 131.5650 ns | 123.0660 ns | 114,604.321 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | SetItem | List | RecyclableList | 65536 | 104,949.636 ns | 3,246.2519 ns | 9,571.6470 ns | 110,177.533 ns | 0.90 | 0.10 | 2 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 131072 | 227,530.510 ns | 480.6588 ns | 401.3719 ns | 227,454.102 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | SetItem | List | RecyclableList | 131072 | 213,330.067 ns | 5,820.4604 ns | 16,793.3592 ns | 220,374.353 ns | 0.94 | 0.07 | 3 B | 1.50 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableList | 850000 | 1,635,076.510 ns | 12,454.8715 ns | 11,650.2945 ns | 1,630,901.758 ns | 1.00 | 0.00 | 25 B | 1.00 | +| Actual | SetItem | List | RecyclableList | 850000 | 1,558,273.837 ns | 29,608.9837 ns | 35,247.3888 ns | 1,565,659.570 ns | 0.95 | 0.02 | 25 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 0 | 6.542 ns | 0.2424 ns | 0.7148 ns | 6.693 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 0 | 4.594 ns | 0.0255 ns | 0.0239 ns | 4.589 ns | 0.72 | 0.11 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 1 | 5.025 ns | 0.0078 ns | 0.0069 ns | 5.028 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 1 | 5.659 ns | 0.0095 ns | 0.0088 ns | 5.662 ns | 1.13 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 2 | 6.099 ns | 0.0434 ns | 0.0385 ns | 6.109 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 2 | 8.196 ns | 0.0460 ns | 0.0430 ns | 8.200 ns | 1.34 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 3 | 7.644 ns | 0.0388 ns | 0.0344 ns | 7.642 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 3 | 9.213 ns | 0.0131 ns | 0.0109 ns | 9.212 ns | 1.21 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 4 | 8.841 ns | 0.0174 ns | 0.0136 ns | 8.847 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 4 | 10.723 ns | 0.0352 ns | 0.0330 ns | 10.724 ns | 1.21 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 5 | 9.781 ns | 0.0081 ns | 0.0071 ns | 9.781 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 5 | 12.036 ns | 0.0146 ns | 0.0114 ns | 12.035 ns | 1.23 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 6 | 10.708 ns | 0.0249 ns | 0.0233 ns | 10.693 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 6 | 13.773 ns | 0.0395 ns | 0.0350 ns | 13.784 ns | 1.29 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 7 | 11.528 ns | 0.0544 ns | 0.0509 ns | 11.502 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 7 | 14.909 ns | 0.0482 ns | 0.0428 ns | 14.912 ns | 1.29 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 8 | 12.412 ns | 0.0407 ns | 0.0340 ns | 12.421 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 8 | 16.475 ns | 0.0817 ns | 0.0765 ns | 16.487 ns | 1.33 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 9 | 13.806 ns | 0.0766 ns | 0.0717 ns | 13.784 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 9 | 18.070 ns | 0.1220 ns | 0.1141 ns | 18.047 ns | 1.31 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 10 | 15.496 ns | 0.0629 ns | 0.0588 ns | 15.475 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 10 | 19.438 ns | 0.0573 ns | 0.0536 ns | 19.433 ns | 1.25 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 11 | 17.066 ns | 0.0414 ns | 0.0346 ns | 17.053 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 11 | 20.802 ns | 0.1217 ns | 0.1139 ns | 20.796 ns | 1.22 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 12 | 18.804 ns | 0.0796 ns | 0.0744 ns | 18.775 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 12 | 22.465 ns | 0.0750 ns | 0.0702 ns | 22.487 ns | 1.19 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 13 | 20.438 ns | 0.0832 ns | 0.0779 ns | 20.416 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 13 | 23.807 ns | 0.1355 ns | 0.1267 ns | 23.854 ns | 1.16 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 14 | 22.115 ns | 0.0799 ns | 0.0747 ns | 22.076 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 14 | 25.292 ns | 0.1482 ns | 0.1387 ns | 25.347 ns | 1.14 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 15 | 23.781 ns | 0.1056 ns | 0.0988 ns | 23.826 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 15 | 26.799 ns | 0.1866 ns | 0.1745 ns | 26.806 ns | 1.13 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 16 | 25.489 ns | 0.1171 ns | 0.1095 ns | 25.532 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 16 | 28.513 ns | 0.2027 ns | 0.1896 ns | 28.513 ns | 1.12 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 17 | 27.236 ns | 0.0628 ns | 0.0588 ns | 27.210 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 17 | 29.802 ns | 0.0698 ns | 0.0583 ns | 29.778 ns | 1.09 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 18 | 28.953 ns | 0.0871 ns | 0.0815 ns | 28.943 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 18 | 31.238 ns | 0.2010 ns | 0.1881 ns | 31.232 ns | 1.08 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 19 | 30.489 ns | 0.1496 ns | 0.1400 ns | 30.439 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 19 | 32.718 ns | 0.2164 ns | 0.2024 ns | 32.685 ns | 1.07 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 20 | 32.126 ns | 0.0849 ns | 0.0753 ns | 32.095 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 20 | 34.373 ns | 0.1937 ns | 0.1618 ns | 34.393 ns | 1.07 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 30 | 48.850 ns | 0.1431 ns | 0.1339 ns | 48.782 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 30 | 49.625 ns | 0.1209 ns | 0.1131 ns | 49.595 ns | 1.02 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 32 | 52.158 ns | 0.0960 ns | 0.0802 ns | 52.138 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 32 | 52.982 ns | 0.1951 ns | 0.1730 ns | 52.996 ns | 1.02 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 36 | 58.923 ns | 0.0680 ns | 0.0636 ns | 58.932 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 36 | 60.999 ns | 1.2144 ns | 1.4456 ns | 61.677 ns | 1.03 | 0.03 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 37 | 60.981 ns | 0.1422 ns | 0.1330 ns | 60.935 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 37 | 59.821 ns | 0.9038 ns | 0.8454 ns | 60.248 ns | 0.98 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 40 | 65.697 ns | 0.0664 ns | 0.0589 ns | 65.695 ns | 1.00 | 0.00 | - | NA | +| Baseline | SetItem | List | RecyclableLongList | 40 | 66.420 ns | 0.1375 ns | 0.1286 ns | 66.382 ns | 1.01 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 40 | 65.534 ns | 0.4883 ns | 0.4568 ns | 65.506 ns | 1.00 | 0.01 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 40 | 64.957 ns | 0.7585 ns | 0.7095 ns | 65.131 ns | 0.99 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 50 | 82.854 ns | 0.2000 ns | 0.1871 ns | 82.765 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 50 | 82.505 ns | 0.3937 ns | 0.3490 ns | 82.504 ns | 1.00 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 60 | 100.261 ns | 0.1607 ns | 0.1503 ns | 100.299 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 60 | 97.532 ns | 0.6003 ns | 0.5615 ns | 97.518 ns | 0.97 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 70 | 117.551 ns | 0.2649 ns | 0.2478 ns | 117.499 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 70 | 114.466 ns | 0.6859 ns | 0.6416 ns | 114.497 ns | 0.97 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 80 | 135.250 ns | 0.4412 ns | 0.4127 ns | 135.131 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 80 | 129.391 ns | 0.7980 ns | 0.7074 ns | 129.364 ns | 0.96 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 100 | 169.776 ns | 0.1301 ns | 0.1153 ns | 169.760 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 100 | 160.278 ns | 0.9019 ns | 0.8436 ns | 160.288 ns | 0.94 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 128 | 219.352 ns | 0.5782 ns | 0.5408 ns | 219.438 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 128 | 207.590 ns | 0.9508 ns | 0.8893 ns | 207.527 ns | 0.95 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 256 | 441.669 ns | 0.5803 ns | 0.5144 ns | 441.543 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 256 | 409.848 ns | 6.2375 ns | 5.8345 ns | 409.970 ns | 0.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 512 | 888.875 ns | 0.5806 ns | 0.4848 ns | 888.858 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 512 | 801.378 ns | 8.6206 ns | 7.6419 ns | 800.193 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 1024 | 1,781.131 ns | 1.0381 ns | 0.9710 ns | 1,780.862 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 1024 | 1,605.911 ns | 13.8722 ns | 11.5839 ns | 1,608.300 ns | 0.90 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 2048 | 3,569.133 ns | 6.7815 ns | 6.3435 ns | 3,571.936 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 2048 | 3,266.587 ns | 34.6037 ns | 28.8956 ns | 3,271.237 ns | 0.92 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 4096 | 7,109.312 ns | 9.8761 ns | 9.2381 ns | 7,105.371 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 4096 | 6,636.983 ns | 26.9146 ns | 25.1760 ns | 6,632.346 ns | 0.93 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 8192 | 14,233.875 ns | 13.8498 ns | 12.2775 ns | 14,234.982 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 8192 | 13,282.448 ns | 45.6999 ns | 42.7477 ns | 13,279.364 ns | 0.93 | 0.00 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 16384 | 28,503.933 ns | 81.9571 ns | 76.6627 ns | 28,487.123 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 16384 | 26,464.668 ns | 171.8065 ns | 160.7079 ns | 26,460.243 ns | 0.93 | 0.01 | - | NA | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 32768 | 57,326.667 ns | 242.8422 ns | 227.1547 ns | 57,222.314 ns | 1.00 | 0.00 | 1 B | 1.00 | +| Actual | SetItem | List | RecyclableLongList | 32768 | 55,355.616 ns | 93.1621 ns | 77.7946 ns | 55,332.666 ns | 0.97 | 0.00 | 1 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 65536 | 114,002.581 ns | 131.1817 ns | 122.7074 ns | 113,951.843 ns | 1.00 | 0.00 | 2 B | 1.00 | +| Actual | SetItem | List | RecyclableLongList | 65536 | 109,114.963 ns | 466.7859 ns | 389.7874 ns | 109,180.310 ns | 0.96 | 0.00 | 2 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 131072 | 227,937.367 ns | 282.4864 ns | 250.4168 ns | 227,909.534 ns | 1.00 | 0.00 | 3 B | 1.00 | +| Actual | SetItem | List | RecyclableLongList | 131072 | 221,966.255 ns | 644.8796 ns | 603.2207 ns | 222,073.511 ns | 0.97 | 0.00 | 3 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 850000 | 1,626,362.142 ns | 5,010.4787 ns | 3,911.8522 ns | 1,625,986.523 ns | 1.00 | 0.00 | 25 B | 1.00 | +| Actual | SetItem | List | RecyclableLongList | 850000 | 1,584,812.005 ns | 12,789.2487 ns | 11,963.0712 ns | 1,585,505.859 ns | 0.98 | 0.01 | 25 B | 1.00 | +| | | | | | | | | | | | | | +| Baseline | SetItem | List | RecyclableLongList | 90 | 152.769 ns | 0.3186 ns | 0.2980 ns | 152.770 ns | 1.00 | 0.00 | - | NA | +| Actual | SetItem | List | RecyclableLongList | 90 | 145.514 ns | 1.2202 ns | 1.1413 ns | 145.627 ns | 0.95 | 0.01 | - | NA | +
+ +# `RemoveAt` Benchmarks +## Environment +```csharp +BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2) +AMD Ryzen 7 4700U with Radeon Graphics, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 + DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2 +``` +
+RemoveAt from the Beginning Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |-------------------- |------------- |------------------- |---------------- |---------------------:|---------------------:|---------------------:|------:|--------:|--------:|--------:|--------:|----------:|------------:| +| Baseline | RemoveAt_FirstItems | List | PooledList | 0 | 20.54 ns | 0.331 ns | 0.310 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 0 | 14.75 ns | 0.321 ns | 0.450 ns | 0.73 | 0.02 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 1 | 29.39 ns | 0.406 ns | 0.380 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 1 | 37.53 ns | 0.599 ns | 0.531 ns | 1.28 | 0.02 | 0.0268 | - | - | 56 B | 0.88 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 2 | 33.15 ns | 0.122 ns | 0.102 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 2 | 44.17 ns | 0.421 ns | 0.373 ns | 1.33 | 0.01 | 0.0268 | - | - | 56 B | 0.78 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 3 | 44.53 ns | 0.102 ns | 0.080 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 3 | 59.26 ns | 0.606 ns | 0.566 ns | 1.33 | 0.01 | 0.0267 | - | - | 56 B | 0.70 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 4 | 56.17 ns | 0.601 ns | 0.533 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 4 | 74.16 ns | 0.136 ns | 0.121 ns | 1.32 | 0.01 | 0.0267 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 5 | 67.14 ns | 0.642 ns | 0.569 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 5 | 78.28 ns | 1.345 ns | 1.192 ns | 1.17 | 0.02 | 0.0267 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 6 | 85.15 ns | 0.483 ns | 0.377 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 6 | 92.33 ns | 1.503 ns | 1.406 ns | 1.09 | 0.01 | 0.0267 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 7 | 98.55 ns | 0.819 ns | 0.766 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 7 | 103.13 ns | 0.838 ns | 0.784 ns | 1.05 | 0.01 | 0.0267 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 8 | 110.61 ns | 0.934 ns | 0.828 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 8 | 116.73 ns | 1.129 ns | 1.056 ns | 1.05 | 0.01 | 0.0267 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 9 | 123.14 ns | 2.086 ns | 1.952 ns | 1.00 | 0.00 | 0.0610 | - | - | 128 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 9 | 129.70 ns | 1.832 ns | 1.713 ns | 1.05 | 0.02 | 0.0267 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 10 | 44.05 ns | 0.732 ns | 0.685 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 10 | 56.53 ns | 0.516 ns | 0.483 ns | 1.28 | 0.02 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 11 | 46.15 ns | 0.848 ns | 0.793 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 11 | 58.43 ns | 0.815 ns | 0.763 ns | 1.27 | 0.03 | 0.0267 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 12 | 45.24 ns | 0.899 ns | 0.999 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 12 | 58.93 ns | 0.689 ns | 0.644 ns | 1.30 | 0.03 | 0.0267 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 13 | 44.88 ns | 0.444 ns | 0.415 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 13 | 59.15 ns | 0.405 ns | 0.379 ns | 1.32 | 0.01 | 0.0267 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 14 | 46.35 ns | 0.820 ns | 0.727 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 14 | 58.81 ns | 0.530 ns | 0.496 ns | 1.27 | 0.02 | 0.0267 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 15 | 45.22 ns | 0.324 ns | 0.287 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 15 | 58.03 ns | 0.434 ns | 0.406 ns | 1.28 | 0.01 | 0.0267 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 16 | 45.02 ns | 0.251 ns | 0.209 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 16 | 57.13 ns | 0.960 ns | 0.898 ns | 1.27 | 0.02 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 17 | 45.24 ns | 0.222 ns | 0.197 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 17 | 56.26 ns | 0.504 ns | 0.472 ns | 1.24 | 0.01 | 0.0267 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 18 | 45.94 ns | 0.320 ns | 0.299 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 18 | 56.00 ns | 0.630 ns | 0.590 ns | 1.22 | 0.02 | 0.0267 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 19 | 48.61 ns | 0.886 ns | 0.829 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 19 | 59.62 ns | 0.745 ns | 0.660 ns | 1.22 | 0.03 | 0.0267 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 20 | 60.56 ns | 0.767 ns | 0.718 ns | 1.00 | 0.00 | 0.1032 | - | - | 216 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 20 | 71.13 ns | 0.618 ns | 0.578 ns | 1.17 | 0.02 | 0.0267 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 30 | 76.45 ns | 0.373 ns | 0.312 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 30 | 82.42 ns | 0.363 ns | 0.339 ns | 1.08 | 0.01 | 0.0267 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 32 | 77.01 ns | 0.423 ns | 0.395 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 32 | 83.92 ns | 0.335 ns | 0.314 ns | 1.09 | 0.01 | 0.0267 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 36 | 84.65 ns | 0.705 ns | 0.659 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 36 | 85.05 ns | 0.736 ns | 0.689 ns | 1.00 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 37 | 85.21 ns | 0.191 ns | 0.159 ns | 1.00 | 0.00 | 0.1682 | - | - | 352 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 37 | 85.03 ns | 1.003 ns | 0.938 ns | 1.00 | 0.01 | 0.0267 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 40 | 104.39 ns | 0.525 ns | 0.466 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | RemoveAt_FirstItems | List | PooledList | 40 | 105.55 ns | 0.391 ns | 0.326 ns | 1.01 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 40 | 100.92 ns | 0.479 ns | 0.448 ns | 0.97 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | +| Actual | RemoveAt_FirstItems | List | PooledList | 40 | 119.62 ns | 0.809 ns | 0.757 ns | 1.15 | 0.01 | 0.0267 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 50 | 123.57 ns | 0.554 ns | 0.463 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 50 | 132.59 ns | 0.646 ns | 0.604 ns | 1.07 | 0.00 | 0.0267 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 60 | 154.68 ns | 0.337 ns | 0.281 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 60 | 153.93 ns | 1.432 ns | 1.340 ns | 0.99 | 0.01 | 0.0267 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 70 | 182.22 ns | 0.469 ns | 0.392 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 70 | 183.53 ns | 1.196 ns | 1.119 ns | 1.01 | 0.01 | 0.0267 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 80 | 203.56 ns | 0.360 ns | 0.319 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 80 | 204.01 ns | 0.526 ns | 0.466 ns | 1.00 | 0.00 | 0.0267 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 90 | 231.01 ns | 0.448 ns | 0.374 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 90 | 219.95 ns | 0.722 ns | 0.640 ns | 0.95 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 100 | 257.73 ns | 0.503 ns | 0.393 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 100 | 250.36 ns | 1.081 ns | 1.011 ns | 0.97 | 0.00 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 128 | 312.63 ns | 0.663 ns | 0.588 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 128 | 299.55 ns | 1.075 ns | 0.898 ns | 0.96 | 0.00 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 256 | 787.59 ns | 2.441 ns | 2.164 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 256 | 725.06 ns | 1.121 ns | 0.936 ns | 0.92 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 512 | 2,338.01 ns | 27.678 ns | 23.112 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | PooledList | 512 | 2,164.00 ns | 8.623 ns | 8.066 ns | 0.93 | 0.01 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 1024 | 7,689.34 ns | 55.299 ns | 49.021 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 1024 | 7,251.25 ns | 30.736 ns | 28.750 ns | 0.94 | 0.01 | 0.0229 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 2048 | 27,949.04 ns | 175.224 ns | 163.905 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 2048 | 26,652.86 ns | 130.093 ns | 121.689 ns | 0.95 | 0.01 | - | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 4096 | 125,715.95 ns | 823.881 ns | 770.659 ns | 1.00 | 0.00 | 15.3809 | - | - | 32824 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 4096 | 125,496.41 ns | 442.949 ns | 392.663 ns | 1.00 | 0.01 | - | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 8192 | 669,019.36 ns | 1,260.304 ns | 1,178.889 ns | 1.00 | 0.00 | 30.2734 | - | - | 65593 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 8192 | 681,675.29 ns | 1,192.279 ns | 1,115.259 ns | 1.02 | 0.00 | - | - | - | 57 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 16384 | 2,662,326.12 ns | 6,344.067 ns | 5,934.244 ns | 1.00 | 0.00 | 39.0625 | 39.0625 | 39.0625 | 131143 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 16384 | 2,523,706.00 ns | 8,213.341 ns | 7,682.764 ns | 0.95 | 0.00 | - | - | - | 60 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 32768 | 10,347,766.35 ns | 26,245.960 ns | 24,550.487 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 262236 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 32768 | 10,063,751.79 ns | 21,485.615 ns | 19,046.438 ns | 0.97 | 0.00 | - | - | - | 71 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 65536 | 41,709,063.33 ns | 203,900.445 ns | 190,728.603 ns | 1.00 | 0.00 | 83.3333 | 83.3333 | 83.3333 | 524420 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 65536 | 41,409,102.22 ns | 114,026.208 ns | 106,660.186 ns | 0.99 | 0.01 | - | - | - | 134 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 131072 | 204,476,157.78 ns | 942,848.836 ns | 881,941.386 ns | 1.00 | 0.00 | - | - | - | 1048832 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 131072 | 205,948,921.43 ns | 327,370.598 ns | 290,205.508 ns | 1.01 | 0.00 | - | - | - | 4480 B | 0.004 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | PooledList | 850000 | 67,335,200,687.50 ns | 1,336,632,884.501 ns | 1,312,752,216.332 ns | 1.00 | 0.00 | - | - | - | 6812992 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | PooledList | 850000 | 62,856,219,026.67 ns | 76,330,093.100 ns | 71,399,216.444 ns | 0.93 | 0.02 | - | - | - | 992 B | 0.000 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 0 | 16.49 ns | 0.116 ns | 0.109 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 0 | 24.31 ns | 0.214 ns | 0.190 ns | 1.47 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 1 | 27.16 ns | 0.069 ns | 0.061 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 1 | 23.26 ns | 0.141 ns | 0.125 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 2 | 33.19 ns | 0.111 ns | 0.098 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 2 | 27.90 ns | 0.359 ns | 0.318 ns | 0.84 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 3 | 44.32 ns | 0.358 ns | 0.335 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 3 | 40.98 ns | 0.288 ns | 0.240 ns | 0.93 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 4 | 54.16 ns | 0.283 ns | 0.236 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 4 | 51.07 ns | 0.526 ns | 0.492 ns | 0.94 | 0.01 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 5 | 64.52 ns | 0.107 ns | 0.089 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 5 | 76.45 ns | 0.430 ns | 0.382 ns | 1.19 | 0.01 | 0.0918 | - | - | 192 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 6 | 78.70 ns | 0.220 ns | 0.172 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 6 | 88.03 ns | 0.720 ns | 0.601 ns | 1.12 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 7 | 88.90 ns | 0.426 ns | 0.399 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 7 | 101.63 ns | 0.637 ns | 0.532 ns | 1.14 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 8 | 102.27 ns | 0.558 ns | 0.522 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 8 | 112.03 ns | 1.252 ns | 1.109 ns | 1.10 | 0.01 | 0.0918 | - | - | 192 B | 1.60 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 9 | 115.29 ns | 0.711 ns | 0.630 ns | 1.00 | 0.00 | 0.0610 | - | - | 128 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 9 | 129.07 ns | 0.600 ns | 0.501 ns | 1.12 | 0.01 | 0.1223 | - | - | 256 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 10 | 45.62 ns | 0.500 ns | 0.467 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 10 | 55.65 ns | 0.650 ns | 0.608 ns | 1.22 | 0.02 | 0.1224 | - | - | 256 B | 1.88 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 11 | 47.66 ns | 0.514 ns | 0.481 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 11 | 58.71 ns | 0.919 ns | 0.859 ns | 1.23 | 0.02 | 0.1223 | - | - | 256 B | 1.78 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 12 | 46.78 ns | 0.564 ns | 0.528 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 12 | 59.30 ns | 0.594 ns | 0.526 ns | 1.27 | 0.02 | 0.1223 | - | - | 256 B | 1.68 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 13 | 47.90 ns | 0.975 ns | 1.301 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 13 | 58.32 ns | 0.496 ns | 0.440 ns | 1.21 | 0.04 | 0.1224 | - | - | 256 B | 1.60 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 14 | 51.09 ns | 0.815 ns | 0.763 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 14 | 58.85 ns | 0.203 ns | 0.180 ns | 1.15 | 0.01 | 0.1223 | - | - | 256 B | 1.52 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 15 | 47.89 ns | 0.467 ns | 0.437 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 15 | 59.39 ns | 0.479 ns | 0.448 ns | 1.24 | 0.02 | 0.1224 | - | - | 256 B | 1.45 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 16 | 48.68 ns | 0.526 ns | 0.492 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 16 | 57.67 ns | 0.784 ns | 0.655 ns | 1.18 | 0.02 | 0.1223 | - | - | 256 B | 1.39 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 17 | 51.91 ns | 0.280 ns | 0.218 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 17 | 61.23 ns | 0.700 ns | 0.620 ns | 1.18 | 0.01 | 0.1836 | - | - | 384 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 18 | 48.68 ns | 0.585 ns | 0.519 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 18 | 60.21 ns | 0.734 ns | 0.651 ns | 1.24 | 0.02 | 0.1836 | - | - | 384 B | 1.92 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 19 | 50.32 ns | 0.648 ns | 0.606 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 19 | 63.19 ns | 0.454 ns | 0.403 ns | 1.26 | 0.02 | 0.1836 | - | - | 384 B | 1.85 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 20 | 60.28 ns | 0.734 ns | 0.687 ns | 1.00 | 0.00 | 0.1032 | - | - | 216 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 20 | 77.15 ns | 0.997 ns | 0.933 ns | 1.28 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 30 | 76.04 ns | 0.228 ns | 0.202 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 30 | 89.09 ns | 0.988 ns | 0.924 ns | 1.17 | 0.01 | 0.1836 | - | - | 384 B | 1.30 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 32 | 76.76 ns | 0.346 ns | 0.306 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 32 | 87.77 ns | 0.624 ns | 0.553 ns | 1.14 | 0.01 | 0.1836 | - | - | 384 B | 1.23 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 36 | 86.35 ns | 0.164 ns | 0.137 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 36 | 102.67 ns | 1.176 ns | 1.100 ns | 1.19 | 0.01 | 0.0650 | - | - | 136 B | 0.40 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 37 | 91.87 ns | 0.627 ns | 0.587 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 37 | 102.46 ns | 1.315 ns | 1.230 ns | 1.12 | 0.01 | 0.0650 | - | - | 136 B | 0.39 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 40 | 113.53 ns | 0.908 ns | 0.805 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 40 | 112.12 ns | 0.686 ns | 0.608 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 40 | 114.40 ns | 0.692 ns | 0.614 ns | 1.01 | 0.01 | 0.0648 | - | - | 136 B | 0.36 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 40 | 111.12 ns | 0.417 ns | 0.370 ns | 0.98 | 0.01 | 0.0648 | - | - | 136 B | 0.36 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 50 | 132.92 ns | 0.811 ns | 0.758 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 50 | 140.08 ns | 0.682 ns | 0.569 ns | 1.05 | 0.01 | 0.0648 | - | - | 136 B | 0.30 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 60 | 167.12 ns | 0.886 ns | 0.740 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 60 | 166.17 ns | 0.704 ns | 0.624 ns | 0.99 | 0.01 | 0.0648 | - | - | 136 B | 0.25 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 70 | 195.01 ns | 0.881 ns | 0.824 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 70 | 192.99 ns | 1.186 ns | 1.109 ns | 0.99 | 0.00 | 0.0648 | - | - | 136 B | 0.22 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 80 | 221.29 ns | 1.077 ns | 1.007 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 80 | 204.62 ns | 1.354 ns | 1.267 ns | 0.92 | 0.01 | 0.0648 | - | - | 136 B | 0.20 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 90 | 237.83 ns | 1.258 ns | 1.176 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 90 | 232.92 ns | 1.936 ns | 1.811 ns | 0.98 | 0.01 | 0.0648 | - | - | 136 B | 0.18 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 100 | 274.31 ns | 2.015 ns | 1.884 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 100 | 258.88 ns | 1.294 ns | 1.210 ns | 0.94 | 0.01 | 0.0648 | - | - | 136 B | 0.16 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 128 | 335.24 ns | 3.328 ns | 3.113 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 128 | 348.36 ns | 1.878 ns | 1.757 ns | 1.04 | 0.01 | 0.0648 | - | - | 136 B | 0.13 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 256 | 823.69 ns | 2.406 ns | 2.250 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 256 | 764.18 ns | 3.541 ns | 3.312 ns | 0.93 | 0.01 | 0.0648 | - | - | 136 B | 0.06 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 512 | 2,453.39 ns | 13.102 ns | 12.256 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 512 | 2,206.74 ns | 8.093 ns | 7.570 ns | 0.90 | 0.01 | 0.0648 | - | - | 136 B | 0.03 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 1024 | 7,810.05 ns | 42.727 ns | 39.966 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 1024 | 7,341.87 ns | 6.905 ns | 5.766 ns | 0.94 | 0.00 | 0.0610 | - | - | 136 B | 0.02 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 2048 | 28,144.76 ns | 92.303 ns | 86.340 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 2048 | 26,939.35 ns | 22.774 ns | 19.017 ns | 0.96 | 0.00 | 0.0610 | - | - | 136 B | 0.008 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 4096 | 130,086.90 ns | 503.516 ns | 470.989 ns | 1.00 | 0.00 | 15.3809 | - | - | 32826 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 4096 | 125,616.33 ns | 105.599 ns | 88.180 ns | 0.97 | 0.00 | - | - | - | 138 B | 0.004 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 8192 | 667,235.60 ns | 690.763 ns | 612.343 ns | 1.00 | 0.00 | 30.2734 | - | - | 65605 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 8192 | 683,043.94 ns | 1,371.615 ns | 1,283.009 ns | 1.02 | 0.00 | - | - | - | 149 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 16384 | 2,669,847.42 ns | 5,232.231 ns | 4,894.232 ns | 1.00 | 0.00 | 39.0625 | 39.0625 | 39.0625 | 131203 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 16384 | 2,534,213.39 ns | 5,021.415 ns | 4,451.353 ns | 0.95 | 0.00 | - | - | - | 186 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 32768 | 10,386,386.98 ns | 30,952.968 ns | 28,953.426 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 262356 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 32768 | 10,063,918.86 ns | 13,067.487 ns | 11,583.987 ns | 0.97 | 0.00 | - | - | - | 244 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 65536 | 41,688,266.67 ns | 145,170.307 ns | 135,792.395 ns | 1.00 | 0.00 | 83.3333 | 83.3333 | 83.3333 | 524968 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 65536 | 41,149,598.97 ns | 144,489.377 ns | 135,155.453 ns | 0.99 | 0.00 | - | - | - | 666 B | 0.001 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 131072 | 206,102,964.29 ns | 230,933.127 ns | 204,716.202 ns | 1.00 | 0.00 | - | - | - | 1052928 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 131072 | 206,404,678.57 ns | 196,925.921 ns | 174,569.699 ns | 1.00 | 0.00 | - | - | - | 2432 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableList | 850000 | 66,051,090,160.00 ns | 544,519,587.722 ns | 509,343,960.200 ns | 1.00 | 0.00 | - | - | - | 7576840 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableList | 850000 | 66,377,580,123.08 ns | 41,315,966.182 ns | 34,500,702.972 ns | 1.01 | 0.01 | - | - | - | 781968 B | 0.10 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 0 | 19.44 ns | 0.302 ns | 0.282 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 0 | 22.87 ns | 0.122 ns | 0.102 ns | 1.17 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 1 | 27.58 ns | 0.120 ns | 0.106 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 1 | 51.00 ns | 0.497 ns | 0.465 ns | 1.85 | 0.02 | 0.0727 | - | - | 152 B | 2.38 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 2 | 35.05 ns | 0.206 ns | 0.192 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 2 | 59.35 ns | 0.483 ns | 0.429 ns | 1.69 | 0.01 | 0.0764 | - | - | 160 B | 2.22 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 3 | 46.23 ns | 0.218 ns | 0.194 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 3 | 85.63 ns | 1.432 ns | 1.339 ns | 1.85 | 0.03 | 0.0842 | - | - | 176 B | 2.20 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 4 | 54.75 ns | 0.776 ns | 0.726 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 4 | 102.85 ns | 0.869 ns | 0.813 ns | 1.88 | 0.03 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 5 | 65.06 ns | 0.921 ns | 0.862 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 5 | 121.38 ns | 1.511 ns | 1.414 ns | 1.87 | 0.03 | 0.0994 | - | - | 208 B | 2.17 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 6 | 79.32 ns | 0.699 ns | 0.654 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 6 | 144.06 ns | 2.069 ns | 1.935 ns | 1.82 | 0.03 | 0.0994 | - | - | 208 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 7 | 93.20 ns | 0.756 ns | 0.707 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 7 | 161.66 ns | 1.740 ns | 1.627 ns | 1.73 | 0.02 | 0.0994 | - | - | 208 B | 1.86 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 8 | 105.79 ns | 0.934 ns | 0.874 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 8 | 176.25 ns | 2.240 ns | 2.096 ns | 1.67 | 0.02 | 0.0994 | - | - | 208 B | 1.73 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 9 | 114.85 ns | 0.872 ns | 0.773 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 9 | 197.10 ns | 0.655 ns | 0.613 ns | 1.72 | 0.01 | 0.1299 | - | - | 272 B | 2.12 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 10 | 45.17 ns | 0.522 ns | 0.489 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 10 | 96.80 ns | 0.873 ns | 0.774 ns | 2.14 | 0.03 | 0.1301 | - | - | 272 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 11 | 48.63 ns | 0.764 ns | 0.750 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 11 | 99.36 ns | 1.184 ns | 1.108 ns | 2.04 | 0.03 | 0.1301 | - | - | 272 B | 1.89 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 12 | 51.14 ns | 0.702 ns | 0.656 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 12 | 101.62 ns | 0.854 ns | 0.799 ns | 1.99 | 0.03 | 0.1301 | - | - | 272 B | 1.79 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 13 | 50.43 ns | 0.598 ns | 0.530 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 13 | 101.25 ns | 1.477 ns | 1.382 ns | 2.01 | 0.03 | 0.1301 | - | - | 272 B | 1.70 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 14 | 51.34 ns | 0.589 ns | 0.551 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 14 | 101.89 ns | 1.198 ns | 1.121 ns | 1.99 | 0.03 | 0.1301 | - | - | 272 B | 1.62 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 15 | 49.64 ns | 0.602 ns | 0.503 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 15 | 99.81 ns | 0.820 ns | 0.767 ns | 2.01 | 0.02 | 0.1301 | - | - | 272 B | 1.55 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 16 | 47.50 ns | 0.398 ns | 0.353 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 16 | 98.18 ns | 1.208 ns | 1.130 ns | 2.07 | 0.03 | 0.1301 | - | - | 272 B | 1.48 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 17 | 48.09 ns | 0.486 ns | 0.431 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 17 | 101.76 ns | 0.898 ns | 0.840 ns | 2.12 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 18 | 48.17 ns | 0.505 ns | 0.448 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 18 | 102.41 ns | 0.672 ns | 0.629 ns | 2.13 | 0.03 | 0.1912 | - | - | 400 B | 2.00 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 19 | 55.02 ns | 1.109 ns | 2.111 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 19 | 113.62 ns | 0.692 ns | 0.647 ns | 2.10 | 0.08 | 0.1912 | - | - | 400 B | 1.92 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 20 | 63.44 ns | 0.610 ns | 0.570 ns | 1.00 | 0.00 | 0.1032 | - | - | 216 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 20 | 123.96 ns | 1.218 ns | 1.139 ns | 1.95 | 0.02 | 0.1912 | - | - | 400 B | 1.85 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 30 | 80.64 ns | 0.812 ns | 0.759 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 30 | 140.77 ns | 1.009 ns | 0.895 ns | 1.75 | 0.02 | 0.1912 | - | - | 400 B | 1.35 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 32 | 76.70 ns | 0.591 ns | 0.524 ns | 1.00 | 0.00 | 0.1491 | - | - | 312 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 32 | 141.90 ns | 0.245 ns | 0.191 ns | 1.85 | 0.01 | 0.1912 | - | - | 400 B | 1.28 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 36 | 95.14 ns | 1.263 ns | 1.119 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 36 | 156.22 ns | 1.286 ns | 1.203 ns | 1.64 | 0.02 | 0.0725 | - | - | 152 B | 0.44 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 37 | 98.27 ns | 0.730 ns | 0.683 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 37 | 155.39 ns | 1.951 ns | 1.825 ns | 1.58 | 0.02 | 0.0725 | - | - | 152 B | 0.43 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 113.47 ns | 1.350 ns | 1.262 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 114.72 ns | 1.303 ns | 1.219 ns | 1.01 | 0.02 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 172.33 ns | 2.214 ns | 2.071 ns | 1.52 | 0.02 | 0.0725 | - | - | 152 B | 0.40 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 40 | 173.43 ns | 1.250 ns | 1.169 ns | 1.53 | 0.02 | 0.0725 | - | - | 152 B | 0.40 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 50 | 134.50 ns | 1.086 ns | 0.963 ns | 1.00 | 0.00 | 0.2179 | - | - | 456 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 50 | 200.76 ns | 2.835 ns | 2.651 ns | 1.49 | 0.02 | 0.0725 | - | - | 152 B | 0.33 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 60 | 170.26 ns | 1.832 ns | 1.714 ns | 1.00 | 0.00 | 0.2561 | - | - | 536 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 60 | 220.45 ns | 2.233 ns | 1.979 ns | 1.29 | 0.02 | 0.0725 | - | - | 152 B | 0.28 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 70 | 197.88 ns | 1.221 ns | 1.082 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 70 | 260.15 ns | 2.360 ns | 2.207 ns | 1.31 | 0.01 | 0.0725 | - | - | 152 B | 0.25 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 80 | 221.35 ns | 2.021 ns | 1.890 ns | 1.00 | 0.00 | 0.3326 | - | - | 696 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 80 | 280.55 ns | 2.441 ns | 2.164 ns | 1.27 | 0.01 | 0.0725 | - | - | 152 B | 0.22 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 100 | 286.35 ns | 2.057 ns | 1.924 ns | 1.00 | 0.00 | 0.4091 | - | - | 856 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 100 | 321.82 ns | 1.687 ns | 1.578 ns | 1.12 | 0.01 | 0.0725 | - | - | 152 B | 0.18 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 128 | 339.95 ns | 4.147 ns | 3.879 ns | 1.00 | 0.00 | 0.5159 | - | - | 1080 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 128 | 367.24 ns | 1.680 ns | 1.403 ns | 1.08 | 0.01 | 0.0725 | - | - | 152 B | 0.14 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 256 | 833.46 ns | 6.908 ns | 6.462 ns | 1.00 | 0.00 | 1.0052 | - | - | 2104 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 256 | 878.61 ns | 5.636 ns | 5.272 ns | 1.05 | 0.01 | 0.0725 | - | - | 152 B | 0.07 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 512 | 2,414.19 ns | 11.496 ns | 10.753 ns | 1.00 | 0.00 | 1.9836 | - | - | 4152 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 512 | 2,354.74 ns | 12.761 ns | 11.936 ns | 0.98 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 1024 | 7,872.55 ns | 47.373 ns | 44.313 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 1024 | 7,758.42 ns | 34.801 ns | 32.553 ns | 0.99 | 0.01 | 0.0610 | - | - | 152 B | 0.02 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 2048 | 28,202.10 ns | 81.798 ns | 76.514 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 2048 | 28,093.73 ns | 25.874 ns | 21.606 ns | 1.00 | 0.00 | 0.0610 | - | - | 152 B | 0.009 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 4096 | 128,999.20 ns | 325.944 ns | 304.888 ns | 1.00 | 0.00 | 15.6250 | - | - | 32826 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 4096 | 142,900.35 ns | 383.371 ns | 339.849 ns | 1.11 | 0.00 | - | - | - | 155 B | 0.005 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 8192 | 674,524.94 ns | 1,623.973 ns | 1,519.065 ns | 1.00 | 0.00 | 31.2500 | - | - | 65605 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 8192 | 719,250.57 ns | 1,493.373 ns | 1,396.902 ns | 1.07 | 0.00 | - | - | - | 165 B | 0.003 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 16384 | 2,681,106.67 ns | 5,678.145 ns | 5,311.340 ns | 1.00 | 0.00 | 39.0625 | 39.0625 | 39.0625 | 131203 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 16384 | 2,761,809.45 ns | 6,115.873 ns | 5,720.791 ns | 1.03 | 0.00 | - | - | - | 464 B | 0.004 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 32768 | 10,442,391.88 ns | 24,308.755 ns | 22,738.424 ns | 1.00 | 0.00 | 78.1250 | 78.1250 | 78.1250 | 262450 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 32768 | 10,789,099.22 ns | 43,918.562 ns | 41,081.450 ns | 1.03 | 0.00 | - | - | - | 540 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 65536 | 42,255,784.52 ns | 261,200.473 ns | 231,547.415 ns | 1.00 | 0.00 | 83.3333 | 83.3333 | 83.3333 | 524968 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 65536 | 44,203,452.78 ns | 337,618.726 ns | 315,808.766 ns | 1.05 | 0.01 | - | - | - | 1006 B | 0.002 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 131072 | 207,955,243.59 ns | 653,379.017 ns | 545,601.071 ns | 1.00 | 0.00 | - | - | - | 1050928 B | 1.000 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 131072 | 212,360,097.44 ns | 514,818.130 ns | 429,896.455 ns | 1.02 | 0.00 | - | - | - | 8840 B | 0.008 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 850000 | 67,020,573,153.33 ns | 765,522,051.298 ns | 716,069,801.748 ns | 1.00 | 0.00 | - | - | - | 7582840 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 850000 | 61,351,466,257.14 ns | 321,621,594.596 ns | 285,109,166.344 ns | 0.92 | 0.01 | - | - | - | 724176 B | 0.10 | +| | | | | | | | | | | | | | | | +| Baseline | RemoveAt_FirstItems | List | RecyclableLongList | 90 | 242.32 ns | 1.436 ns | 1.273 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | RemoveAt_FirstItems | List | RecyclableLongList | 90 | 300.40 ns | 2.440 ns | 2.283 ns | 1.24 | 0.01 | 0.0725 | - | - | 152 B | 0.20 | +
+ +
+RemoveAt from the End Benchmark Results - click to expand + +| Method | TestCase | BaseDataType | DataType | TestObjectCount | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|--------- |------------------- |------------- |------------------- |---------------- |----------------:|--------------:|--------------:|----------------:|------:|--------:|---------:|---------:|---------:|----------:|------------:| +| Baseline | RemoveAt_LastItems | List | PooledList | 0 | 19.63 ns | 0.419 ns | 0.559 ns | 19.38 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 0 | 13.58 ns | 0.299 ns | 0.475 ns | 13.47 ns | 0.70 | 0.03 | 0.0268 | - | - | 56 B | 1.75 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 1 | 27.90 ns | 0.134 ns | 0.126 ns | 27.86 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 1 | 39.46 ns | 0.357 ns | 0.334 ns | 39.45 ns | 1.41 | 0.01 | 0.0268 | - | - | 56 B | 0.88 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 2 | 29.93 ns | 0.224 ns | 0.210 ns | 30.01 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 2 | 38.64 ns | 0.358 ns | 0.335 ns | 38.47 ns | 1.29 | 0.01 | 0.0268 | - | - | 56 B | 0.78 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 3 | 31.72 ns | 0.339 ns | 0.301 ns | 31.71 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 3 | 39.90 ns | 0.321 ns | 0.300 ns | 39.81 ns | 1.26 | 0.02 | 0.0268 | - | - | 56 B | 0.70 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 4 | 33.55 ns | 0.182 ns | 0.171 ns | 33.49 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 4 | 40.81 ns | 0.102 ns | 0.080 ns | 40.82 ns | 1.22 | 0.00 | 0.0268 | - | - | 56 B | 0.64 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 5 | 36.16 ns | 0.258 ns | 0.242 ns | 36.07 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 5 | 42.41 ns | 0.293 ns | 0.260 ns | 42.33 ns | 1.17 | 0.01 | 0.0268 | - | - | 56 B | 0.58 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 6 | 38.18 ns | 0.163 ns | 0.144 ns | 38.21 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 6 | 43.58 ns | 0.349 ns | 0.327 ns | 43.56 ns | 1.14 | 0.01 | 0.0268 | - | - | 56 B | 0.54 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 7 | 40.43 ns | 0.202 ns | 0.179 ns | 40.40 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 7 | 44.59 ns | 0.122 ns | 0.108 ns | 44.57 ns | 1.10 | 0.01 | 0.0268 | - | - | 56 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 8 | 42.62 ns | 0.256 ns | 0.227 ns | 42.51 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 8 | 46.33 ns | 0.426 ns | 0.398 ns | 46.42 ns | 1.09 | 0.01 | 0.0268 | - | - | 56 B | 0.47 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 9 | 44.64 ns | 0.171 ns | 0.152 ns | 44.60 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 9 | 48.93 ns | 0.142 ns | 0.126 ns | 48.90 ns | 1.10 | 0.00 | 0.0268 | - | - | 56 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 10 | 31.07 ns | 0.086 ns | 0.071 ns | 31.07 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 10 | 37.66 ns | 0.333 ns | 0.312 ns | 37.70 ns | 1.21 | 0.01 | 0.0268 | - | - | 56 B | 0.41 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 11 | 32.63 ns | 0.270 ns | 0.239 ns | 32.65 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 11 | 40.36 ns | 0.145 ns | 0.128 ns | 40.35 ns | 1.24 | 0.01 | 0.0268 | - | - | 56 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 12 | 33.24 ns | 0.146 ns | 0.129 ns | 33.19 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 12 | 40.54 ns | 0.303 ns | 0.283 ns | 40.41 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.37 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 13 | 33.06 ns | 0.171 ns | 0.151 ns | 32.99 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 13 | 40.28 ns | 0.152 ns | 0.127 ns | 40.31 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.35 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 14 | 32.76 ns | 0.152 ns | 0.143 ns | 32.72 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 14 | 40.21 ns | 0.106 ns | 0.088 ns | 40.21 ns | 1.23 | 0.01 | 0.0268 | - | - | 56 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 15 | 33.14 ns | 0.105 ns | 0.093 ns | 33.16 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 15 | 38.40 ns | 0.142 ns | 0.119 ns | 38.35 ns | 1.16 | 0.01 | 0.0268 | - | - | 56 B | 0.32 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 16 | 33.42 ns | 0.138 ns | 0.122 ns | 33.43 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 16 | 39.01 ns | 0.125 ns | 0.105 ns | 38.96 ns | 1.17 | 0.00 | 0.0268 | - | - | 56 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 17 | 33.84 ns | 0.142 ns | 0.126 ns | 33.83 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 17 | 39.19 ns | 0.353 ns | 0.331 ns | 39.20 ns | 1.16 | 0.01 | 0.0268 | - | - | 56 B | 0.29 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 18 | 34.88 ns | 0.134 ns | 0.119 ns | 34.86 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 18 | 38.97 ns | 0.123 ns | 0.109 ns | 38.94 ns | 1.12 | 0.01 | 0.0268 | - | - | 56 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 19 | 34.74 ns | 0.101 ns | 0.089 ns | 34.73 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 19 | 42.35 ns | 0.193 ns | 0.180 ns | 42.33 ns | 1.22 | 0.01 | 0.0268 | - | - | 56 B | 0.27 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 20 | 36.64 ns | 0.105 ns | 0.093 ns | 36.62 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 20 | 45.56 ns | 0.110 ns | 0.097 ns | 45.56 ns | 1.24 | 0.00 | 0.0268 | - | - | 56 B | 0.26 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 30 | 41.64 ns | 0.084 ns | 0.070 ns | 41.64 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 30 | 45.33 ns | 0.167 ns | 0.148 ns | 45.31 ns | 1.09 | 0.00 | 0.0268 | - | - | 56 B | 0.19 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 32 | 42.67 ns | 0.302 ns | 0.282 ns | 42.64 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 32 | 43.02 ns | 0.224 ns | 0.209 ns | 42.91 ns | 1.01 | 0.01 | 0.0268 | - | - | 56 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 36 | 44.40 ns | 0.318 ns | 0.282 ns | 44.32 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 36 | 46.66 ns | 0.830 ns | 0.776 ns | 46.48 ns | 1.05 | 0.02 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 37 | 44.11 ns | 0.237 ns | 0.198 ns | 44.04 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 37 | 46.22 ns | 0.283 ns | 0.251 ns | 46.23 ns | 1.05 | 0.01 | 0.0268 | - | - | 56 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 40 | 47.28 ns | 0.488 ns | 0.456 ns | 47.13 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | RemoveAt_LastItems | List | PooledList | 40 | 47.24 ns | 0.323 ns | 0.302 ns | 47.20 ns | 1.00 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 40 | 45.61 ns | 0.261 ns | 0.244 ns | 45.57 ns | 0.96 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | +| Actual | RemoveAt_LastItems | List | PooledList | 40 | 45.34 ns | 0.222 ns | 0.208 ns | 45.27 ns | 0.96 | 0.01 | 0.0268 | - | - | 56 B | 0.15 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 50 | 52.12 ns | 0.390 ns | 0.365 ns | 51.97 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 50 | 46.61 ns | 0.481 ns | 0.426 ns | 46.58 ns | 0.89 | 0.01 | 0.0268 | - | - | 56 B | 0.12 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 60 | 56.65 ns | 0.428 ns | 0.401 ns | 56.57 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 60 | 51.79 ns | 0.642 ns | 0.601 ns | 51.83 ns | 0.91 | 0.01 | 0.0268 | - | - | 56 B | 0.10 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 70 | 61.15 ns | 0.217 ns | 0.182 ns | 61.12 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 70 | 55.22 ns | 0.186 ns | 0.174 ns | 55.18 ns | 0.90 | 0.00 | 0.0268 | - | - | 56 B | 0.09 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 80 | 66.13 ns | 0.133 ns | 0.104 ns | 66.14 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 80 | 53.75 ns | 0.143 ns | 0.126 ns | 53.74 ns | 0.81 | 0.00 | 0.0268 | - | - | 56 B | 0.08 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 90 | 74.91 ns | 1.354 ns | 1.200 ns | 74.60 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 90 | 56.88 ns | 0.195 ns | 0.173 ns | 56.84 ns | 0.76 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 100 | 79.58 ns | 1.278 ns | 1.195 ns | 79.45 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 100 | 60.93 ns | 0.383 ns | 0.358 ns | 60.96 ns | 0.77 | 0.01 | 0.0267 | - | - | 56 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 128 | 91.26 ns | 0.566 ns | 0.529 ns | 91.00 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 128 | 65.37 ns | 0.266 ns | 0.236 ns | 65.41 ns | 0.72 | 0.01 | 0.0267 | - | - | 56 B | 0.05 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 256 | 174.06 ns | 0.909 ns | 0.851 ns | 173.91 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 256 | 91.10 ns | 0.126 ns | 0.112 ns | 91.13 ns | 0.52 | 0.00 | 0.0267 | - | - | 56 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 512 | 313.94 ns | 0.345 ns | 0.269 ns | 313.99 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | RemoveAt_LastItems | List | PooledList | 512 | 162.11 ns | 0.732 ns | 0.685 ns | 161.98 ns | 0.52 | 0.00 | 0.0267 | - | - | 56 B | 0.01 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 1024 | 597.12 ns | 0.854 ns | 0.713 ns | 597.16 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 1024 | 280.65 ns | 0.907 ns | 0.804 ns | 280.62 ns | 0.47 | 0.00 | 0.0267 | - | - | 56 B | 0.007 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 2048 | 1,188.74 ns | 17.942 ns | 16.783 ns | 1,179.87 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 2048 | 587.69 ns | 1.759 ns | 1.560 ns | 586.89 ns | 0.49 | 0.01 | 0.0267 | - | - | 56 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 4096 | 2,304.71 ns | 13.241 ns | 12.386 ns | 2,304.04 ns | 1.00 | 0.00 | 15.6212 | - | - | 32824 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 4096 | 1,265.18 ns | 7.788 ns | 7.285 ns | 1,261.62 ns | 0.55 | 0.00 | 0.0267 | - | - | 56 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 8192 | 4,420.68 ns | 31.056 ns | 27.530 ns | 4,423.29 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 8192 | 2,469.12 ns | 4.122 ns | 3.442 ns | 2,468.88 ns | 0.56 | 0.00 | 0.0267 | - | - | 56 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 16384 | 54,941.18 ns | 306.588 ns | 256.015 ns | 54,994.60 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131142 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 16384 | 5,167.73 ns | 1.826 ns | 1.425 ns | 5,167.62 ns | 0.09 | 0.00 | 0.0229 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 32768 | 110,733.03 ns | 1,115.997 ns | 1,043.904 ns | 110,519.27 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262228 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 32768 | 10,742.88 ns | 11.943 ns | 9.973 ns | 10,740.05 ns | 0.10 | 0.00 | 0.0153 | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 65536 | 106,668.46 ns | 968.200 ns | 808.491 ns | 106,687.39 ns | 1.00 | 0.00 | 130.9814 | 129.7607 | 129.7607 | 524980 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 65536 | 22,882.30 ns | 41.822 ns | 39.120 ns | 22,886.88 ns | 0.21 | 0.00 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 131072 | 282,605.66 ns | 5,595.347 ns | 12,163.825 ns | 284,138.99 ns | 1.00 | 0.00 | 202.1484 | 200.6836 | 200.6836 | 1048872 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 131072 | 44,825.02 ns | 56.407 ns | 50.004 ns | 44,809.98 ns | 0.16 | 0.01 | - | - | - | 56 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | PooledList | 850000 | 2,810,937.44 ns | 10,160.388 ns | 8,484.384 ns | 2,810,179.30 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800115 B | 1.000 | +| Actual | RemoveAt_LastItems | List | PooledList | 850000 | 840,846.48 ns | 3,091.399 ns | 2,891.697 ns | 839,652.05 ns | 0.30 | 0.00 | - | - | - | 57 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 0 | 16.39 ns | 0.074 ns | 0.066 ns | 16.40 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 0 | 23.91 ns | 0.127 ns | 0.113 ns | 23.87 ns | 1.46 | 0.01 | 0.0497 | - | - | 104 B | 3.25 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 1 | 28.65 ns | 0.276 ns | 0.245 ns | 28.64 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 1 | 24.56 ns | 0.212 ns | 0.199 ns | 24.63 ns | 0.86 | 0.01 | 0.0497 | - | - | 104 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 2 | 29.72 ns | 0.207 ns | 0.183 ns | 29.69 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 2 | 24.89 ns | 0.296 ns | 0.277 ns | 24.87 ns | 0.84 | 0.01 | 0.0497 | - | - | 104 B | 1.44 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 3 | 31.37 ns | 0.078 ns | 0.070 ns | 31.35 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 3 | 25.49 ns | 0.184 ns | 0.144 ns | 25.50 ns | 0.81 | 0.01 | 0.0497 | - | - | 104 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 4 | 34.57 ns | 0.139 ns | 0.123 ns | 34.58 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 4 | 36.29 ns | 0.124 ns | 0.116 ns | 36.27 ns | 1.05 | 0.00 | 0.0497 | - | - | 104 B | 1.18 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 5 | 37.54 ns | 0.545 ns | 0.509 ns | 37.55 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 5 | 40.73 ns | 0.200 ns | 0.167 ns | 40.69 ns | 1.09 | 0.02 | 0.0918 | - | - | 192 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 6 | 38.43 ns | 0.222 ns | 0.207 ns | 38.44 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 6 | 41.59 ns | 0.310 ns | 0.290 ns | 41.61 ns | 1.08 | 0.01 | 0.0918 | - | - | 192 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 7 | 40.19 ns | 0.252 ns | 0.223 ns | 40.22 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 7 | 42.13 ns | 0.161 ns | 0.126 ns | 42.10 ns | 1.05 | 0.01 | 0.0918 | - | - | 192 B | 1.71 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 8 | 42.94 ns | 0.379 ns | 0.336 ns | 42.83 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 8 | 43.04 ns | 0.115 ns | 0.102 ns | 43.01 ns | 1.00 | 0.01 | 0.0918 | - | - | 192 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 9 | 44.95 ns | 0.505 ns | 0.421 ns | 44.96 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 9 | 47.93 ns | 0.487 ns | 0.455 ns | 47.96 ns | 1.07 | 0.01 | 0.1224 | - | - | 256 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 10 | 31.47 ns | 0.189 ns | 0.158 ns | 31.45 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 10 | 38.10 ns | 0.275 ns | 0.244 ns | 38.05 ns | 1.21 | 0.01 | 0.1224 | - | - | 256 B | 1.88 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 11 | 32.54 ns | 0.451 ns | 0.421 ns | 32.55 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 11 | 39.87 ns | 0.230 ns | 0.215 ns | 39.82 ns | 1.23 | 0.02 | 0.1224 | - | - | 256 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 12 | 32.75 ns | 0.425 ns | 0.397 ns | 32.46 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 12 | 39.76 ns | 0.339 ns | 0.283 ns | 39.72 ns | 1.21 | 0.02 | 0.1224 | - | - | 256 B | 1.68 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 13 | 33.00 ns | 0.464 ns | 0.434 ns | 32.83 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 13 | 39.74 ns | 0.238 ns | 0.211 ns | 39.70 ns | 1.20 | 0.02 | 0.1224 | - | - | 256 B | 1.60 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 14 | 33.66 ns | 0.442 ns | 0.413 ns | 33.67 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 14 | 46.58 ns | 1.440 ns | 4.037 ns | 45.05 ns | 1.41 | 0.18 | 0.1224 | - | - | 256 B | 1.52 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 15 | 35.79 ns | 0.653 ns | 0.826 ns | 35.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 15 | 41.06 ns | 0.498 ns | 0.442 ns | 41.10 ns | 1.14 | 0.03 | 0.1224 | - | - | 256 B | 1.45 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 16 | 34.27 ns | 0.324 ns | 0.270 ns | 34.25 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 16 | 39.25 ns | 0.370 ns | 0.346 ns | 39.19 ns | 1.15 | 0.02 | 0.1224 | - | - | 256 B | 1.39 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 17 | 34.31 ns | 0.230 ns | 0.204 ns | 34.36 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 17 | 43.87 ns | 0.486 ns | 0.455 ns | 44.05 ns | 1.28 | 0.02 | 0.1836 | - | - | 384 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 18 | 36.35 ns | 0.663 ns | 0.620 ns | 36.55 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 18 | 43.72 ns | 0.484 ns | 0.453 ns | 43.86 ns | 1.20 | 0.03 | 0.1836 | - | - | 384 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 19 | 35.86 ns | 0.463 ns | 0.410 ns | 35.96 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 19 | 46.88 ns | 0.909 ns | 2.014 ns | 46.23 ns | 1.32 | 0.08 | 0.1836 | - | - | 384 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 20 | 41.42 ns | 0.763 ns | 0.714 ns | 41.27 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 20 | 45.83 ns | 0.483 ns | 0.452 ns | 45.78 ns | 1.11 | 0.02 | 0.1836 | - | - | 384 B | 1.78 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 30 | 41.99 ns | 0.456 ns | 0.427 ns | 41.84 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 30 | 48.37 ns | 0.870 ns | 0.814 ns | 48.34 ns | 1.15 | 0.02 | 0.1836 | - | - | 384 B | 1.30 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 32 | 42.76 ns | 0.847 ns | 0.793 ns | 42.61 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 32 | 46.90 ns | 0.574 ns | 0.537 ns | 46.78 ns | 1.10 | 0.02 | 0.1836 | - | - | 384 B | 1.23 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 36 | 43.87 ns | 0.553 ns | 0.517 ns | 43.87 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 36 | 62.59 ns | 0.976 ns | 0.913 ns | 62.81 ns | 1.43 | 0.03 | 0.0650 | - | - | 136 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 37 | 55.16 ns | 1.115 ns | 1.599 ns | 55.62 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 37 | 61.99 ns | 0.677 ns | 0.634 ns | 62.08 ns | 1.13 | 0.03 | 0.0650 | - | - | 136 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 40 | 56.96 ns | 1.390 ns | 4.033 ns | 55.43 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 40 | 55.21 ns | 1.001 ns | 0.936 ns | 55.44 ns | 0.97 | 0.07 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 40 | 64.04 ns | 0.846 ns | 0.792 ns | 63.82 ns | 1.13 | 0.07 | 0.0650 | - | - | 136 B | 0.36 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 40 | 63.68 ns | 0.752 ns | 0.704 ns | 63.58 ns | 1.12 | 0.07 | 0.0650 | - | - | 136 B | 0.36 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 50 | 62.72 ns | 1.226 ns | 1.087 ns | 62.60 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 50 | 62.87 ns | 0.528 ns | 0.468 ns | 62.83 ns | 1.00 | 0.02 | 0.0650 | - | - | 136 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 60 | 73.19 ns | 1.359 ns | 1.454 ns | 73.36 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 60 | 65.42 ns | 0.612 ns | 0.572 ns | 65.15 ns | 0.89 | 0.02 | 0.0650 | - | - | 136 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 70 | 78.48 ns | 1.344 ns | 1.257 ns | 78.62 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 70 | 72.48 ns | 0.786 ns | 0.735 ns | 72.37 ns | 0.92 | 0.01 | 0.0650 | - | - | 136 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 80 | 83.28 ns | 1.671 ns | 1.717 ns | 83.30 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 80 | 72.59 ns | 0.329 ns | 0.292 ns | 72.58 ns | 0.87 | 0.02 | 0.0650 | - | - | 136 B | 0.20 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 90 | 86.83 ns | 0.791 ns | 0.740 ns | 87.09 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 90 | 70.49 ns | 0.213 ns | 0.178 ns | 70.50 ns | 0.81 | 0.01 | 0.0650 | - | - | 136 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 100 | 96.64 ns | 0.833 ns | 0.779 ns | 96.82 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 100 | 74.23 ns | 0.933 ns | 0.827 ns | 74.51 ns | 0.77 | 0.01 | 0.0650 | - | - | 136 B | 0.16 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 128 | 112.73 ns | 2.176 ns | 2.035 ns | 112.84 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 128 | 80.13 ns | 1.005 ns | 0.940 ns | 79.65 ns | 0.71 | 0.02 | 0.0650 | - | - | 136 B | 0.13 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 256 | 216.01 ns | 2.897 ns | 2.710 ns | 216.20 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 256 | 110.32 ns | 0.809 ns | 0.717 ns | 110.17 ns | 0.51 | 0.01 | 0.0650 | - | - | 136 B | 0.06 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 512 | 401.14 ns | 5.992 ns | 5.605 ns | 399.05 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 512 | 185.44 ns | 1.254 ns | 1.173 ns | 185.18 ns | 0.46 | 0.01 | 0.0648 | - | - | 136 B | 0.03 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 1024 | 768.24 ns | 8.273 ns | 7.739 ns | 770.86 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 1024 | 319.17 ns | 1.900 ns | 1.777 ns | 319.94 ns | 0.42 | 0.01 | 0.0648 | - | - | 136 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 2048 | 1,494.97 ns | 23.946 ns | 21.227 ns | 1,495.44 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 2048 | 671.01 ns | 1.066 ns | 0.891 ns | 670.92 ns | 0.45 | 0.01 | 0.0648 | - | - | 136 B | 0.008 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 4096 | 3,010.29 ns | 37.376 ns | 34.961 ns | 3,005.18 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 4096 | 1,400.30 ns | 2.332 ns | 2.181 ns | 1,400.49 ns | 0.47 | 0.01 | 0.0648 | - | - | 136 B | 0.004 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 8192 | 5,781.71 ns | 55.335 ns | 49.053 ns | 5,790.07 ns | 1.00 | 0.00 | 31.2424 | 0.0076 | - | 65592 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 8192 | 2,681.21 ns | 6.085 ns | 5.692 ns | 2,681.77 ns | 0.46 | 0.00 | 0.0648 | - | - | 136 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 16384 | 57,203.29 ns | 779.379 ns | 729.032 ns | 57,039.45 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 16384 | 5,637.76 ns | 40.108 ns | 37.517 ns | 5,639.82 ns | 0.10 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 32768 | 115,929.12 ns | 924.329 ns | 819.394 ns | 115,788.78 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 32768 | 11,658.34 ns | 48.855 ns | 45.699 ns | 11,649.20 ns | 0.10 | 0.00 | 0.0610 | - | - | 136 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 65536 | 112,767.79 ns | 1,428.939 ns | 1,266.717 ns | 112,863.15 ns | 1.00 | 0.00 | 133.5449 | 132.4463 | 132.4463 | 524747 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 65536 | 24,224.18 ns | 116.595 ns | 109.063 ns | 24,198.04 ns | 0.21 | 0.00 | 0.0610 | - | - | 136 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 131072 | 307,874.59 ns | 6,110.474 ns | 9,867.276 ns | 309,359.11 ns | 1.00 | 0.00 | 196.2891 | 194.8242 | 194.8242 | 1048949 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 131072 | 50,850.85 ns | 219.395 ns | 183.205 ns | 50,777.24 ns | 0.17 | 0.00 | 0.0610 | - | - | 137 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableList | 850000 | 2,914,678.89 ns | 57,800.734 ns | 82,896.086 ns | 2,883,095.90 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800191 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableList | 850000 | 871,047.68 ns | 5,867.027 ns | 5,200.967 ns | 873,933.30 ns | 0.30 | 0.01 | - | - | - | 149 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 0 | 19.36 ns | 0.312 ns | 0.276 ns | 19.38 ns | 1.00 | 0.00 | 0.0153 | - | - | 32 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 0 | 24.25 ns | 0.214 ns | 0.201 ns | 24.28 ns | 1.25 | 0.02 | 0.0421 | - | - | 88 B | 2.75 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 1 | 31.02 ns | 0.644 ns | 1.591 ns | 30.78 ns | 1.00 | 0.00 | 0.0306 | - | - | 64 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 1 | 51.60 ns | 0.385 ns | 0.360 ns | 51.55 ns | 1.63 | 0.09 | 0.0727 | - | - | 152 B | 2.38 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 2 | 31.17 ns | 0.647 ns | 0.864 ns | 31.14 ns | 1.00 | 0.00 | 0.0344 | - | - | 72 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 2 | 54.26 ns | 0.303 ns | 0.253 ns | 54.28 ns | 1.74 | 0.05 | 0.0765 | - | - | 160 B | 2.22 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 3 | 32.78 ns | 0.658 ns | 0.550 ns | 32.78 ns | 1.00 | 0.00 | 0.0382 | - | - | 80 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 3 | 56.86 ns | 0.640 ns | 0.567 ns | 57.05 ns | 1.73 | 0.03 | 0.0842 | - | - | 176 B | 2.20 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 4 | 36.32 ns | 0.735 ns | 1.054 ns | 36.55 ns | 1.00 | 0.00 | 0.0421 | - | - | 88 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 4 | 59.95 ns | 1.070 ns | 1.001 ns | 59.57 ns | 1.63 | 0.05 | 0.0842 | - | - | 176 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 5 | 39.45 ns | 0.809 ns | 1.211 ns | 39.34 ns | 1.00 | 0.00 | 0.0459 | - | - | 96 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 5 | 61.57 ns | 1.193 ns | 1.116 ns | 61.49 ns | 1.57 | 0.07 | 0.0994 | - | - | 208 B | 2.17 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 6 | 41.28 ns | 0.855 ns | 1.687 ns | 40.85 ns | 1.00 | 0.00 | 0.0497 | - | - | 104 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 6 | 64.12 ns | 1.186 ns | 1.701 ns | 64.50 ns | 1.54 | 0.07 | 0.0994 | - | - | 208 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 7 | 43.02 ns | 0.868 ns | 1.376 ns | 42.74 ns | 1.00 | 0.00 | 0.0535 | - | - | 112 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 7 | 66.75 ns | 1.078 ns | 0.956 ns | 66.91 ns | 1.57 | 0.06 | 0.0994 | - | - | 208 B | 1.86 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 8 | 45.44 ns | 0.745 ns | 0.697 ns | 45.45 ns | 1.00 | 0.00 | 0.0573 | - | - | 120 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 8 | 67.94 ns | 0.625 ns | 0.522 ns | 67.81 ns | 1.50 | 0.03 | 0.0994 | - | - | 208 B | 1.73 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 9 | 46.40 ns | 0.474 ns | 0.443 ns | 46.42 ns | 1.00 | 0.00 | 0.0612 | - | - | 128 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 9 | 71.88 ns | 1.418 ns | 1.326 ns | 71.79 ns | 1.55 | 0.03 | 0.1301 | - | - | 272 B | 2.12 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 10 | 35.69 ns | 0.724 ns | 1.038 ns | 35.77 ns | 1.00 | 0.00 | 0.0650 | - | - | 136 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 10 | 76.45 ns | 0.639 ns | 0.567 ns | 76.48 ns | 2.15 | 0.08 | 0.1301 | - | - | 272 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 11 | 38.58 ns | 0.793 ns | 1.689 ns | 38.83 ns | 1.00 | 0.00 | 0.0688 | - | - | 144 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 11 | 78.25 ns | 0.954 ns | 0.892 ns | 78.26 ns | 2.05 | 0.09 | 0.1301 | - | - | 272 B | 1.89 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 12 | 39.04 ns | 0.810 ns | 1.691 ns | 38.85 ns | 1.00 | 0.00 | 0.0727 | - | - | 152 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 12 | 79.01 ns | 0.946 ns | 0.885 ns | 78.86 ns | 2.04 | 0.12 | 0.1301 | - | - | 272 B | 1.79 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 13 | 36.20 ns | 0.722 ns | 0.741 ns | 36.47 ns | 1.00 | 0.00 | 0.0765 | - | - | 160 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 13 | 79.09 ns | 1.335 ns | 1.249 ns | 78.81 ns | 2.19 | 0.05 | 0.1301 | - | - | 272 B | 1.70 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 14 | 38.25 ns | 0.786 ns | 1.742 ns | 38.31 ns | 1.00 | 0.00 | 0.0803 | - | - | 168 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 14 | 78.40 ns | 1.351 ns | 1.264 ns | 78.65 ns | 2.03 | 0.11 | 0.1301 | - | - | 272 B | 1.62 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 15 | 37.54 ns | 0.777 ns | 1.439 ns | 37.58 ns | 1.00 | 0.00 | 0.0842 | - | - | 176 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 15 | 77.39 ns | 0.958 ns | 0.896 ns | 77.18 ns | 2.06 | 0.09 | 0.1301 | - | - | 272 B | 1.55 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 16 | 35.21 ns | 0.610 ns | 0.570 ns | 35.14 ns | 1.00 | 0.00 | 0.0880 | - | - | 184 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 16 | 78.80 ns | 0.844 ns | 0.789 ns | 78.33 ns | 2.24 | 0.03 | 0.1301 | - | - | 272 B | 1.48 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 17 | 35.47 ns | 0.413 ns | 0.323 ns | 35.52 ns | 1.00 | 0.00 | 0.0918 | - | - | 192 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 17 | 78.16 ns | 0.438 ns | 0.410 ns | 78.08 ns | 2.20 | 0.03 | 0.1912 | - | - | 400 B | 2.08 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 18 | 36.88 ns | 0.751 ns | 0.950 ns | 37.26 ns | 1.00 | 0.00 | 0.0956 | - | - | 200 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 18 | 79.26 ns | 0.388 ns | 0.324 ns | 79.29 ns | 2.15 | 0.06 | 0.1912 | - | - | 400 B | 2.00 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 19 | 41.37 ns | 0.851 ns | 2.022 ns | 41.08 ns | 1.00 | 0.00 | 0.0994 | - | - | 208 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 19 | 81.18 ns | 0.956 ns | 0.894 ns | 81.49 ns | 1.93 | 0.11 | 0.1912 | - | - | 400 B | 1.92 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 20 | 40.59 ns | 0.836 ns | 1.173 ns | 40.15 ns | 1.00 | 0.00 | 0.1033 | - | - | 216 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 20 | 85.73 ns | 1.084 ns | 1.014 ns | 85.61 ns | 2.12 | 0.06 | 0.1912 | - | - | 400 B | 1.85 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 30 | 46.09 ns | 0.937 ns | 1.539 ns | 46.30 ns | 1.00 | 0.00 | 0.1415 | - | - | 296 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 30 | 85.33 ns | 0.548 ns | 0.512 ns | 85.38 ns | 1.84 | 0.06 | 0.1912 | - | - | 400 B | 1.35 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 32 | 44.97 ns | 0.876 ns | 0.860 ns | 45.22 ns | 1.00 | 0.00 | 0.1492 | - | - | 312 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 32 | 89.36 ns | 0.734 ns | 0.687 ns | 89.23 ns | 1.99 | 0.04 | 0.1912 | - | - | 400 B | 1.28 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 36 | 53.30 ns | 0.688 ns | 0.610 ns | 53.39 ns | 1.00 | 0.00 | 0.1644 | - | - | 344 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 36 | 100.23 ns | 0.836 ns | 0.782 ns | 100.23 ns | 1.88 | 0.02 | 0.0726 | - | - | 152 B | 0.44 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 37 | 53.14 ns | 0.933 ns | 0.873 ns | 53.22 ns | 1.00 | 0.00 | 0.1683 | - | - | 352 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 37 | 101.60 ns | 1.218 ns | 1.139 ns | 101.61 ns | 1.91 | 0.04 | 0.0726 | - | - | 152 B | 0.43 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 40 | 54.79 ns | 0.496 ns | 0.464 ns | 54.74 ns | 1.00 | 0.00 | 0.1798 | - | - | 376 B | 1.00 | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 40 | 54.12 ns | 0.362 ns | 0.339 ns | 54.23 ns | 0.99 | 0.01 | 0.1798 | - | - | 376 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 40 | 102.62 ns | 1.264 ns | 1.183 ns | 102.24 ns | 1.87 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 40 | 102.78 ns | 1.032 ns | 0.965 ns | 102.97 ns | 1.88 | 0.02 | 0.0726 | - | - | 152 B | 0.40 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 50 | 61.11 ns | 0.821 ns | 0.768 ns | 61.15 ns | 1.00 | 0.00 | 0.2180 | - | - | 456 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 50 | 108.00 ns | 0.780 ns | 0.730 ns | 108.12 ns | 1.77 | 0.02 | 0.0726 | - | - | 152 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 60 | 67.26 ns | 1.139 ns | 1.066 ns | 66.94 ns | 1.00 | 0.00 | 0.2562 | - | - | 536 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 60 | 108.40 ns | 0.763 ns | 0.637 ns | 108.49 ns | 1.62 | 0.02 | 0.0726 | - | - | 152 B | 0.28 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 70 | 75.85 ns | 1.419 ns | 1.327 ns | 76.33 ns | 1.00 | 0.00 | 0.2944 | - | - | 616 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 70 | 110.94 ns | 2.154 ns | 2.015 ns | 111.14 ns | 1.46 | 0.04 | 0.0726 | - | - | 152 B | 0.25 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 80 | 82.34 ns | 1.678 ns | 2.061 ns | 82.55 ns | 1.00 | 0.00 | 0.3327 | - | - | 696 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 80 | 113.45 ns | 1.438 ns | 1.345 ns | 113.05 ns | 1.38 | 0.05 | 0.0726 | - | - | 152 B | 0.22 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 100 | 95.29 ns | 1.439 ns | 1.346 ns | 95.70 ns | 1.00 | 0.00 | 0.4092 | - | - | 856 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 100 | 121.43 ns | 0.979 ns | 0.868 ns | 121.37 ns | 1.27 | 0.02 | 0.0725 | - | - | 152 B | 0.18 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 128 | 109.93 ns | 1.290 ns | 1.207 ns | 110.26 ns | 1.00 | 0.00 | 0.5162 | - | - | 1080 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 128 | 139.27 ns | 1.368 ns | 1.280 ns | 139.49 ns | 1.27 | 0.02 | 0.0725 | - | - | 152 B | 0.14 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 256 | 207.92 ns | 3.506 ns | 6.321 ns | 207.30 ns | 1.00 | 0.00 | 1.0059 | - | - | 2104 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 256 | 179.97 ns | 2.038 ns | 1.807 ns | 179.85 ns | 0.85 | 0.03 | 0.0725 | - | - | 152 B | 0.07 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 512 | 408.13 ns | 5.017 ns | 4.693 ns | 409.24 ns | 1.00 | 0.00 | 1.9841 | - | - | 4152 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 512 | 250.80 ns | 1.396 ns | 1.166 ns | 250.95 ns | 0.61 | 0.01 | 0.0725 | - | - | 152 B | 0.04 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 1024 | 779.09 ns | 13.954 ns | 14.931 ns | 780.14 ns | 1.00 | 0.00 | 3.9368 | - | - | 8248 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 1024 | 403.41 ns | 1.731 ns | 1.535 ns | 403.96 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.02 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 2048 | 1,556.52 ns | 30.470 ns | 31.290 ns | 1,552.79 ns | 1.00 | 0.00 | 7.8125 | - | - | 16440 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 2048 | 812.19 ns | 6.380 ns | 5.968 ns | 809.64 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.009 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 4096 | 2,993.58 ns | 59.371 ns | 55.535 ns | 2,998.68 ns | 1.00 | 0.00 | 15.6250 | - | - | 32824 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 4096 | 1,570.40 ns | 5.188 ns | 4.599 ns | 1,568.30 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.005 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 8192 | 5,809.74 ns | 94.215 ns | 88.129 ns | 5,828.90 ns | 1.00 | 0.00 | 31.2424 | - | - | 65592 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 8192 | 3,044.36 ns | 12.921 ns | 12.086 ns | 3,040.69 ns | 0.52 | 0.01 | 0.0725 | - | - | 152 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 16384 | 57,222.34 ns | 955.294 ns | 893.583 ns | 57,463.63 ns | 1.00 | 0.00 | 41.6260 | 41.6260 | 41.6260 | 131155 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 16384 | 6,074.85 ns | 37.308 ns | 34.898 ns | 6,063.49 ns | 0.11 | 0.00 | 0.2060 | - | - | 432 B | 0.003 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 32768 | 112,636.45 ns | 799.662 ns | 748.004 ns | 112,834.00 ns | 1.00 | 0.00 | 83.2520 | 83.2520 | 83.2520 | 262254 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 32768 | 11,814.92 ns | 125.494 ns | 117.387 ns | 11,848.72 ns | 0.10 | 0.00 | 0.1984 | - | - | 432 B | 0.002 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 65536 | 118,274.82 ns | 2,309.363 ns | 2,160.179 ns | 118,526.20 ns | 1.00 | 0.00 | 128.1738 | 127.1973 | 127.1973 | 524906 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 65536 | 25,508.82 ns | 159.093 ns | 148.816 ns | 25,508.43 ns | 0.22 | 0.00 | 0.1831 | - | - | 432 B | 0.001 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 131072 | 305,165.82 ns | 5,645.224 ns | 7,536.212 ns | 306,644.53 ns | 1.00 | 0.00 | 201.1719 | 199.7070 | 199.7070 | 1048966 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 131072 | 51,560.28 ns | 290.496 ns | 271.730 ns | 51,541.61 ns | 0.17 | 0.00 | 0.1831 | - | - | 433 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 850000 | 2,760,485.70 ns | 54,392.679 ns | 99,460.090 ns | 2,781,955.27 ns | 1.00 | 0.00 | 175.7813 | 175.7813 | 175.7813 | 6800191 B | 1.000 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 850000 | 1,131,329.19 ns | 8,418.126 ns | 7,874.320 ns | 1,127,444.82 ns | 0.42 | 0.02 | - | - | - | 445 B | 0.000 | +| | | | | | | | | | | | | | | | | +| Baseline | RemoveAt_LastItems | List | RecyclableLongList | 90 | 87.90 ns | 1.332 ns | 1.246 ns | 87.64 ns | 1.00 | 0.00 | 0.3710 | - | - | 776 B | 1.00 | +| Actual | RemoveAt_LastItems | List | RecyclableLongList | 90 | 115.23 ns | 1.347 ns | 1.260 ns | 115.09 ns | 1.31 | 0.02 | 0.0725 | - | - | 152 B | 0.20 | +
diff --git a/Recyclable.Collections.sln b/Recyclable.Collections.sln index 1af4cb0..c9e0662 100644 --- a/Recyclable.Collections.sln +++ b/Recyclable.Collections.sln @@ -1,51 +1,51 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.4.33205.214 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recyclable.Collections", "Recyclable.Collections\Recyclable.Collections.csproj", "{7EC0F96D-FB4C-418A-9172-612CC5BCE705}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recyclable.CollectionsTests", "Recyclable.CollectionsTests\Recyclable.CollectionsTests.csproj", "{2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recyclable.Collections.Benchmarks", "Recyclable.Collections.Benchmarks\Recyclable.Collections.Benchmarks.csproj", "{CDC0CF78-FC11-43E3-9059-3261DA3639D1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|x64.ActiveCfg = Debug|x64 - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|x64.Build.0 = Debug|x64 - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|Any CPU.Build.0 = Release|Any CPU - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|x64.ActiveCfg = Release|x64 - {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|x64.Build.0 = Release|x64 - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|x64.ActiveCfg = Debug|x64 - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|x64.Build.0 = Debug|x64 - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|Any CPU.Build.0 = Release|Any CPU - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|x64.ActiveCfg = Release|x64 - {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|x64.Build.0 = Release|x64 - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|x64.ActiveCfg = Debug|x64 - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|x64.Build.0 = Debug|x64 - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|Any CPU.Build.0 = Release|Any CPU - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|x64.ActiveCfg = Release|x64 - {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {2C612762-D1AF-4E88-9427-B4750FBECB1A} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recyclable.Collections", "Recyclable.Collections\Recyclable.Collections.csproj", "{7EC0F96D-FB4C-418A-9172-612CC5BCE705}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recyclable.CollectionsTests", "Recyclable.CollectionsTests\Recyclable.CollectionsTests.csproj", "{2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recyclable.Collections.Benchmarks", "Recyclable.Collections.Benchmarks\Recyclable.Collections.Benchmarks.csproj", "{CDC0CF78-FC11-43E3-9059-3261DA3639D1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|x64.ActiveCfg = Debug|x64 + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Debug|x64.Build.0 = Debug|x64 + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|Any CPU.Build.0 = Release|Any CPU + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|x64.ActiveCfg = Release|x64 + {7EC0F96D-FB4C-418A-9172-612CC5BCE705}.Release|x64.Build.0 = Release|x64 + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|x64.ActiveCfg = Debug|x64 + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Debug|x64.Build.0 = Debug|x64 + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|Any CPU.Build.0 = Release|Any CPU + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|x64.ActiveCfg = Release|x64 + {2B7223FA-2D5B-40BF-9BD9-9D6B05DC18E2}.Release|x64.Build.0 = Release|x64 + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|x64.ActiveCfg = Debug|x64 + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Debug|x64.Build.0 = Debug|x64 + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|Any CPU.Build.0 = Release|Any CPU + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|x64.ActiveCfg = Release|x64 + {CDC0CF78-FC11-43E3-9059-3261DA3639D1}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2C612762-D1AF-4E88-9427-B4750FBECB1A} + EndGlobalSection +EndGlobal diff --git a/Recyclable.Collections/CompareResult.cs b/Recyclable.Collections/CompareResult.cs index 633965d..2d4f83e 100644 --- a/Recyclable.Collections/CompareResult.cs +++ b/Recyclable.Collections/CompareResult.cs @@ -1,9 +1,9 @@ -namespace Recyclable.Collections -{ - public static class CompareResult - { - public const int XLessThanY = -1; - public const int XEqualY = 0; - public const int XGreaterThenY = 1; - } -} +namespace Recyclable.Collections +{ + public static class CompareResult + { + public const int XLessThanY = -1; + public const int XEqualY = 0; + public const int XGreaterThenY = 1; + } +} diff --git a/Recyclable.Collections/ComparisonToComparerAdapter.cs b/Recyclable.Collections/ComparisonToComparerAdapter.cs index 38582b0..16230b8 100644 --- a/Recyclable.Collections/ComparisonToComparerAdapter.cs +++ b/Recyclable.Collections/ComparisonToComparerAdapter.cs @@ -1,32 +1,32 @@ -namespace Recyclable.Collections -{ - public readonly struct ComparisonToComparerAdapter : IComparer - { - private readonly Comparison _comparison; - - public ComparisonToComparerAdapter(Comparison comparison) - { - _comparison = comparison; - } - - public int Compare(T? x, T? y) - { - if (x == null && y == null) - { - return CompareResult.XEqualY; - } - else if (x != null && y == null) - { - return CompareResult.XGreaterThenY; - } - else if (y != null && x == null) - { - return CompareResult.XLessThanY; - } - else - { - return _comparison(x!, y!); - } - } - } -} +namespace Recyclable.Collections +{ + public readonly struct ComparisonToComparerAdapter : IComparer + { + private readonly Comparison _comparison; + + public ComparisonToComparerAdapter(Comparison comparison) + { + _comparison = comparison; + } + + public int Compare(T? x, T? y) + { + if (x == null && y == null) + { + return CompareResult.XEqualY; + } + else if (x != null && y == null) + { + return CompareResult.XGreaterThenY; + } + else if (y != null && x == null) + { + return CompareResult.XLessThanY; + } + else + { + return _comparison(x!, y!); + } + } + } +} diff --git a/Recyclable.Collections/ExceptionExtensions.cs b/Recyclable.Collections/ExceptionExtensions.cs index e0a4f10..190e70d 100644 --- a/Recyclable.Collections/ExceptionExtensions.cs +++ b/Recyclable.Collections/ExceptionExtensions.cs @@ -1,12 +1,12 @@ -using System.Runtime.ExceptionServices; - -namespace Recyclable.Collections -{ - internal static class ExceptionExtensions - { - public static void CaptureAndRethrow(this Exception ex) - { - ExceptionDispatchInfo.Capture(ex).Throw(); - } - } -} +using System.Runtime.ExceptionServices; + +namespace Recyclable.Collections +{ + internal static class ExceptionExtensions + { + public static void CaptureAndRethrow(this Exception ex) + { + ExceptionDispatchInfo.Capture(ex).Throw(); + } + } +} diff --git a/Recyclable.Collections/FrequencyTupleComparer.cs b/Recyclable.Collections/FrequencyTupleComparer.cs index b378e6f..08a13ee 100644 --- a/Recyclable.Collections/FrequencyTupleComparer.cs +++ b/Recyclable.Collections/FrequencyTupleComparer.cs @@ -1,10 +1,10 @@ -namespace Recyclable.Collections -{ - internal class FrequencyTupleComparer : IComparer<(TKey Key, TValue Value)> - { - private static readonly IComparer _baseComparer = Comparer.Default; - - public int Compare((TKey Key, TValue Value) x, (TKey Key, TValue Value) y) - => _baseComparer.Compare(x.Key, y.Key); - } -} +namespace Recyclable.Collections +{ + internal class FrequencyTupleComparer : IComparer<(TKey Key, TValue Value)> + { + private static readonly IComparer _baseComparer = Comparer.Default; + + public int Compare((TKey Key, TValue Value) x, (TKey Key, TValue Value) y) + => _baseComparer.Compare(x.Key, y.Key); + } +} diff --git a/Recyclable.Collections/GlobalSuppressions.cs b/Recyclable.Collections/GlobalSuppressions.cs index 1f77122..75bc557 100644 --- a/Recyclable.Collections/GlobalSuppressions.cs +++ b/Recyclable.Collections/GlobalSuppressions.cs @@ -1,8 +1,8 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Style", "IDE0032:Use auto property", Justification = "", Scope = "member", Target = "~F:Recyclable.Collections.RecyclableList`1._count")] +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Style", "IDE0032:Use auto property", Justification = "", Scope = "member", Target = "~F:Recyclable.Collections.RecyclableList`1._count")] diff --git a/Recyclable.Collections/IRandomNumberGenerator.cs b/Recyclable.Collections/IRandomNumberGenerator.cs index a4df34f..e38d94e 100644 --- a/Recyclable.Collections/IRandomNumberGenerator.cs +++ b/Recyclable.Collections/IRandomNumberGenerator.cs @@ -1,7 +1,7 @@ -namespace Recyclable.Collections -{ - internal interface IRandomNumberGenerator - { - int NextInt32(int startIndex, int endIndex); - } +namespace Recyclable.Collections +{ + internal interface IRandomNumberGenerator + { + int NextInt32(int startIndex, int endIndex); + } } \ No newline at end of file diff --git a/Recyclable.Collections/IRecyclableOwner.cs b/Recyclable.Collections/IRecyclableOwner.cs index b6eaca2..d3a530e 100644 --- a/Recyclable.Collections/IRecyclableOwner.cs +++ b/Recyclable.Collections/IRecyclableOwner.cs @@ -1,10 +1,10 @@ -namespace Recyclable.Collections -{ - internal interface IRecyclableOwner : IList - { - T this[long index] { get; set; } - int BlockSize { get; } - long Capacity { get; set; } - long LongCount { get; set; } - } -} +namespace Recyclable.Collections +{ + internal interface IRecyclableOwner : IList + { + T this[long index] { get; set; } + int BlockSize { get; } + long Capacity { get; set; } + long LongCount { get; set; } + } +} diff --git a/Recyclable.Collections/IRecyclableVersionedList.cs b/Recyclable.Collections/IRecyclableVersionedList.cs index 7ae18e9..0ab3ccc 100644 --- a/Recyclable.Collections/IRecyclableVersionedList.cs +++ b/Recyclable.Collections/IRecyclableVersionedList.cs @@ -1,7 +1,7 @@ -namespace Recyclable.Collections -{ - public interface IRecyclableVersionedList : IEnumerable - { - new RecyclableList.VersionedEnumerator GetEnumerator(); - } -} +namespace Recyclable.Collections +{ + public interface IRecyclableVersionedList : IEnumerable + { + new RecyclableList.VersionedEnumerator GetEnumerator(); + } +} diff --git a/Recyclable.Collections/IRecyclableVersionedLongList.cs b/Recyclable.Collections/IRecyclableVersionedLongList.cs index b67dd0e..97829c2 100644 --- a/Recyclable.Collections/IRecyclableVersionedLongList.cs +++ b/Recyclable.Collections/IRecyclableVersionedLongList.cs @@ -1,7 +1,7 @@ -namespace Recyclable.Collections -{ - public interface IRecyclableVersionedLongList : IEnumerable - { - new RecyclableLongList.VersionedEnumerator GetEnumerator(); - } -} +namespace Recyclable.Collections +{ + public interface IRecyclableVersionedLongList : IEnumerable + { + new RecyclableLongList.VersionedEnumerator GetEnumerator(); + } +} diff --git a/Recyclable.Collections/Linq/QuickSortExtensions.cs b/Recyclable.Collections/Linq/QuickSortExtensions.cs index d72dfac..b21701a 100644 --- a/Recyclable.Collections/Linq/QuickSortExtensions.cs +++ b/Recyclable.Collections/Linq/QuickSortExtensions.cs @@ -1,132 +1,132 @@ -// Ignore Spelling: Linq -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -// The source code was taken from -// https://codereview.stackexchange.com/questions/205407/quicksort-without-recursion. -// -// It was only beautified for .Net 6.0+. - -namespace Recyclable.Collections.Linq -{ - internal static class QuickSortExtensions - { - - public static void InsertionSort(IList values, int startIndex, int endIndex, IComparer comparer) - { - var left = startIndex; - while (left < endIndex) - { - int right = left; - T? temp = values[++left]; - while (right >= startIndex && 0 < comparer.Compare(values[right], temp)) - { - values[right + 1] = values[right--]; - } - - values[right + 1] = temp; - } - } - - public static void InsertionSort(IList values, IComparer comparer) - { - InsertionSort(values, 0, values.Count - 1, comparer); - } - - public static void InsertionSort(IList values) - { - InsertionSort(values, Comparer.Default); - } - - public static void QuickSort(IList values, int startIndex, int endIndex, IComparer comparer, IRandomNumberGenerator randomNumberGenerator) - { - var range = (startIndex, endIndex); - var stack = new Stack<(int, int)>(); - - do - { - startIndex = range.startIndex; - endIndex = range.endIndex; - - if (endIndex - startIndex + 1 < 31) - { - InsertionSort(values, startIndex, endIndex, comparer); - - continue; - } - - var pivot = SampleMedian(values, startIndex, endIndex, comparer, randomNumberGenerator); - var left = startIndex; - var right = endIndex; - - while (left <= right) - { - while (0 > comparer.Compare(values[left], pivot)) - { - left++; - } - - while (0 > comparer.Compare(pivot, values[right])) - { - right--; - } - - if (left <= right) - { - Swap(values, left++, right--); - } - } - - if (startIndex < right) - { - stack.Push((startIndex, right)); - } - - if (left < endIndex) - { - stack.Push((left, endIndex)); - } - } - while (stack.TryPop(out range)); - } - - public static void QuickSort(IList values, IComparer comparer, IRandomNumberGenerator randomNumberGenerator) - => QuickSort(values, 0, values.Count - 1, comparer, randomNumberGenerator); - - public static void QuickSort(IList values) - => QuickSort(values, Comparer.Default, new SystemRandomNumberGenerator()); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static T SampleMedian(IList values, int startIndex, int endIndex, IComparer comparer, IRandomNumberGenerator randomNumberGenerator) - { - var left = randomNumberGenerator.NextInt32(startIndex, endIndex); - var middle = randomNumberGenerator.NextInt32(startIndex, endIndex); - var right = randomNumberGenerator.NextInt32(startIndex, endIndex); - - if (0 > comparer.Compare(values[right], values[left])) - { - Swap(values, right, left); - } - - if (0 > comparer.Compare(values[middle], values[left])) - { - Swap(values, middle, left); - } - - if (0 > comparer.Compare(values[right], values[middle])) - { - Swap(values, right, middle); - } - - return values[middle]; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Swap(IList values, int xIndex, int yIndex) - => (values[yIndex], values[xIndex]) = (values[xIndex], values[yIndex]); - } -} +// Ignore Spelling: Linq +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +// The source code was taken from +// https://codereview.stackexchange.com/questions/205407/quicksort-without-recursion. +// +// It was only beautified for .Net 6.0+. + +namespace Recyclable.Collections.Linq +{ + internal static class QuickSortExtensions + { + + public static void InsertionSort(IList values, int startIndex, int endIndex, IComparer comparer) + { + var left = startIndex; + while (left < endIndex) + { + int right = left; + T? temp = values[++left]; + while (right >= startIndex && 0 < comparer.Compare(values[right], temp)) + { + values[right + 1] = values[right--]; + } + + values[right + 1] = temp; + } + } + + public static void InsertionSort(IList values, IComparer comparer) + { + InsertionSort(values, 0, values.Count - 1, comparer); + } + + public static void InsertionSort(IList values) + { + InsertionSort(values, Comparer.Default); + } + + public static void QuickSort(IList values, int startIndex, int endIndex, IComparer comparer, IRandomNumberGenerator randomNumberGenerator) + { + var range = (startIndex, endIndex); + var stack = new Stack<(int, int)>(); + + do + { + startIndex = range.startIndex; + endIndex = range.endIndex; + + if (endIndex - startIndex + 1 < 31) + { + InsertionSort(values, startIndex, endIndex, comparer); + + continue; + } + + var pivot = SampleMedian(values, startIndex, endIndex, comparer, randomNumberGenerator); + var left = startIndex; + var right = endIndex; + + while (left <= right) + { + while (0 > comparer.Compare(values[left], pivot)) + { + left++; + } + + while (0 > comparer.Compare(pivot, values[right])) + { + right--; + } + + if (left <= right) + { + Swap(values, left++, right--); + } + } + + if (startIndex < right) + { + stack.Push((startIndex, right)); + } + + if (left < endIndex) + { + stack.Push((left, endIndex)); + } + } + while (stack.TryPop(out range)); + } + + public static void QuickSort(IList values, IComparer comparer, IRandomNumberGenerator randomNumberGenerator) + => QuickSort(values, 0, values.Count - 1, comparer, randomNumberGenerator); + + public static void QuickSort(IList values) + => QuickSort(values, Comparer.Default, new SystemRandomNumberGenerator()); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static T SampleMedian(IList values, int startIndex, int endIndex, IComparer comparer, IRandomNumberGenerator randomNumberGenerator) + { + var left = randomNumberGenerator.NextInt32(startIndex, endIndex); + var middle = randomNumberGenerator.NextInt32(startIndex, endIndex); + var right = randomNumberGenerator.NextInt32(startIndex, endIndex); + + if (0 > comparer.Compare(values[right], values[left])) + { + Swap(values, right, left); + } + + if (0 > comparer.Compare(values[middle], values[left])) + { + Swap(values, middle, left); + } + + if (0 > comparer.Compare(values[right], values[middle])) + { + Swap(values, right, middle); + } + + return values[middle]; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Swap(IList values, int xIndex, int yIndex) + => (values[yIndex], values[xIndex]) = (values[xIndex], values[yIndex]); + } +} diff --git a/Recyclable.Collections/MathUtils.cs b/Recyclable.Collections/MathUtils.cs index c7e37f8..aa88280 100644 --- a/Recyclable.Collections/MathUtils.cs +++ b/Recyclable.Collections/MathUtils.cs @@ -1,35 +1,35 @@ -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - internal static class MathUtils - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsPow2(long value) => (value != 0) && ((value & (value - 1)) == 0); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int GetPow2Shift(long value) => BitOperations.IsPow2(value) ? 63 - BitOperations.LeadingZeroCount((ulong)value) : -1; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static long DivMod(long number, int divider, out long remainder) - { - if (number >= checked((long)divider << 4)) - { - return Math.DivRem(number, divider, out remainder); - } - else - { - int result = 0; - remainder = number; - while (remainder >= divider) - { - remainder -= divider; - result++; - } - - return result; - } - } - } -} +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections +{ + internal static class MathUtils + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsPow2(long value) => (value != 0) && ((value & (value - 1)) == 0); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int GetPow2Shift(long value) => BitOperations.IsPow2(value) ? 63 - BitOperations.LeadingZeroCount((ulong)value) : -1; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long DivMod(long number, int divider, out long remainder) + { + if (number >= checked((long)divider << 4)) + { + return Math.DivRem(number, divider, out remainder); + } + else + { + int result = 0; + remainder = number; + while (remainder >= divider) + { + remainder -= divider; + result++; + } + + return result; + } + } + } +} diff --git a/Recyclable.Collections/MemoryBucket.cs b/Recyclable.Collections/MemoryBucket.cs index 54a228a..6bb8e8d 100644 --- a/Recyclable.Collections/MemoryBucket.cs +++ b/Recyclable.Collections/MemoryBucket.cs @@ -1,24 +1,24 @@ -namespace Recyclable.Collections -{ - internal sealed class MemoryBucket - { - public MemoryBucket(T[] memory, MemoryBucket nextBucket) - { - _memory = memory; - _nextBucket = nextBucket; - } - - public MemoryBucket(T[] memory) - { - _memory = memory; - } - -#pragma warning disable RCS1085 - private T[] _memory; - public T[] Memory { get => _memory; set => _memory = value; } - - private MemoryBucket? _nextBucket; - public MemoryBucket? NextBucket { get => _nextBucket; set => _nextBucket = value; } -#pragma warning restore RCS1085 - } -} +namespace Recyclable.Collections +{ + internal sealed class MemoryBucket + { + public MemoryBucket(T[] memory, MemoryBucket nextBucket) + { + _memory = memory; + _nextBucket = nextBucket; + } + + public MemoryBucket(T[] memory) + { + _memory = memory; + } + +#pragma warning disable RCS1085 + private T[] _memory; + public T[] Memory { get => _memory; set => _memory = value; } + + private MemoryBucket? _nextBucket; + public MemoryBucket? NextBucket { get => _nextBucket; set => _nextBucket = value; } +#pragma warning restore RCS1085 + } +} diff --git a/Recyclable.Collections/Parallel/BarrierSlimmer.cs b/Recyclable.Collections/Parallel/BarrierSlimmer.cs index 4a859b6..18c80cd 100644 --- a/Recyclable.Collections/Parallel/BarrierSlimmer.cs +++ b/Recyclable.Collections/Parallel/BarrierSlimmer.cs @@ -1,117 +1,117 @@ -using Microsoft.Extensions.ObjectPool; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections.Parallel -{ - public sealed class BarrierSlimmer : IDisposable - { - private static readonly ObjectPool _defaultPool = new DefaultObjectPool(new DefaultPooledObjectPolicy()); - private ObjectPool? _assignedPool; - private readonly SpinLock _lock = new(false); - - public bool HasParticipants; - public int Participants; - - [MethodImpl(MethodImplOptions.NoInlining)] - public void AddParticipant() - { - bool isLocked = false; - _lock.Enter(ref isLocked); - - Participants++; - if (Participants == 1) - { - HasParticipants = true; - } - - if (isLocked) - { - _lock.Exit(false); - } - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public void RemoveParticipant() - { - if (!HasParticipants) - { - ThrowNoMoreParticipants(); - } - - bool isLocked = false; - _lock.Enter(ref isLocked); - - Participants--; - if (Participants == 0) - { - HasParticipants = false; - } - - if (isLocked) - { - _lock.Exit(false); - } - } - - private static void ThrowNoMoreParticipants() - { - throw new InvalidOperationException("There are no more participants. The operation is not allowed"); - } - - public BarrierSlimmer() - { - _lock = new(false); - } - - public BarrierSlimmer(int participants) - { - _lock = new(false); - Participants = participants; - HasParticipants = participants > 0; - } - - public static BarrierSlimmer Create(int participants) - { - var result = _defaultPool.Get(); - result.Participants = participants; - result.HasParticipants = participants > 0; - return result; - } - - public void Dispose() - { - var assignedPool = _assignedPool; - _assignedPool = null; - assignedPool?.Return(this); - - GC.SuppressFinalize(this); - } - - public void SignalAndWait() - { - RemoveParticipant(); - - //if (!HasParticipants) - //{ - // return; - //} - - //if (!HasParticipants) - //{ - // return; - //} - - //if (!HasParticipants) - //{ - // return; - //} - - // SpinWait.SpinUntil(() => HasParticipants); - var waitSpinner = new SpinWait(); - while (HasParticipants) - { - waitSpinner.SpinOnce(0); - } - } - } -} +using Microsoft.Extensions.ObjectPool; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections.Parallel +{ + public sealed class BarrierSlimmer : IDisposable + { + private static readonly ObjectPool _defaultPool = new DefaultObjectPool(new DefaultPooledObjectPolicy()); + private ObjectPool? _assignedPool; + private readonly SpinLock _lock = new(false); + + public bool HasParticipants; + public int Participants; + + [MethodImpl(MethodImplOptions.NoInlining)] + public void AddParticipant() + { + bool isLocked = false; + _lock.Enter(ref isLocked); + + Participants++; + if (Participants == 1) + { + HasParticipants = true; + } + + if (isLocked) + { + _lock.Exit(false); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public void RemoveParticipant() + { + if (!HasParticipants) + { + ThrowNoMoreParticipants(); + } + + bool isLocked = false; + _lock.Enter(ref isLocked); + + Participants--; + if (Participants == 0) + { + HasParticipants = false; + } + + if (isLocked) + { + _lock.Exit(false); + } + } + + private static void ThrowNoMoreParticipants() + { + throw new InvalidOperationException("There are no more participants. The operation is not allowed"); + } + + public BarrierSlimmer() + { + _lock = new(false); + } + + public BarrierSlimmer(int participants) + { + _lock = new(false); + Participants = participants; + HasParticipants = participants > 0; + } + + public static BarrierSlimmer Create(int participants) + { + var result = _defaultPool.Get(); + result.Participants = participants; + result.HasParticipants = participants > 0; + return result; + } + + public void Dispose() + { + var assignedPool = _assignedPool; + _assignedPool = null; + assignedPool?.Return(this); + + GC.SuppressFinalize(this); + } + + public void SignalAndWait() + { + RemoveParticipant(); + + //if (!HasParticipants) + //{ + // return; + //} + + //if (!HasParticipants) + //{ + // return; + //} + + //if (!HasParticipants) + //{ + // return; + //} + + // SpinWait.SpinUntil(() => HasParticipants); + var waitSpinner = new SpinWait(); + while (HasParticipants) + { + waitSpinner.SpinOnce(0); + } + } + } +} diff --git a/Recyclable.Collections/Parallel/IndexOfSynchronizationContext.cs b/Recyclable.Collections/Parallel/IndexOfSynchronizationContext.cs index ddcde32..d266afe 100644 --- a/Recyclable.Collections/Parallel/IndexOfSynchronizationContext.cs +++ b/Recyclable.Collections/Parallel/IndexOfSynchronizationContext.cs @@ -1,111 +1,111 @@ -namespace Recyclable.Collections.Parallel -{ - public sealed class IndexOfSynchronizationContext - { - private SpinWait _participantsSpinWait = new(); - private SpinLockSlimmer _participantsSpinLock = new(); - private SpinLockSlimmer _indexOfSpinLock = new(); - - internal bool _isItemFound; - internal int _participants; - internal bool _returned; - - public void AddParticipant() - { - _participantsSpinLock.Enter(); - _participants++; - _participantsSpinLock.Exit(); - } - - public void AddParticipants(int newParticipants) - { - _participantsSpinLock.Enter(); - _participants += newParticipants; - _participantsSpinLock.Exit(); - } - - public void Lock() - { - _indexOfSpinLock.Enter(); - } - - public void RemoveParticipants(int participantsToRemove) - { - if (_participants < participantsToRemove) - { - ThrowNotEnoughParticipants(); - } - - _participantsSpinLock.Enter(); - _participants -= participantsToRemove; - _participantsSpinLock.Exit(); - } - - public void RemoveParticipant() - { - if (_participants == 0) - { - ThrowNoMoreParticipants(); - } - - _participantsSpinLock.Enter(); - _participants--; - _participantsSpinLock.Exit(); - } - - public void SignalAndWait() - { - if (_participants == 0) - { - ThrowNoMoreParticipants(); - } - - _participantsSpinLock.Enter(); - _participants--; - _participantsSpinLock.Exit(); - - while (_participants > 0) - { - _participantsSpinWait.SpinOnce(); - } - } - - public void Unlock() - { - _indexOfSpinLock.Exit(); - } - - private static void ThrowNotEnoughParticipants() => throw new InvalidOperationException("Participant cannot be removed, because there are not enough participants."); - private static void ThrowNoMoreParticipants() => throw new InvalidOperationException("Participant cannot be removed, because there are no more participants."); - - public long FoundBlockIndex; - public long FoundItemIndex; - public Exception? Exception; - public int Participants => _participants; - - public IndexOfSynchronizationContext() - { - } - - public IndexOfSynchronizationContext(int participantCount) - { - _participants = participantCount; - } - - public void SetItemFound() - { - _isItemFound = true; - } - - public bool IsItemFound => _isItemFound; - - public void Dispose() - { - if (!_returned) - { - _returned = true; - IndexOfSynchronizationContextPool.Shared.Return(this); - } - } - } +namespace Recyclable.Collections.Parallel +{ + public sealed class IndexOfSynchronizationContext + { + private SpinWait _participantsSpinWait = new(); + private SpinLockSlimmer _participantsSpinLock = new(); + private SpinLockSlimmer _indexOfSpinLock = new(); + + internal bool _isItemFound; + internal int _participants; + internal bool _returned; + + public void AddParticipant() + { + _participantsSpinLock.Enter(); + _participants++; + _participantsSpinLock.Exit(); + } + + public void AddParticipants(int newParticipants) + { + _participantsSpinLock.Enter(); + _participants += newParticipants; + _participantsSpinLock.Exit(); + } + + public void Lock() + { + _indexOfSpinLock.Enter(); + } + + public void RemoveParticipants(int participantsToRemove) + { + if (_participants < participantsToRemove) + { + ThrowNotEnoughParticipants(); + } + + _participantsSpinLock.Enter(); + _participants -= participantsToRemove; + _participantsSpinLock.Exit(); + } + + public void RemoveParticipant() + { + if (_participants == 0) + { + ThrowNoMoreParticipants(); + } + + _participantsSpinLock.Enter(); + _participants--; + _participantsSpinLock.Exit(); + } + + public void SignalAndWait() + { + if (_participants == 0) + { + ThrowNoMoreParticipants(); + } + + _participantsSpinLock.Enter(); + _participants--; + _participantsSpinLock.Exit(); + + while (_participants > 0) + { + _participantsSpinWait.SpinOnce(); + } + } + + public void Unlock() + { + _indexOfSpinLock.Exit(); + } + + private static void ThrowNotEnoughParticipants() => throw new InvalidOperationException("Participant cannot be removed, because there are not enough participants."); + private static void ThrowNoMoreParticipants() => throw new InvalidOperationException("Participant cannot be removed, because there are no more participants."); + + public long FoundBlockIndex; + public long FoundItemIndex; + public Exception? Exception; + public int Participants => _participants; + + public IndexOfSynchronizationContext() + { + } + + public IndexOfSynchronizationContext(int participantCount) + { + _participants = participantCount; + } + + public void SetItemFound() + { + _isItemFound = true; + } + + public bool IsItemFound => _isItemFound; + + public void Dispose() + { + if (!_returned) + { + _returned = true; + IndexOfSynchronizationContextPool.Shared.Return(this); + } + } + } } \ No newline at end of file diff --git a/Recyclable.Collections/Parallel/IndexOfSynchronizationContextPool.cs b/Recyclable.Collections/Parallel/IndexOfSynchronizationContextPool.cs index 935b71d..31f8a7c 100644 --- a/Recyclable.Collections/Parallel/IndexOfSynchronizationContextPool.cs +++ b/Recyclable.Collections/Parallel/IndexOfSynchronizationContextPool.cs @@ -1,50 +1,50 @@ -using Microsoft.Extensions.ObjectPool; - -namespace Recyclable.Collections.Parallel -{ - public static class IndexOfSynchronizationContextPool - { - private static readonly SpinLock _updateLock = new(false); - public static readonly ObjectPool Shared = new DefaultObjectPool(new DefaultPooledObjectPolicy()); - - public static IndexOfSynchronizationContext GetWithOneParticipant() - { - bool lockTaken = false; - _updateLock.Enter(ref lockTaken); - var context = Shared.Get(); - if (lockTaken) - { - _updateLock.Exit(false); - } - - if (context._isItemFound) - { - context._isItemFound = false; - } - - switch (context._participants) - { - case > 1: - context.RemoveParticipants(context._participants - 1); - break; - - case 0: - context.AddParticipant(); - break; - } - - if (context.Exception != null) - { - context.Exception = null; - } - - if (context.FoundItemIndex >= 0) - { - context.FoundItemIndex = RecyclableDefaults.ItemNotFoundIndexLong; - } - - context._returned = false; - return context; - } - } +using Microsoft.Extensions.ObjectPool; + +namespace Recyclable.Collections.Parallel +{ + public static class IndexOfSynchronizationContextPool + { + private static readonly SpinLock _updateLock = new(false); + public static readonly ObjectPool Shared = new DefaultObjectPool(new DefaultPooledObjectPolicy()); + + public static IndexOfSynchronizationContext GetWithOneParticipant() + { + bool lockTaken = false; + _updateLock.Enter(ref lockTaken); + var context = Shared.Get(); + if (lockTaken) + { + _updateLock.Exit(false); + } + + if (context._isItemFound) + { + context._isItemFound = false; + } + + switch (context._participants) + { + case > 1: + context.RemoveParticipants(context._participants - 1); + break; + + case 0: + context.AddParticipant(); + break; + } + + if (context.Exception != null) + { + context.Exception = null; + } + + if (context.FoundItemIndex >= 0) + { + context.FoundItemIndex = RecyclableDefaults.ItemNotFoundIndexLong; + } + + context._returned = false; + return context; + } + } } \ No newline at end of file diff --git a/Recyclable.Collections/Parallel/ManualResetEventSlimmer.cs b/Recyclable.Collections/Parallel/ManualResetEventSlimmer.cs index 8d53a8d..6dff0fb 100644 --- a/Recyclable.Collections/Parallel/ManualResetEventSlimmer.cs +++ b/Recyclable.Collections/Parallel/ManualResetEventSlimmer.cs @@ -1,38 +1,38 @@ -namespace Recyclable.Collections.Parallel -{ - public sealed class ManualResetEventSlimmer - { - internal bool _isSet; - public bool IsSet => _isSet; - - internal bool _returned; - - public ManualResetEventSlimmer() - { - } - - public ManualResetEventSlimmer(bool initialState) - { - _isSet = initialState; - } - - public void Set() - { - _isSet = true; - } - - public void Reset() - { - _isSet = false; - } - - public void Dispose() - { - if (!_returned) - { - _returned = true; - ManualResetEventSlimmerPool.Shared.Return(this); - } - } - } -} +namespace Recyclable.Collections.Parallel +{ + public sealed class ManualResetEventSlimmer + { + internal bool _isSet; + public bool IsSet => _isSet; + + internal bool _returned; + + public ManualResetEventSlimmer() + { + } + + public ManualResetEventSlimmer(bool initialState) + { + _isSet = initialState; + } + + public void Set() + { + _isSet = true; + } + + public void Reset() + { + _isSet = false; + } + + public void Dispose() + { + if (!_returned) + { + _returned = true; + ManualResetEventSlimmerPool.Shared.Return(this); + } + } + } +} diff --git a/Recyclable.Collections/Parallel/ManualResetEventSlimmerPool.cs b/Recyclable.Collections/Parallel/ManualResetEventSlimmerPool.cs index 5cee73e..6b9ac79 100644 --- a/Recyclable.Collections/Parallel/ManualResetEventSlimmerPool.cs +++ b/Recyclable.Collections/Parallel/ManualResetEventSlimmerPool.cs @@ -1,29 +1,29 @@ -using Microsoft.Extensions.ObjectPool; - -namespace Recyclable.Collections.Parallel -{ - public static class ManualResetEventSlimmerPool - { - public static readonly SpinLock _updateLock = new(false); - public static readonly ObjectPool Shared = new DefaultObjectPool(new DefaultPooledObjectPolicy()); - - public static ManualResetEventSlimmer Create(bool initialState) - { - bool lockTaken = false; - _updateLock.Enter(ref lockTaken); - ManualResetEventSlimmer result = Shared.Get(); - if (lockTaken) - { - _updateLock.Exit(false); - } - - result._returned = false; - if (result._isSet != initialState) - { - result._isSet = initialState; - } - - return result; - } - } -} +using Microsoft.Extensions.ObjectPool; + +namespace Recyclable.Collections.Parallel +{ + public static class ManualResetEventSlimmerPool + { + public static readonly SpinLock _updateLock = new(false); + public static readonly ObjectPool Shared = new DefaultObjectPool(new DefaultPooledObjectPolicy()); + + public static ManualResetEventSlimmer Create(bool initialState) + { + bool lockTaken = false; + _updateLock.Enter(ref lockTaken); + ManualResetEventSlimmer result = Shared.Get(); + if (lockTaken) + { + _updateLock.Exit(false); + } + + result._returned = false; + if (result._isSet != initialState) + { + result._isSet = initialState; + } + + return result; + } + } +} diff --git a/Recyclable.Collections/Parallel/SpinLockSlimmer.cs b/Recyclable.Collections/Parallel/SpinLockSlimmer.cs index a603b25..e4f5a62 100644 --- a/Recyclable.Collections/Parallel/SpinLockSlimmer.cs +++ b/Recyclable.Collections/Parallel/SpinLockSlimmer.cs @@ -1,26 +1,26 @@ -namespace Recyclable.Collections.Parallel -{ - public struct SpinLockSlimmer - { - private volatile int _locked; - - public void Enter() - { - if (Interlocked.CompareExchange(ref _locked, 1, 0) == 0) - { - return; - } - - SpinWait waiter = new(); - while (Interlocked.CompareExchange(ref _locked, 1, 0) == 1) - { - waiter.SpinOnce(); - } - } - - public void Exit() - { - _locked = 0; - } - } -} +namespace Recyclable.Collections.Parallel +{ + public struct SpinLockSlimmer + { + private volatile int _locked; + + public void Enter() + { + if (Interlocked.CompareExchange(ref _locked, 1, 0) == 0) + { + return; + } + + SpinWait waiter = new(); + while (Interlocked.CompareExchange(ref _locked, 1, 0) == 1) + { + waiter.SpinOnce(); + } + } + + public void Exit() + { + _locked = 0; + } + } +} diff --git a/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunk.cs b/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunk.cs index d0ce568..e07e3fc 100644 --- a/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunk.cs +++ b/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunk.cs @@ -1,20 +1,20 @@ -namespace Recyclable.Collections.Pools -{ - public sealed class BiDirectionalRecyclableArrayPoolChunk - { - private static readonly T[] _empty = Array.Empty(); - - internal static T[] Empty => _empty; - - internal T[] Value; - internal int Top; - internal int Bottom; - internal BiDirectionalRecyclableArrayPoolChunk? Previous; - internal BiDirectionalRecyclableArrayPoolChunk? Next; - - public BiDirectionalRecyclableArrayPoolChunk() - { - Value = _empty; - } - } -} +namespace Recyclable.Collections.Pools +{ + public sealed class BiDirectionalRecyclableArrayPoolChunk + { + private static readonly T[] _empty = Array.Empty(); + + internal static T[] Empty => _empty; + + internal T[] Value; + internal int Top; + internal int Bottom; + internal BiDirectionalRecyclableArrayPoolChunk? Previous; + internal BiDirectionalRecyclableArrayPoolChunk? Next; + + public BiDirectionalRecyclableArrayPoolChunk() + { + Value = _empty; + } + } +} diff --git a/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunkPool.cs b/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunkPool.cs index 5b36fc8..1d6723c 100644 --- a/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunkPool.cs +++ b/Recyclable.Collections/Pools/BiDirectionalRecyclableArrayPoolChunkPool.cs @@ -1,37 +1,37 @@ -using Microsoft.Extensions.ObjectPool; - -namespace Recyclable.Collections.Pools -{ - public static class BiDirectionalRecyclableArrayPoolChunkPool - { - private static readonly ObjectPool> _pool = - new DefaultObjectPool>(new DefaultPooledObjectPolicy>()); - - public static BiDirectionalRecyclableArrayPoolChunk Rent() => _pool.Get(); - - public static void Return(BiDirectionalRecyclableArrayPoolChunk chunk) - { - chunk.Top = 0; - chunk.Bottom = 0; - chunk.Previous = null; - chunk.Next = null; - _pool.Return(chunk); - } - - public static void Dispose(BiDirectionalRecyclableArrayPoolChunk chunk, bool needsClearing) - { - var buffer = chunk.Value; - if (buffer.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, needsClearing); - } - - chunk.Value = BiDirectionalRecyclableArrayPoolChunk.Empty; - chunk.Top = 0; - chunk.Bottom = 0; - chunk.Previous = null; - chunk.Next = null; - _pool.Return(chunk); - } - } -} +using Microsoft.Extensions.ObjectPool; + +namespace Recyclable.Collections.Pools +{ + public static class BiDirectionalRecyclableArrayPoolChunkPool + { + private static readonly ObjectPool> _pool = + new DefaultObjectPool>(new DefaultPooledObjectPolicy>()); + + public static BiDirectionalRecyclableArrayPoolChunk Rent() => _pool.Get(); + + public static void Return(BiDirectionalRecyclableArrayPoolChunk chunk) + { + chunk.Top = 0; + chunk.Bottom = 0; + chunk.Previous = null; + chunk.Next = null; + _pool.Return(chunk); + } + + public static void Dispose(BiDirectionalRecyclableArrayPoolChunk chunk, bool needsClearing) + { + var buffer = chunk.Value; + if (buffer.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, needsClearing); + } + + chunk.Value = BiDirectionalRecyclableArrayPoolChunk.Empty; + chunk.Top = 0; + chunk.Bottom = 0; + chunk.Previous = null; + chunk.Next = null; + _pool.Return(chunk); + } + } +} diff --git a/Recyclable.Collections/Pools/MemoryUtils.cs b/Recyclable.Collections/Pools/MemoryUtils.cs index c51306d..1cc5dc2 100644 --- a/Recyclable.Collections/Pools/MemoryUtils.cs +++ b/Recyclable.Collections/Pools/MemoryUtils.cs @@ -1,32 +1,32 @@ -namespace Recyclable.Collections.Pools -{ - internal enum MemoryPressure - { - High, - Medium, - Low - } - - internal static class MemoryUtils - { - public static MemoryPressure GetMemoryPressure() - { - const double HighPressureThreshold = .90; // Percent of GC memory pressure threshold we consider "high" - const double MediumPressureThreshold = .70; // Percent of GC memory pressure threshold we consider "medium" - - GCMemoryInfo memoryInfo = GC.GetGCMemoryInfo(); - - if (memoryInfo.MemoryLoadBytes >= memoryInfo.HighMemoryLoadThresholdBytes * HighPressureThreshold) - { - return MemoryPressure.High; - } - - if (memoryInfo.MemoryLoadBytes >= memoryInfo.HighMemoryLoadThresholdBytes * MediumPressureThreshold) - { - return MemoryPressure.Medium; - } - - return MemoryPressure.Low; - } - } +namespace Recyclable.Collections.Pools +{ + internal enum MemoryPressure + { + High, + Medium, + Low + } + + internal static class MemoryUtils + { + public static MemoryPressure GetMemoryPressure() + { + const double HighPressureThreshold = .90; // Percent of GC memory pressure threshold we consider "high" + const double MediumPressureThreshold = .70; // Percent of GC memory pressure threshold we consider "medium" + + GCMemoryInfo memoryInfo = GC.GetGCMemoryInfo(); + + if (memoryInfo.MemoryLoadBytes >= memoryInfo.HighMemoryLoadThresholdBytes * HighPressureThreshold) + { + return MemoryPressure.High; + } + + if (memoryInfo.MemoryLoadBytes >= memoryInfo.HighMemoryLoadThresholdBytes * MediumPressureThreshold) + { + return MemoryPressure.Medium; + } + + return MemoryPressure.Low; + } + } } \ No newline at end of file diff --git a/Recyclable.Collections/Pools/OneSizeArrayPool.cs b/Recyclable.Collections/Pools/OneSizeArrayPool.cs index 4c50db1..195397b 100644 --- a/Recyclable.Collections/Pools/OneSizeArrayPool.cs +++ b/Recyclable.Collections/Pools/OneSizeArrayPool.cs @@ -1,144 +1,144 @@ -namespace Recyclable.Collections.Pools -{ - public struct OneSizeArrayPool - { - private volatile MemoryBucket? _currentBucket; - private volatile int _blockCount; - private volatile int _locked; - private readonly int _blockSize; - private readonly int _minBlockCount; - internal volatile bool _memoryExceeded; - - private void Enter() - { - if (Interlocked.CompareExchange(ref _locked, 1, 0) == 0) - { - return; - } - - SpinWait waiter = new(); - while (Interlocked.CompareExchange(ref _locked, 1, 0) == 1) - { - waiter.SpinOnce(); - } - } - - private void Exit() - { - _locked = 0; - } - - public OneSizeArrayPool(int blockSize, int minBlockCount) - { - _blockCount = 0; - _currentBucket = null; - _locked = 0; - _memoryExceeded = false; - _blockSize = blockSize; - _minBlockCount = minBlockCount; - _ = Task.Run(ReleaseMemoryOnExcess); - } - - public T[] Rent() - { - MemoryBucket? bucket; - Enter(); - if (_currentBucket != null) - { - _blockCount--; - bucket = _currentBucket; - _currentBucket = _currentBucket.NextBucket; - } - else - { - bucket = null; - } - - Exit(); - return bucket != null ? bucket.Memory : new T[_blockSize]; - } - - public void ReturnUnchecked(T[] array, bool clearArray) - { - MemoryBucket bucket = new(array); - if (clearArray) - { - // TODO: Measure performance - // new Span(array).Clear(); - Array.Clear(array, 0, array.Length); - } - - Enter(); - bucket.NextBucket = _currentBucket; - _currentBucket = bucket; - _blockCount++; - Exit(); - } - - public void Return(T[] array, bool clearArray = false) - { - if (array.Length != _blockSize) - { - ThrowHelper.ThrowWrongReturnedArraySizeException(array.Length, _blockSize); - } - - if (clearArray) - { - // TODO: Measure performance - // new Span(array).Clear(); - Array.Clear(array, 0, array.Length); - } - - MemoryBucket bucket = new(array); - Enter(); - if (_blockCount < _minBlockCount) - { - bucket.NextBucket = _currentBucket; - _currentBucket = bucket; - _blockCount++; - } - - Exit(); - } - - private const int MemoryReleaseTaskSleepMilliseconds = 500; - - private async Task ReleaseMemoryOnExcess() - { - while (true) - { - if (_memoryExceeded) - { - Enter(); - if (_currentBucket != null) - { - _blockCount--; - _currentBucket = _currentBucket.NextBucket; - } - - if (_currentBucket != null) - { - _blockCount--; - _currentBucket = _currentBucket.NextBucket; - } - - if (_currentBucket != null) - { - _blockCount--; - _currentBucket = _currentBucket.NextBucket; - } - - if (_currentBucket != null) - { - _blockCount--; - _currentBucket = _currentBucket.NextBucket; - } - - Exit(); - } - - await Task.Delay(MemoryReleaseTaskSleepMilliseconds); - } - } - } -} +namespace Recyclable.Collections.Pools +{ + public struct OneSizeArrayPool + { + private volatile MemoryBucket? _currentBucket; + private volatile int _blockCount; + private volatile int _locked; + private readonly int _blockSize; + private readonly int _minBlockCount; + internal volatile bool _memoryExceeded; + + private void Enter() + { + if (Interlocked.CompareExchange(ref _locked, 1, 0) == 0) + { + return; + } + + SpinWait waiter = new(); + while (Interlocked.CompareExchange(ref _locked, 1, 0) == 1) + { + waiter.SpinOnce(); + } + } + + private void Exit() + { + _locked = 0; + } + + public OneSizeArrayPool(int blockSize, int minBlockCount) + { + _blockCount = 0; + _currentBucket = null; + _locked = 0; + _memoryExceeded = false; + _blockSize = blockSize; + _minBlockCount = minBlockCount; + _ = Task.Run(ReleaseMemoryOnExcess); + } + + public T[] Rent() + { + MemoryBucket? bucket; + Enter(); + if (_currentBucket != null) + { + _blockCount--; + bucket = _currentBucket; + _currentBucket = _currentBucket.NextBucket; + } + else + { + bucket = null; + } + + Exit(); + return bucket != null ? bucket.Memory : new T[_blockSize]; + } + + public void ReturnUnchecked(T[] array, bool clearArray) + { + MemoryBucket bucket = new(array); + if (clearArray) + { + // TODO: Measure performance + // new Span(array).Clear(); + Array.Clear(array, 0, array.Length); + } + + Enter(); + bucket.NextBucket = _currentBucket; + _currentBucket = bucket; + _blockCount++; + Exit(); + } + + public void Return(T[] array, bool clearArray = false) + { + if (array.Length != _blockSize) + { + ThrowHelper.ThrowWrongReturnedArraySizeException(array.Length, _blockSize); + } + + if (clearArray) + { + // TODO: Measure performance + // new Span(array).Clear(); + Array.Clear(array, 0, array.Length); + } + + MemoryBucket bucket = new(array); + Enter(); + if (_blockCount < _minBlockCount) + { + bucket.NextBucket = _currentBucket; + _currentBucket = bucket; + _blockCount++; + } + + Exit(); + } + + private const int MemoryReleaseTaskSleepMilliseconds = 500; + + private async Task ReleaseMemoryOnExcess() + { + while (true) + { + if (_memoryExceeded) + { + Enter(); + if (_currentBucket != null) + { + _blockCount--; + _currentBucket = _currentBucket.NextBucket; + } + + if (_currentBucket != null) + { + _blockCount--; + _currentBucket = _currentBucket.NextBucket; + } + + if (_currentBucket != null) + { + _blockCount--; + _currentBucket = _currentBucket.NextBucket; + } + + if (_currentBucket != null) + { + _blockCount--; + _currentBucket = _currentBucket.NextBucket; + } + + Exit(); + } + + await Task.Delay(MemoryReleaseTaskSleepMilliseconds); + } + } + } +} diff --git a/Recyclable.Collections/Pools/RecyclableArrayPool.cs b/Recyclable.Collections/Pools/RecyclableArrayPool.cs index cad307a..ec0dd04 100644 --- a/Recyclable.Collections/Pools/RecyclableArrayPool.cs +++ b/Recyclable.Collections/Pools/RecyclableArrayPool.cs @@ -1,53 +1,53 @@ -using System.Numerics; - -namespace Recyclable.Collections.Pools -{ - public readonly struct RecyclableArrayPool - { - internal static readonly OneSizeArrayPool[] _pools = new OneSizeArrayPool[32]; - public static T[] RentShared(int blockSize) => _pools[31 - BitOperations.LeadingZeroCount((uint)blockSize)].Rent(); - public static void ReturnShared(in T[] memoryBlock, bool needsClearing) - { - if (BitOperations.IsPow2(memoryBlock.Length)) - { - _pools[31 - BitOperations.LeadingZeroCount((uint)memoryBlock.Length)].ReturnUnchecked(memoryBlock, needsClearing); - } - } - - public static ref OneSizeArrayPool Shared(int blockSize) - => ref _pools[31 - BitOperations.LeadingZeroCount((uint)blockSize)]; - - static RecyclableArrayPool() - { - var pools = _pools; - for (var arraySize = 0; arraySize < 32; arraySize++) - { - int blockSize = 1 << arraySize; - pools[arraySize] = new OneSizeArrayPool(blockSize, 1000); - } - - _ = Task.Run(CheckAndReportMemoryPressure); - } - - public static readonly OneSizeArrayPool Null = new(0, 0); - - private static async Task CheckAndReportMemoryPressure() - { - var previousValue = false; - while (true) - { - bool memoryExceeded = MemoryUtils.GetMemoryPressure() == MemoryPressure.High; - if (memoryExceeded != previousValue) - { - previousValue = memoryExceeded; - for (var i = 0; i < _pools!.Length; i++) - { - _pools[i]._memoryExceeded = memoryExceeded; - } - } - - await Task.Delay(500); - } - } - } -} +using System.Numerics; + +namespace Recyclable.Collections.Pools +{ + public readonly struct RecyclableArrayPool + { + internal static readonly OneSizeArrayPool[] _pools = new OneSizeArrayPool[32]; + public static T[] RentShared(int blockSize) => _pools[31 - BitOperations.LeadingZeroCount((uint)blockSize)].Rent(); + public static void ReturnShared(in T[] memoryBlock, bool needsClearing) + { + if (BitOperations.IsPow2(memoryBlock.Length)) + { + _pools[31 - BitOperations.LeadingZeroCount((uint)memoryBlock.Length)].ReturnUnchecked(memoryBlock, needsClearing); + } + } + + public static ref OneSizeArrayPool Shared(int blockSize) + => ref _pools[31 - BitOperations.LeadingZeroCount((uint)blockSize)]; + + static RecyclableArrayPool() + { + var pools = _pools; + for (var arraySize = 0; arraySize < 32; arraySize++) + { + int blockSize = 1 << arraySize; + pools[arraySize] = new OneSizeArrayPool(blockSize, 1000); + } + + _ = Task.Run(CheckAndReportMemoryPressure); + } + + public static readonly OneSizeArrayPool Null = new(0, 0); + + private static async Task CheckAndReportMemoryPressure() + { + var previousValue = false; + while (true) + { + bool memoryExceeded = MemoryUtils.GetMemoryPressure() == MemoryPressure.High; + if (memoryExceeded != previousValue) + { + previousValue = memoryExceeded; + for (var i = 0; i < _pools!.Length; i++) + { + _pools[i]._memoryExceeded = memoryExceeded; + } + } + + await Task.Delay(500); + } + } + } +} diff --git a/Recyclable.Collections/Pools/RecyclableArrayPoolChunk.cs b/Recyclable.Collections/Pools/RecyclableArrayPoolChunk.cs index da4fe49..272489b 100644 --- a/Recyclable.Collections/Pools/RecyclableArrayPoolChunk.cs +++ b/Recyclable.Collections/Pools/RecyclableArrayPoolChunk.cs @@ -1,19 +1,19 @@ -namespace Recyclable.Collections.Pools -{ - public sealed class RecyclableArrayPoolChunk - { - private static readonly T[] _empty = Array.Empty(); - - internal static T[] Empty => _empty; - - internal T[] Value; - internal int Index; - internal RecyclableArrayPoolChunk? Previous; - internal RecyclableArrayPoolChunk? Next; - - public RecyclableArrayPoolChunk() - { - Value = _empty; - } - } -} +namespace Recyclable.Collections.Pools +{ + public sealed class RecyclableArrayPoolChunk + { + private static readonly T[] _empty = Array.Empty(); + + internal static T[] Empty => _empty; + + internal T[] Value; + internal int Index; + internal RecyclableArrayPoolChunk? Previous; + internal RecyclableArrayPoolChunk? Next; + + public RecyclableArrayPoolChunk() + { + Value = _empty; + } + } +} diff --git a/Recyclable.Collections/Pools/RecyclableArrayPoolChunkPool.cs b/Recyclable.Collections/Pools/RecyclableArrayPoolChunkPool.cs index d64ff90..4408d13 100644 --- a/Recyclable.Collections/Pools/RecyclableArrayPoolChunkPool.cs +++ b/Recyclable.Collections/Pools/RecyclableArrayPoolChunkPool.cs @@ -1,34 +1,34 @@ -using Microsoft.Extensions.ObjectPool; - -namespace Recyclable.Collections.Pools -{ - public static class RecyclableArrayPoolChunkPool - { - private static readonly ObjectPool> _pool = - new DefaultObjectPool>(new DefaultPooledObjectPolicy>()); - - public static RecyclableArrayPoolChunk Rent() => _pool.Get(); - - public static void Return(RecyclableArrayPoolChunk chunk) - { - chunk.Index = 0; - chunk.Previous = null; - chunk.Next = null; - _pool.Return(chunk); - } - - public static void Dispose(RecyclableArrayPoolChunk chunk, bool needsClearing) - { - var buffer = chunk.Value; - if (buffer.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, needsClearing); - } - chunk.Value = RecyclableArrayPoolChunk.Empty; - chunk.Index = 0; - chunk.Previous = null; - chunk.Next = null; - _pool.Return(chunk); - } - } -} +using Microsoft.Extensions.ObjectPool; + +namespace Recyclable.Collections.Pools +{ + public static class RecyclableArrayPoolChunkPool + { + private static readonly ObjectPool> _pool = + new DefaultObjectPool>(new DefaultPooledObjectPolicy>()); + + public static RecyclableArrayPoolChunk Rent() => _pool.Get(); + + public static void Return(RecyclableArrayPoolChunk chunk) + { + chunk.Index = 0; + chunk.Previous = null; + chunk.Next = null; + _pool.Return(chunk); + } + + public static void Dispose(RecyclableArrayPoolChunk chunk, bool needsClearing) + { + var buffer = chunk.Value; + if (buffer.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, needsClearing); + } + chunk.Value = RecyclableArrayPoolChunk.Empty; + chunk.Index = 0; + chunk.Previous = null; + chunk.Next = null; + _pool.Return(chunk); + } + } +} diff --git a/Recyclable.Collections/Recyclable.Collections.csproj b/Recyclable.Collections/Recyclable.Collections.csproj index 9434c22..5733c6a 100644 --- a/Recyclable.Collections/Recyclable.Collections.csproj +++ b/Recyclable.Collections/Recyclable.Collections.csproj @@ -1,42 +1,42 @@ - - - net8.0;net7.0;net6.0 - enable - enable - $(DefineConstants);WITH_VERSIONING - true - Recyclable.Collections - 0.0.6 - Marek Lemańczyk - N/A - Recyclable.Collections - Recyclable ArrayPool Array Pool List Sortable Sort - Recyclable.Collections project is an open source framework for operating dynamic lists at performance close to raw arrays. It aims at providing minimal memory footprint. It implements IList<T>'s interface and is targeted as direct replacements of List<T>, SortableList<T>, PriorityQueue<T> and similar. - https://github.com/mlemanczyk/Recyclable.Collections - https://github.com/mlemanczyk/Recyclable.Collections - Marek Lemańczyk 2023 - LICENSE.md - README.md - git - List<T> compatibility pack added for RecyclableList<T>. Various performance improvements and fixes. - AnyCPU;x64 - - - - - Always - - - PreserveNewest - - - - - - - - - - - - + + + net8.0;net7.0;net6.0 + enable + enable + $(DefineConstants);WITH_VERSIONING + true + Recyclable.Collections + 0.0.6 + Marek Lemańczyk + N/A + Recyclable.Collections + Recyclable ArrayPool Array Pool List Sortable Sort + Recyclable.Collections project is an open source framework for operating dynamic lists at performance close to raw arrays. It aims at providing minimal memory footprint. It implements IList<T>'s interface and is targeted as direct replacements of List<T>, SortableList<T>, PriorityQueue<T> and similar. + https://github.com/mlemanczyk/Recyclable.Collections + https://github.com/mlemanczyk/Recyclable.Collections + Marek Lemańczyk 2023 + LICENSE.md + README.md + git + List<T> compatibility pack added for RecyclableList<T>. Various performance improvements and fixes. + AnyCPU;x64 + + + + + Always + + + PreserveNewest + + + + + + + + + + + + diff --git a/Recyclable.Collections/RecyclableDefaults.cs b/Recyclable.Collections/RecyclableDefaults.cs index 291809d..d0474d4 100644 --- a/Recyclable.Collections/RecyclableDefaults.cs +++ b/Recyclable.Collections/RecyclableDefaults.cs @@ -1,14 +1,14 @@ -namespace Recyclable.Collections -{ - public static class RecyclableDefaults - { - public const int BlockIndexLimit = int.MaxValue; - public const int BlockSize = 16_384; - public const int InitialCapacity = 4; - public const long MinItemsCountForParallelization = 850_000; - public const int MinPooledArrayLength = 37; - public const int MaxPooledBlockSize = 2_147_483_591; - public const long ItemNotFoundIndexLong = -1L; - public const int ItemNotFoundIndex = -1; - } -} +namespace Recyclable.Collections +{ + public static class RecyclableDefaults + { + public const int BlockIndexLimit = int.MaxValue; + public const int BlockSize = 16_384; + public const int InitialCapacity = 4; + public const long MinItemsCountForParallelization = 850_000; + public const int MinPooledArrayLength = 37; + public const int MaxPooledBlockSize = 2_147_483_591; + public const long ItemNotFoundIndexLong = -1L; + public const int ItemNotFoundIndex = -1; + } +} diff --git a/Recyclable.Collections/RecyclableDictionary.AddRange.cs b/Recyclable.Collections/RecyclableDictionary.AddRange.cs index 74c685f..4492a0a 100644 --- a/Recyclable.Collections/RecyclableDictionary.AddRange.cs +++ b/Recyclable.Collections/RecyclableDictionary.AddRange.cs @@ -1,1142 +1,1142 @@ -using System; -using System.Collections.Generic; -using System.Collections; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class zRecyclableDictionaryAddRange - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static ref RecyclableDictionary.Entry GetEntry(RecyclableDictionary dictionary, int index) - where TKey : notnull - { - return ref dictionary._entries[index >> dictionary._blockShift][index & dictionary._blockSizeMinus1]; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void EnsureCapacity(RecyclableDictionary dictionary, int min) - where TKey : notnull - { - int requiredBlocks = (min + dictionary._blockSizeMinus1) >> dictionary._blockShift; - if (dictionary._entries.Length < requiredBlocks) - { - var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.Entry[]>.RentShared(requiredBlocks) - : new RecyclableDictionary.Entry[requiredBlocks][]; - - Array.Copy(dictionary._entries, newBlocks, dictionary._entries.Length); - - if (dictionary._entries.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.Entry[]>.ReturnShared(dictionary._entries, false); - } - - dictionary._entries = newBlocks; - } - - for (int i = 0; i < requiredBlocks; i++) - { - if (dictionary._entries[i] == null) - { - dictionary._entries[i] = dictionary._blockSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.Entry>.RentShared(dictionary._blockSize) - : new RecyclableDictionary.Entry[dictionary._blockSize]; - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void ResizeBuckets(RecyclableDictionary dictionary, int newSize) - where TKey : notnull - { - var newBuckets = new int[newSize]; - Array.Fill(newBuckets, -1); - for (int i = 0; i < dictionary._count; i++) - { - ref var entry = ref GetEntry(dictionary, i); - int bucket = entry.HashCode & (newSize - 1); - entry.Next = newBuckets[bucket]; - newBuckets[bucket] = i; - } - - dictionary._buckets = newBuckets; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, ReadOnlySpan> items) - where TKey : notnull - { - int count = items.Length; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - var kvp = items[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, Span> items) - where TKey : notnull - => AddRange(dictionary, (ReadOnlySpan>)items); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, KeyValuePair[] items) - where TKey : notnull - => AddRange(dictionary, (ReadOnlySpan>)items); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableDictionary items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int shift = items._blockShift; - int mask = items._blockSizeMinus1; - var sourceBlocks = items._entries; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - ref var sourceEntry = ref sourceBlocks[i >> shift][i & mask]; - TKey key = sourceEntry.Key; - TValue value = sourceEntry.Value; - int hash = sourceEntry.HashCode; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, in Array items) - where TKey : notnull - { - int count = items.Length; - if (count == 0) - { - return; - } - - KeyValuePair[] buffer; - int lower = items.GetLowerBound(0); - - if (items is KeyValuePair[] array && lower == 0) - { - buffer = array; - } - else - { - buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool>.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new KeyValuePair[count]; - - Array.Copy(items, lower, buffer, 0, count); - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - var kvp = buffer[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - - if (!ReferenceEquals(buffer, items) && count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool>.ReturnShared(buffer, RecyclableDictionary._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, List> items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - var span = CollectionsMarshal.AsSpan(items); - - for (int i = 0; i < count; i++) - { - var kvp = span[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, ICollection items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - KeyValuePair[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool>.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new KeyValuePair[count]; - - items.CopyTo(buffer, 0); - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - var kvp = buffer[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool>.ReturnShared(buffer, RecyclableDictionary._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, ICollection> items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - KeyValuePair[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool>.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new KeyValuePair[count]; - - items.CopyTo(buffer, 0); - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - var kvp = buffer[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool>.ReturnShared(buffer, RecyclableDictionary._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableList> items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - var source = items._memoryBlock; - - for (int i = 0; i < count; i++) - { - var kvp = source[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableLongList> items) - where TKey : notnull - { - long longCount = items._longCount; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - dictionary._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int blockSize = items._blockSize; - int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); - int lastBlockLength = (int)(longCount & items._blockSizeMinus1); - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int destIndex = dictionary._count; - var blocks = items._memoryBlocks; - - for (int block = 0; block < fullBlocks; block++) - { - var source = blocks[block]; - for (int j = 0; j < blockSize; j++) - { - var kvp = source[j]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, destIndex); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = destIndex++; - } - } - - if (lastBlockLength > 0) - { - var source = blocks[fullBlocks]; - for (int j = 0; j < lastBlockLength; j++) - { - var kvp = source[j]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, destIndex); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = destIndex++; - } - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableSortedDictionary items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - TKey key = items.GetKey(i); - TValue value = items.GetValue(i); - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableSortedList items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - TKey[] keys = items._keys; - TValue[] values = items._values; - - for (int i = 0; i < count; i++) - { - TKey key = keys[i]; - TValue value = values[i]; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableQueue> items) - where TKey : notnull - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - dictionary._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int destIndex = dictionary._count; - - var chunk = items._head; - while (chunk != null) - { - int sourceIndex = chunk.Bottom; - int sourceTop = chunk.Top; - var source = chunk.Value; - - while (sourceIndex < sourceTop) - { - var kvp = source[sourceIndex++]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, destIndex); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = destIndex++; - } - - chunk = chunk.Next; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableStack> items) - where TKey : notnull - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - dictionary._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int destIndex = dictionary._count; - - var sourceChunk = items._current; - while (sourceChunk.Previous != null) - { - sourceChunk = sourceChunk.Previous; - } - - while (sourceChunk != null) - { - var source = sourceChunk.Value; - int sourceCount = sourceChunk.Index; - int sourceIndex = 0; - - while (sourceIndex < sourceCount) - { - var kvp = source[sourceIndex++]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, destIndex); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = destIndex++; - } - - sourceChunk = sourceChunk.Next; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclableLinkedList> items) - where TKey : notnull - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - dictionary._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int destIndex = dictionary._count; - - var chunk = items._head; - while (chunk != null) - { - int sourceIndex = chunk.Bottom; - int sourceTop = chunk.Top; - var source = chunk.Value; - - while (sourceIndex < sourceTop) - { - var kvp = source[sourceIndex++]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, destIndex); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = destIndex++; - } - - chunk = chunk.Next; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, RecyclablePriorityQueue> items) - where TKey : notnull - { - int count = items._size; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - var source = items._heap; - - for (int i = 0; i < count; i++) - { - var kvp = source[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, IReadOnlyList> items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int requiredCount = dictionary._count + count; - EnsureCapacity(dictionary, requiredCount); - - int bucketsLength = dictionary._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != dictionary._buckets.Length) - { - ResizeBuckets(dictionary, bucketsLength); - } - - int bucketMask = dictionary._buckets.Length - 1; - int startIndex = dictionary._count; - - for (int i = 0; i < count; i++) - { - var kvp = items[i]; - TKey key = kvp.Key; - TValue value = kvp.Value; - int hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = dictionary._buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(dictionary, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(items)); - } - - index = check.Next; - } - - ref var entry = ref GetEntry(dictionary, startIndex + i); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = dictionary._buckets[bucket]; - dictionary._buckets[bucket] = startIndex + i; - } - - dictionary._count = requiredCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableDictionary dictionary, IEnumerable> items) - where TKey : notnull - { - if (items is RecyclableDictionary recyclableDictionary) - { - AddRange(dictionary, recyclableDictionary); - } - else if (items is RecyclableList> recyclableList) - { - AddRange(dictionary, recyclableList); - } - else if (items is RecyclableLongList> recyclableLongList) - { - AddRange(dictionary, recyclableLongList); - } - else if (items is KeyValuePair[] array) - { - AddRange(dictionary, array); - } - else if (items is List> list) - { - AddRange(dictionary, list); - } - else if (items is ICollection> iCollection) - { - AddRange(dictionary, iCollection); - } - else if (items is ICollection collection) - { - AddRange(dictionary, collection); - } - else if (items is IReadOnlyList> readOnlyList) - { - AddRange(dictionary, readOnlyList); - } - else - { - foreach (var kvp in items) - { - dictionary.Add(kvp.Key, kvp.Value); - } - } - } - } -} +using System; +using System.Collections.Generic; +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class zRecyclableDictionaryAddRange + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static ref RecyclableDictionary.Entry GetEntry(RecyclableDictionary dictionary, int index) + where TKey : notnull + { + return ref dictionary._entries[index >> dictionary._blockShift][index & dictionary._blockSizeMinus1]; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnsureCapacity(RecyclableDictionary dictionary, int min) + where TKey : notnull + { + int requiredBlocks = (min + dictionary._blockSizeMinus1) >> dictionary._blockShift; + if (dictionary._entries.Length < requiredBlocks) + { + var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.Entry[]>.RentShared(requiredBlocks) + : new RecyclableDictionary.Entry[requiredBlocks][]; + + Array.Copy(dictionary._entries, newBlocks, dictionary._entries.Length); + + if (dictionary._entries.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.Entry[]>.ReturnShared(dictionary._entries, false); + } + + dictionary._entries = newBlocks; + } + + for (int i = 0; i < requiredBlocks; i++) + { + if (dictionary._entries[i] == null) + { + dictionary._entries[i] = dictionary._blockSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.Entry>.RentShared(dictionary._blockSize) + : new RecyclableDictionary.Entry[dictionary._blockSize]; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void ResizeBuckets(RecyclableDictionary dictionary, int newSize) + where TKey : notnull + { + var newBuckets = new int[newSize]; + Array.Fill(newBuckets, -1); + for (int i = 0; i < dictionary._count; i++) + { + ref var entry = ref GetEntry(dictionary, i); + int bucket = entry.HashCode & (newSize - 1); + entry.Next = newBuckets[bucket]; + newBuckets[bucket] = i; + } + + dictionary._buckets = newBuckets; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, ReadOnlySpan> items) + where TKey : notnull + { + int count = items.Length; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + var kvp = items[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, Span> items) + where TKey : notnull + => AddRange(dictionary, (ReadOnlySpan>)items); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, KeyValuePair[] items) + where TKey : notnull + => AddRange(dictionary, (ReadOnlySpan>)items); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableDictionary items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int shift = items._blockShift; + int mask = items._blockSizeMinus1; + var sourceBlocks = items._entries; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + ref var sourceEntry = ref sourceBlocks[i >> shift][i & mask]; + TKey key = sourceEntry.Key; + TValue value = sourceEntry.Value; + int hash = sourceEntry.HashCode; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, in Array items) + where TKey : notnull + { + int count = items.Length; + if (count == 0) + { + return; + } + + KeyValuePair[] buffer; + int lower = items.GetLowerBound(0); + + if (items is KeyValuePair[] array && lower == 0) + { + buffer = array; + } + else + { + buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool>.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new KeyValuePair[count]; + + Array.Copy(items, lower, buffer, 0, count); + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + var kvp = buffer[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + + if (!ReferenceEquals(buffer, items) && count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool>.ReturnShared(buffer, RecyclableDictionary._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, List> items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + var span = CollectionsMarshal.AsSpan(items); + + for (int i = 0; i < count; i++) + { + var kvp = span[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, ICollection items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + KeyValuePair[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool>.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new KeyValuePair[count]; + + items.CopyTo(buffer, 0); + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + var kvp = buffer[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool>.ReturnShared(buffer, RecyclableDictionary._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, ICollection> items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + KeyValuePair[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool>.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new KeyValuePair[count]; + + items.CopyTo(buffer, 0); + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + var kvp = buffer[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool>.ReturnShared(buffer, RecyclableDictionary._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableList> items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + var source = items._memoryBlock; + + for (int i = 0; i < count; i++) + { + var kvp = source[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableLongList> items) + where TKey : notnull + { + long longCount = items._longCount; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - dictionary._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int blockSize = items._blockSize; + int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); + int lastBlockLength = (int)(longCount & items._blockSizeMinus1); + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int destIndex = dictionary._count; + var blocks = items._memoryBlocks; + + for (int block = 0; block < fullBlocks; block++) + { + var source = blocks[block]; + for (int j = 0; j < blockSize; j++) + { + var kvp = source[j]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, destIndex); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = destIndex++; + } + } + + if (lastBlockLength > 0) + { + var source = blocks[fullBlocks]; + for (int j = 0; j < lastBlockLength; j++) + { + var kvp = source[j]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, destIndex); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = destIndex++; + } + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableSortedDictionary items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + TKey key = items.GetKey(i); + TValue value = items.GetValue(i); + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableSortedList items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + TKey[] keys = items._keys; + TValue[] values = items._values; + + for (int i = 0; i < count; i++) + { + TKey key = keys[i]; + TValue value = values[i]; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableQueue> items) + where TKey : notnull + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - dictionary._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int destIndex = dictionary._count; + + var chunk = items._head; + while (chunk != null) + { + int sourceIndex = chunk.Bottom; + int sourceTop = chunk.Top; + var source = chunk.Value; + + while (sourceIndex < sourceTop) + { + var kvp = source[sourceIndex++]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, destIndex); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = destIndex++; + } + + chunk = chunk.Next; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableStack> items) + where TKey : notnull + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - dictionary._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int destIndex = dictionary._count; + + var sourceChunk = items._current; + while (sourceChunk.Previous != null) + { + sourceChunk = sourceChunk.Previous; + } + + while (sourceChunk != null) + { + var source = sourceChunk.Value; + int sourceCount = sourceChunk.Index; + int sourceIndex = 0; + + while (sourceIndex < sourceCount) + { + var kvp = source[sourceIndex++]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, destIndex); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = destIndex++; + } + + sourceChunk = sourceChunk.Next; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclableLinkedList> items) + where TKey : notnull + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - dictionary._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int destIndex = dictionary._count; + + var chunk = items._head; + while (chunk != null) + { + int sourceIndex = chunk.Bottom; + int sourceTop = chunk.Top; + var source = chunk.Value; + + while (sourceIndex < sourceTop) + { + var kvp = source[sourceIndex++]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, destIndex); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = destIndex++; + } + + chunk = chunk.Next; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, RecyclablePriorityQueue> items) + where TKey : notnull + { + int count = items._size; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + var source = items._heap; + + for (int i = 0; i < count; i++) + { + var kvp = source[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, IReadOnlyList> items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int requiredCount = dictionary._count + count; + EnsureCapacity(dictionary, requiredCount); + + int bucketsLength = dictionary._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != dictionary._buckets.Length) + { + ResizeBuckets(dictionary, bucketsLength); + } + + int bucketMask = dictionary._buckets.Length - 1; + int startIndex = dictionary._count; + + for (int i = 0; i < count; i++) + { + var kvp = items[i]; + TKey key = kvp.Key; + TValue value = kvp.Value; + int hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = dictionary._buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(dictionary, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(items)); + } + + index = check.Next; + } + + ref var entry = ref GetEntry(dictionary, startIndex + i); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = dictionary._buckets[bucket]; + dictionary._buckets[bucket] = startIndex + i; + } + + dictionary._count = requiredCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableDictionary dictionary, IEnumerable> items) + where TKey : notnull + { + if (items is RecyclableDictionary recyclableDictionary) + { + AddRange(dictionary, recyclableDictionary); + } + else if (items is RecyclableList> recyclableList) + { + AddRange(dictionary, recyclableList); + } + else if (items is RecyclableLongList> recyclableLongList) + { + AddRange(dictionary, recyclableLongList); + } + else if (items is KeyValuePair[] array) + { + AddRange(dictionary, array); + } + else if (items is List> list) + { + AddRange(dictionary, list); + } + else if (items is ICollection> iCollection) + { + AddRange(dictionary, iCollection); + } + else if (items is ICollection collection) + { + AddRange(dictionary, collection); + } + else if (items is IReadOnlyList> readOnlyList) + { + AddRange(dictionary, readOnlyList); + } + else + { + foreach (var kvp in items) + { + dictionary.Add(kvp.Key, kvp.Value); + } + } + } + } +} diff --git a/Recyclable.Collections/RecyclableDictionary.cs b/Recyclable.Collections/RecyclableDictionary.cs index 88f5d19..00b6302 100644 --- a/Recyclable.Collections/RecyclableDictionary.cs +++ b/Recyclable.Collections/RecyclableDictionary.cs @@ -1,406 +1,406 @@ -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableDictionary : IEnumerable>, IDisposable - where TKey : notnull - { - internal static readonly bool _needsClearing = !typeof(TKey).IsValueType || !typeof(TValue).IsValueType; - - internal readonly int _blockSize; - internal readonly int _blockSizeMinus1; - internal readonly byte _blockShift; - -#nullable disable - internal Entry[][] _entries; -#nullable restore - internal int[] _buckets; - internal int _count; - internal bool _disposed; - - internal struct Entry - { - public int HashCode; - public int Next; - public TKey Key; - public TValue Value; - } - - public RecyclableDictionary(int blockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2((uint)blockSize)) - { - blockSize = (int)BitOperations.RoundUpToPowerOf2((uint)blockSize); - } - - _blockSize = blockSize; - _blockSizeMinus1 = blockSize - 1; - _blockShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)blockSize)); - - _entries = 4 >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(4) - : new Entry[4][]; - _entries[0] = blockSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(blockSize) - : new Entry[blockSize]; - _buckets = new int[4]; - Array.Fill(_buckets, -1); - } - - public int Count => _count; - - public TValue this[TKey key] - { - get - { - var index = FindIndex(key, out _); - if (index >= 0) - { - return GetEntry(index).Value; - } - - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "Key not found"); - return default!; - } - set - { - var index = FindIndex(key, out _); - if (index >= 0) - { - ref var entry = ref GetEntry(index); - entry.Value = value; - return; - } - - Add(key, value); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(TKey key, TValue value) - { - var hash = key.GetHashCode() & int.MaxValue; - if (_count >= (_buckets.Length * 3) / 4) - { - ResizeBuckets(_buckets.Length * 2); - } - - EnsureCapacity(_count + 1); - - int bucket = hash & (_buckets.Length - 1); - int index = _buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) - { - throw new ArgumentException("An element with the same key already exists.", nameof(key)); - } - - index = check.Next; - } - - int newIndex = _count++; - ref var entry = ref GetEntry(newIndex); - entry.HashCode = hash; - entry.Key = key; - entry.Value = value; - entry.Next = _buckets[bucket]; - _buckets[bucket] = newIndex; - - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool ContainsKey(TKey key) => FindIndex(key, out _) >= 0; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryGetValue(TKey key, out TValue value) - { - var index = FindIndex(key, out _); - if (index >= 0) - { - value = GetEntry(index).Value; - return true; - } - - value = default!; - return false; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Remove(TKey key) - { - if (_count == 0) - { - return false; - } - - var hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & (_buckets.Length - 1); - int prev = -1; - int index = _buckets[bucket]; - while (index >= 0) - { - ref var entry = ref GetEntry(index); - if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Key, key)) - { - if (prev < 0) - { - _buckets[bucket] = entry.Next; - } - else - { - GetEntry(prev).Next = entry.Next; - } - - int lastIndex = _count - 1; - if (index != lastIndex) - { - MoveEntry(lastIndex, index); - } - - ClearEntry(lastIndex); - _count--; - - return true; - } - - prev = index; - index = entry.Next; - } - - return false; - } - - public void Clear() - { - if (_count == 0) - { - Array.Fill(_buckets, -1); - return; - } - - int blockIndex = 0; - if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) - { - while (blockIndex < _entries.Length && _entries[blockIndex] != null) - { - RecyclableArrayPool.ReturnShared(_entries[blockIndex]!, _needsClearing); - _entries[blockIndex++] = null!; - } - } - else - { - if (_needsClearing) - { - while (blockIndex < _entries.Length && _entries[blockIndex] != null) - { - Array.Clear(_entries[blockIndex]!, 0, _entries[blockIndex]!.Length); - _entries[blockIndex++] = null!; - } - } - else - { - while (blockIndex < _entries.Length && _entries[blockIndex] != null) - { - _entries[blockIndex++] = null!; - } - } - } - - _count = 0; - Array.Fill(_buckets, -1); - } - - public TKey GetKey(int index) => GetEntry(index).Key; - - public TValue GetValue(int index) => GetEntry(index).Value; - - public Enumerator GetEnumerator() => new(this); - - IEnumerator> IEnumerable>.GetEnumerator() => new Enumerator(this); - - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - public void Dispose() - { - if (_disposed) - { - return; - } - - Clear(); - if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_entries, false); - } - - if (_buckets.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_buckets, false); - } - - _entries = Array.Empty(); - _buckets = Array.Empty(); - _disposed = true; - GC.SuppressFinalize(this); - } - - private ref Entry GetEntry(int index) - { - return ref _entries[index >> _blockShift][index & _blockSizeMinus1]; - } - - private void ClearEntry(int index) - { - ref var entry = ref GetEntry(index); - entry.HashCode = 0; - entry.Next = -1; - if (_needsClearing) - { - entry.Key = default!; - entry.Value = default!; - } - } - - private void MoveEntry(int sourceIndex, int targetIndex) - { - ref var source = ref GetEntry(sourceIndex); - ref var target = ref GetEntry(targetIndex); - target = source; - - int bucket = source.HashCode & (_buckets.Length - 1); - int cur = _buckets[bucket]; - int prev = -1; - while (cur != sourceIndex) - { - prev = cur; - cur = GetEntry(cur).Next; - } - - if (prev < 0) - { - _buckets[bucket] = targetIndex; - } - else - { - GetEntry(prev).Next = targetIndex; - } - } - - private void EnsureCapacity(int min) - { - int requiredBlocks = (min + _blockSizeMinus1) >> _blockShift; - if (_entries.Length < requiredBlocks) - { - var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(requiredBlocks) - : new Entry[requiredBlocks][]; - - Array.Copy(_entries, newBlocks, _entries.Length); - - if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_entries, false); - } - - _entries = newBlocks; - } - - for (int i = 0; i < requiredBlocks; i++) - { - if (_entries[i] == null) - { - _entries[i] = _blockSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(_blockSize) - : new Entry[_blockSize]; - } - } - } - - private void ResizeBuckets(int newSize) - { - var newBuckets = new int[newSize]; - Array.Fill(newBuckets, -1); - for (int i = 0; i < _count; i++) - { - ref var entry = ref GetEntry(i); - int bucket = entry.HashCode & (newSize - 1); - entry.Next = newBuckets[bucket]; - newBuckets[bucket] = i; - } - - _buckets = newBuckets; - } - - private int FindIndex(TKey key, out int hash) - { - if (_count == 0) - { - hash = 0; - return -1; - } - - hash = key.GetHashCode() & int.MaxValue; - int bucket = hash & (_buckets.Length - 1); - int index = _buckets[bucket]; - while (index >= 0) - { - ref var entry = ref GetEntry(index); - if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Key, key)) - { - return index; - } - - index = entry.Next; - } - - return -1; - } - - public struct Enumerator : IEnumerator> - { - private readonly RecyclableDictionary _dictionary; - private int _index; - private KeyValuePair _current; - - internal Enumerator(RecyclableDictionary dictionary) - { - _dictionary = dictionary; - _index = 0; - _current = default; - } - - public KeyValuePair Current => _current; - - object IEnumerator.Current => _current; - - public bool MoveNext() - { - if (_index >= _dictionary._count) - { - return false; - } - - var entry = _dictionary.GetEntry(_index++); - _current = new KeyValuePair(entry.Key, entry.Value); - return true; - } - - public void Reset() - { - _index = 0; - _current = default; - } - - public void Dispose() - { - } - } - - } -} +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableDictionary : IEnumerable>, IDisposable + where TKey : notnull + { + internal static readonly bool _needsClearing = !typeof(TKey).IsValueType || !typeof(TValue).IsValueType; + + internal readonly int _blockSize; + internal readonly int _blockSizeMinus1; + internal readonly byte _blockShift; + +#nullable disable + internal Entry[][] _entries; +#nullable restore + internal int[] _buckets; + internal int _count; + internal bool _disposed; + + internal struct Entry + { + public int HashCode; + public int Next; + public TKey Key; + public TValue Value; + } + + public RecyclableDictionary(int blockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2((uint)blockSize)) + { + blockSize = (int)BitOperations.RoundUpToPowerOf2((uint)blockSize); + } + + _blockSize = blockSize; + _blockSizeMinus1 = blockSize - 1; + _blockShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)blockSize)); + + _entries = 4 >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(4) + : new Entry[4][]; + _entries[0] = blockSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(blockSize) + : new Entry[blockSize]; + _buckets = new int[4]; + Array.Fill(_buckets, -1); + } + + public int Count => _count; + + public TValue this[TKey key] + { + get + { + var index = FindIndex(key, out _); + if (index >= 0) + { + return GetEntry(index).Value; + } + + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "Key not found"); + return default!; + } + set + { + var index = FindIndex(key, out _); + if (index >= 0) + { + ref var entry = ref GetEntry(index); + entry.Value = value; + return; + } + + Add(key, value); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(TKey key, TValue value) + { + var hash = key.GetHashCode() & int.MaxValue; + if (_count >= (_buckets.Length * 3) / 4) + { + ResizeBuckets(_buckets.Length * 2); + } + + EnsureCapacity(_count + 1); + + int bucket = hash & (_buckets.Length - 1); + int index = _buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Key, key)) + { + throw new ArgumentException("An element with the same key already exists.", nameof(key)); + } + + index = check.Next; + } + + int newIndex = _count++; + ref var entry = ref GetEntry(newIndex); + entry.HashCode = hash; + entry.Key = key; + entry.Value = value; + entry.Next = _buckets[bucket]; + _buckets[bucket] = newIndex; + + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool ContainsKey(TKey key) => FindIndex(key, out _) >= 0; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool TryGetValue(TKey key, out TValue value) + { + var index = FindIndex(key, out _); + if (index >= 0) + { + value = GetEntry(index).Value; + return true; + } + + value = default!; + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Remove(TKey key) + { + if (_count == 0) + { + return false; + } + + var hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & (_buckets.Length - 1); + int prev = -1; + int index = _buckets[bucket]; + while (index >= 0) + { + ref var entry = ref GetEntry(index); + if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Key, key)) + { + if (prev < 0) + { + _buckets[bucket] = entry.Next; + } + else + { + GetEntry(prev).Next = entry.Next; + } + + int lastIndex = _count - 1; + if (index != lastIndex) + { + MoveEntry(lastIndex, index); + } + + ClearEntry(lastIndex); + _count--; + + return true; + } + + prev = index; + index = entry.Next; + } + + return false; + } + + public void Clear() + { + if (_count == 0) + { + Array.Fill(_buckets, -1); + return; + } + + int blockIndex = 0; + if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) + { + while (blockIndex < _entries.Length && _entries[blockIndex] != null) + { + RecyclableArrayPool.ReturnShared(_entries[blockIndex]!, _needsClearing); + _entries[blockIndex++] = null!; + } + } + else + { + if (_needsClearing) + { + while (blockIndex < _entries.Length && _entries[blockIndex] != null) + { + Array.Clear(_entries[blockIndex]!, 0, _entries[blockIndex]!.Length); + _entries[blockIndex++] = null!; + } + } + else + { + while (blockIndex < _entries.Length && _entries[blockIndex] != null) + { + _entries[blockIndex++] = null!; + } + } + } + + _count = 0; + Array.Fill(_buckets, -1); + } + + public TKey GetKey(int index) => GetEntry(index).Key; + + public TValue GetValue(int index) => GetEntry(index).Value; + + public Enumerator GetEnumerator() => new(this); + + IEnumerator> IEnumerable>.GetEnumerator() => new Enumerator(this); + + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + public void Dispose() + { + if (_disposed) + { + return; + } + + Clear(); + if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_entries, false); + } + + if (_buckets.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_buckets, false); + } + + _entries = Array.Empty(); + _buckets = Array.Empty(); + _disposed = true; + GC.SuppressFinalize(this); + } + + private ref Entry GetEntry(int index) + { + return ref _entries[index >> _blockShift][index & _blockSizeMinus1]; + } + + private void ClearEntry(int index) + { + ref var entry = ref GetEntry(index); + entry.HashCode = 0; + entry.Next = -1; + if (_needsClearing) + { + entry.Key = default!; + entry.Value = default!; + } + } + + private void MoveEntry(int sourceIndex, int targetIndex) + { + ref var source = ref GetEntry(sourceIndex); + ref var target = ref GetEntry(targetIndex); + target = source; + + int bucket = source.HashCode & (_buckets.Length - 1); + int cur = _buckets[bucket]; + int prev = -1; + while (cur != sourceIndex) + { + prev = cur; + cur = GetEntry(cur).Next; + } + + if (prev < 0) + { + _buckets[bucket] = targetIndex; + } + else + { + GetEntry(prev).Next = targetIndex; + } + } + + private void EnsureCapacity(int min) + { + int requiredBlocks = (min + _blockSizeMinus1) >> _blockShift; + if (_entries.Length < requiredBlocks) + { + var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(requiredBlocks) + : new Entry[requiredBlocks][]; + + Array.Copy(_entries, newBlocks, _entries.Length); + + if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_entries, false); + } + + _entries = newBlocks; + } + + for (int i = 0; i < requiredBlocks; i++) + { + if (_entries[i] == null) + { + _entries[i] = _blockSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(_blockSize) + : new Entry[_blockSize]; + } + } + } + + private void ResizeBuckets(int newSize) + { + var newBuckets = new int[newSize]; + Array.Fill(newBuckets, -1); + for (int i = 0; i < _count; i++) + { + ref var entry = ref GetEntry(i); + int bucket = entry.HashCode & (newSize - 1); + entry.Next = newBuckets[bucket]; + newBuckets[bucket] = i; + } + + _buckets = newBuckets; + } + + private int FindIndex(TKey key, out int hash) + { + if (_count == 0) + { + hash = 0; + return -1; + } + + hash = key.GetHashCode() & int.MaxValue; + int bucket = hash & (_buckets.Length - 1); + int index = _buckets[bucket]; + while (index >= 0) + { + ref var entry = ref GetEntry(index); + if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Key, key)) + { + return index; + } + + index = entry.Next; + } + + return -1; + } + + public struct Enumerator : IEnumerator> + { + private readonly RecyclableDictionary _dictionary; + private int _index; + private KeyValuePair _current; + + internal Enumerator(RecyclableDictionary dictionary) + { + _dictionary = dictionary; + _index = 0; + _current = default; + } + + public KeyValuePair Current => _current; + + object IEnumerator.Current => _current; + + public bool MoveNext() + { + if (_index >= _dictionary._count) + { + return false; + } + + var entry = _dictionary.GetEntry(_index++); + _current = new KeyValuePair(entry.Key, entry.Value); + return true; + } + + public void Reset() + { + _index = 0; + _current = default; + } + + public void Dispose() + { + } + } + + } +} diff --git a/Recyclable.Collections/RecyclableHashSet.AddRange.cs b/Recyclable.Collections/RecyclableHashSet.AddRange.cs index e413bf0..3d2f017 100644 --- a/Recyclable.Collections/RecyclableHashSet.AddRange.cs +++ b/Recyclable.Collections/RecyclableHashSet.AddRange.cs @@ -1,1632 +1,1632 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class zRecyclableHashSetAddRange - { - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Action, object>? _sortedDictionaryAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - private static readonly Type? _sortedDictionaryType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); - - MethodInfo? method = typeof(zRecyclableHashSetAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableHashSet<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var setParam = Expression.Parameter(typeof(RecyclableHashSet)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, setParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, setParam, objParam).Compile(); - } - - method = typeof(zRecyclableHashSetAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableHashSet<>).MakeGenericType(elementType), _sortedDictionaryType }, - modifiers: null); - if (method != null) - { - var setParam = Expression.Parameter(typeof(RecyclableHashSet)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, setParam, Expression.Convert(objParam, _sortedDictionaryType)); - _sortedDictionaryAdder = Expression.Lambda, object>>(call, setParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableHashSetAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableHashSet<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var setParam = Expression.Parameter(typeof(RecyclableHashSet)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, setParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, setParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclableHashSet set, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(set, items); - return true; - } - - if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) - { - _sortedDictionaryAdder(set, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(set, items); - return true; - } - - return false; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static ref RecyclableHashSet.Entry GetEntry(RecyclableHashSet set, int index) - where T : notnull - { - return ref set._entries[index >> set._blockShift][index & set._blockSizeMinus1]; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void EnsureCapacity(RecyclableHashSet set, int min) - where T : notnull - { - int requiredBlocks = (min + set._blockSizeMinus1) >> set._blockShift; - if (set._entries.Length < requiredBlocks) - { - var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.Entry[]>.RentShared(requiredBlocks) - : new RecyclableHashSet.Entry[requiredBlocks][]; - - Array.Copy(set._entries, newBlocks, set._entries.Length); - - if (set._entries.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.Entry[]>.ReturnShared(set._entries, false); - } - - set._entries = newBlocks; - } - - for (int i = 0; i < requiredBlocks; i++) - { - if (set._entries[i] == null) - { - set._entries[i] = set._blockSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.Entry>.RentShared(set._blockSize) - : new RecyclableHashSet.Entry[set._blockSize]; - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void ResizeBuckets(RecyclableHashSet set, int newSize) - where T : notnull - { - int[] newBuckets = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new int[newSize]; - Array.Fill(newBuckets, -1); - - for (int i = 0; i < set._count; i++) - { - ref var entry = ref GetEntry(set, i); - int bucket = entry.HashCode & (newSize - 1); - entry.Next = newBuckets[bucket]; - newBuckets[bucket] = i; - } - - if (set._buckets.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(set._buckets, false); - } - - set._buckets = newBuckets; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, ReadOnlySpan items) - where T : notnull - { - int count = items.Length; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = items[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, Span items) - where T : notnull - { - int count = items.Length; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = items[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, T[] items) - where T : notnull - { - int count = items.Length; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = items[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, in Array items) - where T : notnull - { - int count = items.Length; - if (count == 0) - { - return; - } - - T[] buffer; - int lower = items.GetLowerBound(0); - - if (items is T[] array && lower == 0) - { - buffer = array; - } - else - { - buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - Array.Copy(items, lower, buffer, 0, count); - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = buffer[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - - if (!ReferenceEquals(buffer, items) && count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableHashSet._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, List items) - where T : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - Span span = CollectionsMarshal.AsSpan(items); - - for (int i = 0; i < count; i++) - { - T value = span[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, ICollection items) - where T : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = buffer[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableHashSet._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, ICollection items) - where T : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = buffer[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableHashSet._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableList items) - where T : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - T[] source = items._memoryBlock; - - for (int i = 0; i < count; i++) - { - T value = source[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableHashSet items) - where T : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (int i = 0; i < count; i++) - { - T value = entries[i >> shift][i & mask].Value; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableLongList items) - where T : notnull - { - long longCount = items._longCount; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - set._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); - int lastBlockLength = (int)(longCount & items._blockSizeMinus1); - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - var blocks = items._memoryBlocks; - int blockSize = items._blockSize; - - for (int block = 0; block < fullBlocks; block++) - { - var source = blocks[block]; - for (int j = 0; j < blockSize; j++) - { - T value = source[j]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - } - - if (lastBlockLength > 0) - { - var source = blocks[fullBlocks]; - for (int j = 0; j < lastBlockLength; j++) - { - T value = source[j]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableStack items) - where T : notnull - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - set._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - var sourceChunk = items._current; - while (sourceChunk.Previous != null) - { - sourceChunk = sourceChunk.Previous; - } - - while (sourceChunk != null) - { - var source = sourceChunk.Value; - int sourceCount = sourceChunk.Index; - for (int i = 0; i < sourceCount; i++) - { - T value = source[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int idx = set._buckets[bucket]; - bool exists = false; - while (idx >= 0) - { - ref var check = ref GetEntry(set, idx); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - idx = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - sourceChunk = sourceChunk.Next!; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableQueue items) - where T : notnull - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - set._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - var chunk = items._head; - while (chunk != null) - { - int idx = chunk.Bottom; - int top = chunk.Top; - var source = chunk.Value; - - while (idx < top) - { - T value = source[idx++]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int checkIndex = set._buckets[bucket]; - bool exists = false; - while (checkIndex >= 0) - { - ref var check = ref GetEntry(set, checkIndex); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - checkIndex = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - chunk = chunk.Next; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableSortedSet items) - where T : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - T[] source = items._items; - - for (int i = 0; i < count; i++) - { - T value = source[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclableLinkedList items) - where T : notnull - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - if (longCount > int.MaxValue - set._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); - } - - int count = (int)longCount; - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - var chunk = items._head; - while (chunk != null) - { - int index = chunk.Bottom; - int top = chunk.Top; - var source = chunk.Value; - - while (index < top) - { - T value = source[index++]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int checkIndex = set._buckets[bucket]; - bool exists = false; - while (checkIndex >= 0) - { - ref var check = ref GetEntry(set, checkIndex); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - checkIndex = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - chunk = chunk.Next; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, RecyclablePriorityQueue items) - where T : notnull - { - int count = items._size; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - T[] source = items._heap; - - for (int i = 0; i < count; i++) - { - T value = source[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet> set, RecyclableDictionary items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (int i = 0; i < count; i++) - { - ref var src = ref entries[i >> shift][i & mask]; - var pair = new KeyValuePair(src.Key, src.Value); - int hash = pair.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer>.Default.Equals(check.Value, pair)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = pair; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet> set, RecyclableSortedDictionary items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - var pair = new KeyValuePair(items.GetKey(i), items.GetValue(i)); - int hash = pair.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer>.Default.Equals(check.Value, pair)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = pair; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet<(TKey Key, TValue Value)> set, RecyclableSortedList items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - TKey[] keys = items._keys; - TValue[] values = items._values; - - for (int i = 0; i < count; i++) - { - var pair = (keys[i], values[i]); - int hash = pair.GetHashCode() & int.MaxValue; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer<(TKey Key, TValue Value)>.Default.Equals(check.Value, pair)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = pair; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, IReadOnlyList items) - where T : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int requiredCount = set._count + count; - EnsureCapacity(set, requiredCount); - - int bucketsLength = set._buckets.Length; - while (requiredCount >= (bucketsLength * 3) / 4) - { - bucketsLength <<= 1; - } - - if (bucketsLength != set._buckets.Length) - { - ResizeBuckets(set, bucketsLength); - } - - int bucketMask = set._buckets.Length - 1; - int insertIndex = set._count; - - for (int i = 0; i < count; i++) - { - T value = items[i]; - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - insertIndex++; - } - - set._count = insertIndex; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableHashSet set, IEnumerable items) - where T : notnull - { - if (items is RecyclableList recyclableList) - { - AddRange(set, recyclableList); - } - else if (items is RecyclableLongList recyclableLongList) - { - AddRange(set, recyclableLongList); - } - else if (items is T[] array) - { - AddRange(set, array); - } - else if (items is List list) - { - AddRange(set, list); - } - else if (items is ICollection iCollection) - { - AddRange(set, iCollection); - } - else if (items is ICollection collection) - { - AddRange(set, collection); - } - else if (items is RecyclableHashSet hashSet) - { - AddRange(set, hashSet); - } - else if (items is RecyclableStack stack) - { - AddRange(set, stack); - } - else if (items is RecyclableSortedSet sortedSet) - { - AddRange(set, sortedSet); - } - else if (items is RecyclableLinkedList linkedList) - { - AddRange(set, linkedList); - } - else if (items is RecyclablePriorityQueue priorityQueue) - { - AddRange(set, priorityQueue); - } - else if (items is RecyclableQueue queue) - { - AddRange(set, queue); - } - else if (AddRangeHelper.TryAddRange(set, items)) - { - } - else if (items is IReadOnlyList readOnlyList) - { - AddRange(set, readOnlyList); - } - else - { - foreach (T value in items) - { - int requiredCount = set._count + 1; - if (requiredCount > set._entries.Length * set._blockSize) - { - EnsureCapacity(set, requiredCount); - } - - if (set._count >= (set._buckets.Length * 3) / 4) - { - ResizeBuckets(set, set._buckets.Length << 1); - } - - int hash = value?.GetHashCode() & int.MaxValue ?? 0; - int bucketMask = set._buckets.Length - 1; - int bucket = hash & bucketMask; - - int index = set._buckets[bucket]; - bool exists = false; - while (index >= 0) - { - ref var check = ref GetEntry(set, index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) - { - exists = true; - break; - } - - index = check.Next; - } - - if (exists) - { - continue; - } - - int insertIndex = set._count++; - ref var entry = ref GetEntry(set, insertIndex); - entry.HashCode = hash; - entry.Value = value!; - entry.Next = set._buckets[bucket]; - set._buckets[bucket] = insertIndex; - } - } - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class zRecyclableHashSetAddRange + { + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Action, object>? _sortedDictionaryAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + private static readonly Type? _sortedDictionaryType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); + + MethodInfo? method = typeof(zRecyclableHashSetAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableHashSet<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var setParam = Expression.Parameter(typeof(RecyclableHashSet)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, setParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, setParam, objParam).Compile(); + } + + method = typeof(zRecyclableHashSetAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableHashSet<>).MakeGenericType(elementType), _sortedDictionaryType }, + modifiers: null); + if (method != null) + { + var setParam = Expression.Parameter(typeof(RecyclableHashSet)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, setParam, Expression.Convert(objParam, _sortedDictionaryType)); + _sortedDictionaryAdder = Expression.Lambda, object>>(call, setParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableHashSetAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableHashSet<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var setParam = Expression.Parameter(typeof(RecyclableHashSet)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, setParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, setParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclableHashSet set, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(set, items); + return true; + } + + if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) + { + _sortedDictionaryAdder(set, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(set, items); + return true; + } + + return false; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static ref RecyclableHashSet.Entry GetEntry(RecyclableHashSet set, int index) + where T : notnull + { + return ref set._entries[index >> set._blockShift][index & set._blockSizeMinus1]; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnsureCapacity(RecyclableHashSet set, int min) + where T : notnull + { + int requiredBlocks = (min + set._blockSizeMinus1) >> set._blockShift; + if (set._entries.Length < requiredBlocks) + { + var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.Entry[]>.RentShared(requiredBlocks) + : new RecyclableHashSet.Entry[requiredBlocks][]; + + Array.Copy(set._entries, newBlocks, set._entries.Length); + + if (set._entries.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.Entry[]>.ReturnShared(set._entries, false); + } + + set._entries = newBlocks; + } + + for (int i = 0; i < requiredBlocks; i++) + { + if (set._entries[i] == null) + { + set._entries[i] = set._blockSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.Entry>.RentShared(set._blockSize) + : new RecyclableHashSet.Entry[set._blockSize]; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void ResizeBuckets(RecyclableHashSet set, int newSize) + where T : notnull + { + int[] newBuckets = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new int[newSize]; + Array.Fill(newBuckets, -1); + + for (int i = 0; i < set._count; i++) + { + ref var entry = ref GetEntry(set, i); + int bucket = entry.HashCode & (newSize - 1); + entry.Next = newBuckets[bucket]; + newBuckets[bucket] = i; + } + + if (set._buckets.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(set._buckets, false); + } + + set._buckets = newBuckets; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, ReadOnlySpan items) + where T : notnull + { + int count = items.Length; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = items[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, Span items) + where T : notnull + { + int count = items.Length; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = items[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, T[] items) + where T : notnull + { + int count = items.Length; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = items[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, in Array items) + where T : notnull + { + int count = items.Length; + if (count == 0) + { + return; + } + + T[] buffer; + int lower = items.GetLowerBound(0); + + if (items is T[] array && lower == 0) + { + buffer = array; + } + else + { + buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + Array.Copy(items, lower, buffer, 0, count); + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = buffer[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + + if (!ReferenceEquals(buffer, items) && count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableHashSet._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, List items) + where T : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + Span span = CollectionsMarshal.AsSpan(items); + + for (int i = 0; i < count; i++) + { + T value = span[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, ICollection items) + where T : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = buffer[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableHashSet._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, ICollection items) + where T : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = buffer[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableHashSet._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableList items) + where T : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + T[] source = items._memoryBlock; + + for (int i = 0; i < count; i++) + { + T value = source[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableHashSet items) + where T : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (int i = 0; i < count; i++) + { + T value = entries[i >> shift][i & mask].Value; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableLongList items) + where T : notnull + { + long longCount = items._longCount; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - set._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); + int lastBlockLength = (int)(longCount & items._blockSizeMinus1); + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + var blocks = items._memoryBlocks; + int blockSize = items._blockSize; + + for (int block = 0; block < fullBlocks; block++) + { + var source = blocks[block]; + for (int j = 0; j < blockSize; j++) + { + T value = source[j]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + } + + if (lastBlockLength > 0) + { + var source = blocks[fullBlocks]; + for (int j = 0; j < lastBlockLength; j++) + { + T value = source[j]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableStack items) + where T : notnull + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - set._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + var sourceChunk = items._current; + while (sourceChunk.Previous != null) + { + sourceChunk = sourceChunk.Previous; + } + + while (sourceChunk != null) + { + var source = sourceChunk.Value; + int sourceCount = sourceChunk.Index; + for (int i = 0; i < sourceCount; i++) + { + T value = source[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int idx = set._buckets[bucket]; + bool exists = false; + while (idx >= 0) + { + ref var check = ref GetEntry(set, idx); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + idx = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + sourceChunk = sourceChunk.Next!; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableQueue items) + where T : notnull + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - set._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + var chunk = items._head; + while (chunk != null) + { + int idx = chunk.Bottom; + int top = chunk.Top; + var source = chunk.Value; + + while (idx < top) + { + T value = source[idx++]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int checkIndex = set._buckets[bucket]; + bool exists = false; + while (checkIndex >= 0) + { + ref var check = ref GetEntry(set, checkIndex); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + checkIndex = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + chunk = chunk.Next; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableSortedSet items) + where T : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + T[] source = items._items; + + for (int i = 0; i < count; i++) + { + T value = source[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclableLinkedList items) + where T : notnull + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + if (longCount > int.MaxValue - set._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items exceeds {int.MaxValue}"); + } + + int count = (int)longCount; + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + var chunk = items._head; + while (chunk != null) + { + int index = chunk.Bottom; + int top = chunk.Top; + var source = chunk.Value; + + while (index < top) + { + T value = source[index++]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int checkIndex = set._buckets[bucket]; + bool exists = false; + while (checkIndex >= 0) + { + ref var check = ref GetEntry(set, checkIndex); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + checkIndex = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + chunk = chunk.Next; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, RecyclablePriorityQueue items) + where T : notnull + { + int count = items._size; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + T[] source = items._heap; + + for (int i = 0; i < count; i++) + { + T value = source[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet> set, RecyclableDictionary items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (int i = 0; i < count; i++) + { + ref var src = ref entries[i >> shift][i & mask]; + var pair = new KeyValuePair(src.Key, src.Value); + int hash = pair.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer>.Default.Equals(check.Value, pair)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = pair; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet> set, RecyclableSortedDictionary items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + var pair = new KeyValuePair(items.GetKey(i), items.GetValue(i)); + int hash = pair.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer>.Default.Equals(check.Value, pair)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = pair; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet<(TKey Key, TValue Value)> set, RecyclableSortedList items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + TKey[] keys = items._keys; + TValue[] values = items._values; + + for (int i = 0; i < count; i++) + { + var pair = (keys[i], values[i]); + int hash = pair.GetHashCode() & int.MaxValue; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer<(TKey Key, TValue Value)>.Default.Equals(check.Value, pair)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = pair; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, IReadOnlyList items) + where T : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int requiredCount = set._count + count; + EnsureCapacity(set, requiredCount); + + int bucketsLength = set._buckets.Length; + while (requiredCount >= (bucketsLength * 3) / 4) + { + bucketsLength <<= 1; + } + + if (bucketsLength != set._buckets.Length) + { + ResizeBuckets(set, bucketsLength); + } + + int bucketMask = set._buckets.Length - 1; + int insertIndex = set._count; + + for (int i = 0; i < count; i++) + { + T value = items[i]; + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + insertIndex++; + } + + set._count = insertIndex; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableHashSet set, IEnumerable items) + where T : notnull + { + if (items is RecyclableList recyclableList) + { + AddRange(set, recyclableList); + } + else if (items is RecyclableLongList recyclableLongList) + { + AddRange(set, recyclableLongList); + } + else if (items is T[] array) + { + AddRange(set, array); + } + else if (items is List list) + { + AddRange(set, list); + } + else if (items is ICollection iCollection) + { + AddRange(set, iCollection); + } + else if (items is ICollection collection) + { + AddRange(set, collection); + } + else if (items is RecyclableHashSet hashSet) + { + AddRange(set, hashSet); + } + else if (items is RecyclableStack stack) + { + AddRange(set, stack); + } + else if (items is RecyclableSortedSet sortedSet) + { + AddRange(set, sortedSet); + } + else if (items is RecyclableLinkedList linkedList) + { + AddRange(set, linkedList); + } + else if (items is RecyclablePriorityQueue priorityQueue) + { + AddRange(set, priorityQueue); + } + else if (items is RecyclableQueue queue) + { + AddRange(set, queue); + } + else if (AddRangeHelper.TryAddRange(set, items)) + { + } + else if (items is IReadOnlyList readOnlyList) + { + AddRange(set, readOnlyList); + } + else + { + foreach (T value in items) + { + int requiredCount = set._count + 1; + if (requiredCount > set._entries.Length * set._blockSize) + { + EnsureCapacity(set, requiredCount); + } + + if (set._count >= (set._buckets.Length * 3) / 4) + { + ResizeBuckets(set, set._buckets.Length << 1); + } + + int hash = value?.GetHashCode() & int.MaxValue ?? 0; + int bucketMask = set._buckets.Length - 1; + int bucket = hash & bucketMask; + + int index = set._buckets[bucket]; + bool exists = false; + while (index >= 0) + { + ref var check = ref GetEntry(set, index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, value)) + { + exists = true; + break; + } + + index = check.Next; + } + + if (exists) + { + continue; + } + + int insertIndex = set._count++; + ref var entry = ref GetEntry(set, insertIndex); + entry.HashCode = hash; + entry.Value = value!; + entry.Next = set._buckets[bucket]; + set._buckets[bucket] = insertIndex; + } + } + } + } +} diff --git a/Recyclable.Collections/RecyclableHashSet.cs b/Recyclable.Collections/RecyclableHashSet.cs index 2c532d0..aae4bba 100644 --- a/Recyclable.Collections/RecyclableHashSet.cs +++ b/Recyclable.Collections/RecyclableHashSet.cs @@ -1,362 +1,362 @@ -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableHashSet : IEnumerable, IDisposable - where T : notnull - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - internal readonly int _blockSize; - internal readonly int _blockSizeMinus1; - internal readonly byte _blockShift; - -#nullable disable - internal Entry[][] _entries; -#nullable restore - internal int[] _buckets; - internal int _count; - internal bool _disposed; - - internal struct Entry - { - public int HashCode; - public int Next; - public T Value; - } - - public RecyclableHashSet(int blockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2((uint)blockSize)) - { - blockSize = (int)BitOperations.RoundUpToPowerOf2((uint)blockSize); - } - - _blockSize = blockSize; - _blockSizeMinus1 = blockSize - 1; - _blockShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)blockSize)); - - _entries = 4 >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(4) - : new Entry[4][]; - _entries[0] = blockSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(blockSize) - : new Entry[blockSize]; - _buckets = new int[4]; - Array.Fill(_buckets, -1); - } - - public int Count => _count; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Add(T item) - { - var hash = item.GetHashCode() & int.MaxValue; - if (_count >= (_buckets.Length * 3) / 4) - { - ResizeBuckets(_buckets.Length * 2); - } - - EnsureCapacity(_count + 1); - - int bucket = hash & (_buckets.Length - 1); - int index = _buckets[bucket]; - while (index >= 0) - { - ref var check = ref GetEntry(index); - if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, item)) - { - return false; - } - - index = check.Next; - } - - int newIndex = _count++; - ref var entry = ref GetEntry(newIndex); - entry.HashCode = hash; - entry.Value = item; - entry.Next = _buckets[bucket]; - _buckets[bucket] = newIndex; - - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Contains(T item) => FindIndex(item, out _) >= 0; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Remove(T item) - { - if (_count == 0) - { - return false; - } - - var hash = item.GetHashCode() & int.MaxValue; - int bucket = hash & (_buckets.Length - 1); - int prev = -1; - int index = _buckets[bucket]; - while (index >= 0) - { - ref var entry = ref GetEntry(index); - if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Value, item)) - { - if (prev < 0) - { - _buckets[bucket] = entry.Next; - } - else - { - GetEntry(prev).Next = entry.Next; - } - - int lastIndex = _count - 1; - if (index != lastIndex) - { - MoveEntry(lastIndex, index); - } - - ClearEntry(lastIndex); - _count--; - - return true; - } - - prev = index; - index = entry.Next; - } - - return false; - } - - public void Clear() - { - if (_count == 0) - { - Array.Fill(_buckets, -1); - return; - } - - int blockIndex = 0; - if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) - { - while (blockIndex < _entries.Length && _entries[blockIndex] != null) - { - RecyclableArrayPool.ReturnShared(_entries[blockIndex]!, _needsClearing); - _entries[blockIndex++] = null!; - } - } - else - { - if (_needsClearing) - { - while (blockIndex < _entries.Length && _entries[blockIndex] != null) - { - Array.Clear(_entries[blockIndex]!, 0, _entries[blockIndex]!.Length); - _entries[blockIndex++] = null!; - } - } - else - { - while (blockIndex < _entries.Length && _entries[blockIndex] != null) - { - _entries[blockIndex++] = null!; - } - } - } - - _count = 0; - Array.Fill(_buckets, -1); - } - - public Enumerator GetEnumerator() => new(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - public void Dispose() - { - if (_disposed) - { - return; - } - - Clear(); - if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_entries, false); - } - - if (_buckets.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_buckets, false); - } - - _entries = Array.Empty(); - _buckets = Array.Empty(); - _disposed = true; - GC.SuppressFinalize(this); - } - - private ref Entry GetEntry(int index) - { - return ref _entries[index >> _blockShift][index & _blockSizeMinus1]; - } - - private void ClearEntry(int index) - { - ref var entry = ref GetEntry(index); - entry.HashCode = 0; - entry.Next = -1; - if (_needsClearing) - { - entry.Value = default!; - } - } - - private void MoveEntry(int sourceIndex, int targetIndex) - { - ref var source = ref GetEntry(sourceIndex); - ref var target = ref GetEntry(targetIndex); - target = source; - - int bucket = source.HashCode & (_buckets.Length - 1); - int cur = _buckets[bucket]; - int prev = -1; - while (cur != sourceIndex) - { - prev = cur; - cur = GetEntry(cur).Next; - } - - if (prev < 0) - { - _buckets[bucket] = targetIndex; - } - else - { - GetEntry(prev).Next = targetIndex; - } - } - - private void EnsureCapacity(int min) - { - int requiredBlocks = (min + _blockSizeMinus1) >> _blockShift; - if (_entries.Length < requiredBlocks) - { - var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(requiredBlocks) - : new Entry[requiredBlocks][]; - - Array.Copy(_entries, newBlocks, _entries.Length); - - if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_entries, false); - } - - _entries = newBlocks; - } - - for (int i = 0; i < requiredBlocks; i++) - { - if (_entries[i] == null) - { - _entries[i] = _blockSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(_blockSize) - : new Entry[_blockSize]; - } - } - } - - private void ResizeBuckets(int newSize) - { - int[] newBuckets = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new int[newSize]; - Array.Fill(newBuckets, -1); - for (int i = 0; i < _count; i++) - { - ref var entry = ref GetEntry(i); - int bucket = entry.HashCode & (newSize - 1); - entry.Next = newBuckets[bucket]; - newBuckets[bucket] = i; - } - - if (_buckets.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_buckets, false); - } - - _buckets = newBuckets; - } - - private int FindIndex(T item, out int hash) - { - if (_count == 0) - { - hash = 0; - return -1; - } - - hash = item.GetHashCode() & int.MaxValue; - int bucket = hash & (_buckets.Length - 1); - int index = _buckets[bucket]; - while (index >= 0) - { - ref var entry = ref GetEntry(index); - if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Value, item)) - { - return index; - } - - index = entry.Next; - } - - return -1; - } - - public struct Enumerator : IEnumerator - { - private readonly RecyclableHashSet _set; - private int _index; - private T? _current; - - internal Enumerator(RecyclableHashSet set) - { - _set = set; - _index = 0; - _current = default; - } - - public T Current => _current!; - - object IEnumerator.Current => _current!; - - public bool MoveNext() - { - if (_index >= _set._count) - { - return false; - } - - _current = _set.GetEntry(_index++).Value; - return true; - } - - public void Reset() - { - _index = 0; - _current = default; - } - - public void Dispose() - { - } - } - } -} +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableHashSet : IEnumerable, IDisposable + where T : notnull + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + internal readonly int _blockSize; + internal readonly int _blockSizeMinus1; + internal readonly byte _blockShift; + +#nullable disable + internal Entry[][] _entries; +#nullable restore + internal int[] _buckets; + internal int _count; + internal bool _disposed; + + internal struct Entry + { + public int HashCode; + public int Next; + public T Value; + } + + public RecyclableHashSet(int blockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2((uint)blockSize)) + { + blockSize = (int)BitOperations.RoundUpToPowerOf2((uint)blockSize); + } + + _blockSize = blockSize; + _blockSizeMinus1 = blockSize - 1; + _blockShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)blockSize)); + + _entries = 4 >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(4) + : new Entry[4][]; + _entries[0] = blockSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(blockSize) + : new Entry[blockSize]; + _buckets = new int[4]; + Array.Fill(_buckets, -1); + } + + public int Count => _count; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Add(T item) + { + var hash = item.GetHashCode() & int.MaxValue; + if (_count >= (_buckets.Length * 3) / 4) + { + ResizeBuckets(_buckets.Length * 2); + } + + EnsureCapacity(_count + 1); + + int bucket = hash & (_buckets.Length - 1); + int index = _buckets[bucket]; + while (index >= 0) + { + ref var check = ref GetEntry(index); + if (check.HashCode == hash && EqualityComparer.Default.Equals(check.Value, item)) + { + return false; + } + + index = check.Next; + } + + int newIndex = _count++; + ref var entry = ref GetEntry(newIndex); + entry.HashCode = hash; + entry.Value = item; + entry.Next = _buckets[bucket]; + _buckets[bucket] = newIndex; + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(T item) => FindIndex(item, out _) >= 0; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Remove(T item) + { + if (_count == 0) + { + return false; + } + + var hash = item.GetHashCode() & int.MaxValue; + int bucket = hash & (_buckets.Length - 1); + int prev = -1; + int index = _buckets[bucket]; + while (index >= 0) + { + ref var entry = ref GetEntry(index); + if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Value, item)) + { + if (prev < 0) + { + _buckets[bucket] = entry.Next; + } + else + { + GetEntry(prev).Next = entry.Next; + } + + int lastIndex = _count - 1; + if (index != lastIndex) + { + MoveEntry(lastIndex, index); + } + + ClearEntry(lastIndex); + _count--; + + return true; + } + + prev = index; + index = entry.Next; + } + + return false; + } + + public void Clear() + { + if (_count == 0) + { + Array.Fill(_buckets, -1); + return; + } + + int blockIndex = 0; + if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) + { + while (blockIndex < _entries.Length && _entries[blockIndex] != null) + { + RecyclableArrayPool.ReturnShared(_entries[blockIndex]!, _needsClearing); + _entries[blockIndex++] = null!; + } + } + else + { + if (_needsClearing) + { + while (blockIndex < _entries.Length && _entries[blockIndex] != null) + { + Array.Clear(_entries[blockIndex]!, 0, _entries[blockIndex]!.Length); + _entries[blockIndex++] = null!; + } + } + else + { + while (blockIndex < _entries.Length && _entries[blockIndex] != null) + { + _entries[blockIndex++] = null!; + } + } + } + + _count = 0; + Array.Fill(_buckets, -1); + } + + public Enumerator GetEnumerator() => new(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + public void Dispose() + { + if (_disposed) + { + return; + } + + Clear(); + if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_entries, false); + } + + if (_buckets.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_buckets, false); + } + + _entries = Array.Empty(); + _buckets = Array.Empty(); + _disposed = true; + GC.SuppressFinalize(this); + } + + private ref Entry GetEntry(int index) + { + return ref _entries[index >> _blockShift][index & _blockSizeMinus1]; + } + + private void ClearEntry(int index) + { + ref var entry = ref GetEntry(index); + entry.HashCode = 0; + entry.Next = -1; + if (_needsClearing) + { + entry.Value = default!; + } + } + + private void MoveEntry(int sourceIndex, int targetIndex) + { + ref var source = ref GetEntry(sourceIndex); + ref var target = ref GetEntry(targetIndex); + target = source; + + int bucket = source.HashCode & (_buckets.Length - 1); + int cur = _buckets[bucket]; + int prev = -1; + while (cur != sourceIndex) + { + prev = cur; + cur = GetEntry(cur).Next; + } + + if (prev < 0) + { + _buckets[bucket] = targetIndex; + } + else + { + GetEntry(prev).Next = targetIndex; + } + } + + private void EnsureCapacity(int min) + { + int requiredBlocks = (min + _blockSizeMinus1) >> _blockShift; + if (_entries.Length < requiredBlocks) + { + var newBlocks = requiredBlocks >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(requiredBlocks) + : new Entry[requiredBlocks][]; + + Array.Copy(_entries, newBlocks, _entries.Length); + + if (_entries.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_entries, false); + } + + _entries = newBlocks; + } + + for (int i = 0; i < requiredBlocks; i++) + { + if (_entries[i] == null) + { + _entries[i] = _blockSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(_blockSize) + : new Entry[_blockSize]; + } + } + } + + private void ResizeBuckets(int newSize) + { + int[] newBuckets = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new int[newSize]; + Array.Fill(newBuckets, -1); + for (int i = 0; i < _count; i++) + { + ref var entry = ref GetEntry(i); + int bucket = entry.HashCode & (newSize - 1); + entry.Next = newBuckets[bucket]; + newBuckets[bucket] = i; + } + + if (_buckets.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_buckets, false); + } + + _buckets = newBuckets; + } + + private int FindIndex(T item, out int hash) + { + if (_count == 0) + { + hash = 0; + return -1; + } + + hash = item.GetHashCode() & int.MaxValue; + int bucket = hash & (_buckets.Length - 1); + int index = _buckets[bucket]; + while (index >= 0) + { + ref var entry = ref GetEntry(index); + if (entry.HashCode == hash && EqualityComparer.Default.Equals(entry.Value, item)) + { + return index; + } + + index = entry.Next; + } + + return -1; + } + + public struct Enumerator : IEnumerator + { + private readonly RecyclableHashSet _set; + private int _index; + private T? _current; + + internal Enumerator(RecyclableHashSet set) + { + _set = set; + _index = 0; + _current = default; + } + + public T Current => _current!; + + object IEnumerator.Current => _current!; + + public bool MoveNext() + { + if (_index >= _set._count) + { + return false; + } + + _current = _set.GetEntry(_index++).Value; + return true; + } + + public void Reset() + { + _index = 0; + _current = default; + } + + public void Dispose() + { + } + } + } +} diff --git a/Recyclable.Collections/RecyclableLinkedList.AddRange.cs b/Recyclable.Collections/RecyclableLinkedList.AddRange.cs index 384bf49..ba27fad 100644 --- a/Recyclable.Collections/RecyclableLinkedList.AddRange.cs +++ b/Recyclable.Collections/RecyclableLinkedList.AddRange.cs @@ -1,1146 +1,1146 @@ -using System.Collections; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class zRecyclableLinkedListAddRange - { - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Action, object>? _sortedDictionaryAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - private static readonly Type? _sortedDictionaryType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); - - MethodInfo? method = typeof(zRecyclableLinkedListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableLinkedList<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableLinkedList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - - method = typeof(zRecyclableLinkedListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableLinkedList<>).MakeGenericType(elementType), _sortedDictionaryType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableLinkedList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedDictionaryType)); - _sortedDictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableLinkedListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableLinkedList<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableLinkedList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclableLinkedList list, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(list, items); - return true; - } - - if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) - { - _sortedDictionaryAdder(list, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(list, items); - return true; - } - - return false; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, ReadOnlySpan items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, Span items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, T[] items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(items, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, in Array items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - int lower = items.GetLowerBound(0); - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(items, lower + copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, List items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - Span source = CollectionsMarshal.AsSpan(items); - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - source.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(buffer, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableLinkedList._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(buffer, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableLinkedList._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, IReadOnlyList items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(list, list._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - for (int i = 0; i < count; i++) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - chunk.Value[index++] = items[i]; - } - - chunk.Top = index; - list._count += count; - } - - internal static IEnumerator AddRange(this RecyclableLinkedList list, IEnumerable source) - { - IEnumerator enumerator = source.GetEnumerator(); - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - while (enumerator.MoveNext()) - { - if (index == chunkLength) - { - chunk.Top = index; - if (chunk.Next == null) - { - Grow(list); - chunk = list._tail; - } - else - { - chunk = chunk.Next; - } - - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - chunk.Value[index++] = (T)enumerator.Current!; - list._count++; - } - - chunk.Top = index; - return enumerator; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, IEnumerable items) - { - if (items is RecyclableList recyclableList) - { - AddRange(list, recyclableList); - } - else if (items is RecyclableLongList recyclableLongList) - { - AddRange(list, recyclableLongList); - } - else if (items is T[] array) - { - AddRange(list, array); - } - else if (items is List listSource) - { - AddRange(list, listSource); - } - else if (items is ICollection iCollection) - { - AddRange(list, iCollection); - } - else if (items is ICollection collection) - { - AddRange(list, collection); - } - else if (items is RecyclableHashSet hashSet) - { - AddRange(list, hashSet); - } - else if (items is RecyclableStack stack) - { - AddRange(list, stack); - } - else if (items is RecyclableSortedSet sortedSet) - { - AddRange(list, sortedSet); - } - else if (items is RecyclableLinkedList linkedList) - { - AddRange(list, linkedList); - } - else if (items is RecyclablePriorityQueue priorityQueue) - { - AddRange(list, priorityQueue); - } - else if (items is RecyclableQueue queue) - { - AddRange(list, queue); - } - else if (AddRangeHelper.TryAddRange(list, items)) - { - } - else if (items is IReadOnlyList readOnlyList) - { - AddRange(list, readOnlyList); - } - else - { - using IEnumerator enumerator = items.GetEnumerator(); - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - while (enumerator.MoveNext()) - { - if (index == chunkLength) - { - chunk.Top = index; - if (chunk.Next == null) - { - Grow(list); - chunk = list._tail; - } - else - { - chunk = chunk.Next; - } - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - chunk.Value[index++] = enumerator.Current; - list._count++; - } - - chunk.Top = index; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableList items) - { - int count = items._count; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - int chunkLength = chunk.Value.Length; - int copied = 0; - T[] source = items._memoryBlock; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(source, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableLongList items) - { - long longCount = items._longCount; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + longCount); - - int blockSize = items._blockSize; - int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); - int lastBlockLength = (int)(longCount & items._blockSizeMinus1); - int chunkLength = chunk.Value.Length; - - for (int block = 0; block < fullBlocks; block++) - { - T[] source = items._memoryBlocks[block]; - int sourceIndex = 0; - while (sourceIndex < blockSize) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, blockSize - sourceIndex); - Array.Copy(source, sourceIndex, chunk.Value, index, toCopy); - sourceIndex += toCopy; - index += toCopy; - } - } - - if (lastBlockLength > 0) - { - T[] source = items._memoryBlocks[fullBlocks]; - int sourceIndex = 0; - while (sourceIndex < lastBlockLength) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, lastBlockLength - sourceIndex); - Array.Copy(source, sourceIndex, chunk.Value, index, toCopy); - sourceIndex += toCopy; - index += toCopy; - } - } - - chunk.Top = index; - list._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableHashSet items) - { - int count = items._count; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = entries[(copied + i) >> shift][(copied + i) & mask].Value; - } - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableStack items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk destChunk = list._tail; - int destIndex = destChunk.Top; - int destLength = destChunk.Value.Length; - - EnsureCapacity(list, list._count + longCount); - - RecyclableArrayPoolChunk sourceChunk = items._current; - while (sourceChunk.Previous != null) - { - sourceChunk = sourceChunk.Previous; - } - - while (sourceChunk != null) - { - T[] source = sourceChunk.Value; - int sourceCount = sourceChunk.Index; - int sourceIndex = 0; - - while (sourceIndex < sourceCount) - { - if (destIndex == destLength) - { - destChunk.Top = destIndex; - destChunk = destChunk.Next!; - destIndex = destChunk.Top; - destLength = destChunk.Value.Length; - } - - int toCopy = Math.Min(destLength - destIndex, sourceCount - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - } - - sourceChunk = sourceChunk.Next!; - } - - destChunk.Top = destIndex; - list._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableSortedSet items) - { - int count = items._count; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - T[] source = items._items; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(source, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableLinkedList items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk destChunk = list._tail; - int destIndex = destChunk.Top; - int destLength = destChunk.Value.Length; - - EnsureCapacity(list, list._count + longCount); - - var sourceChunk = items._head; - while (sourceChunk != null) - { - int sourceIndex = sourceChunk.Bottom; - int sourceTop = sourceChunk.Top; - T[] source = sourceChunk.Value; - - while (sourceIndex < sourceTop) - { - if (destIndex == destLength) - { - destChunk.Top = destIndex; - destChunk = destChunk.Next!; - destIndex = destChunk.Top; - destLength = destChunk.Value.Length; - } - - int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - } - - sourceChunk = sourceChunk.Next; - } - - destChunk.Top = destIndex; - list._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclablePriorityQueue items) - { - int count = items._size; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - T[] source = items._heap; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(source, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList list, RecyclableQueue items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk destChunk = list._tail; - int destIndex = destChunk.Top; - int destLength = destChunk.Value.Length; - - EnsureCapacity(list, list._count + longCount); - - var sourceChunk = items._head; - while (sourceChunk != null) - { - int sourceIndex = sourceChunk.Bottom; - int sourceTop = sourceChunk.Top; - T[] source = sourceChunk.Value; - - while (sourceIndex < sourceTop) - { - if (destIndex == destLength) - { - destChunk.Top = destIndex; - destChunk = destChunk.Next!; - destIndex = destChunk.Top; - destLength = destChunk.Value.Length; - } - - int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - } - - sourceChunk = sourceChunk.Next; - } - - destChunk.Top = destIndex; - list._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList> list, RecyclableDictionary items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk> chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - ref var entry = ref entries[(local + i) >> shift][(local + i) & mask]; - destination[index + i] = new KeyValuePair(entry.Key, entry.Value); - } - - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList> list, RecyclableSortedDictionary items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk> chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = new KeyValuePair(items.GetKey(local + i), items.GetValue(local + i)); - } - - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLinkedList<(TKey Key, TValue Value)> list, RecyclableSortedList items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk<(TKey Key, TValue Value)> chunk = list._tail; - int index = chunk.Top; - - EnsureCapacity(list, list._count + count); - - TKey[] keys = items._keys; - TValue[] values = items._values; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - chunk = chunk.Next!; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = (keys[local + i], values[local + i]); - } - - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - list._count += count; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Grow(RecyclableLinkedList list) - { - int newSize; - if (list._capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - long doubled = list._capacity << 1; - newSize = (int)Math.Min(doubled - list._capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < newSize) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableLinkedList._needsClearing); - } - - newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - } - - newChunk.Top = 0; - newChunk.Bottom = 0; - newChunk.Previous = list._tail; - newChunk.Next = null; - list._tail.Next = newChunk; - list._tail = newChunk; - list._capacity += newSize; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Grow(RecyclableLinkedList list, long additionalCapacity) - { - int newSize = additionalCapacity >= RecyclableDefaults.MaxPooledBlockSize - ? RecyclableDefaults.MaxPooledBlockSize - : (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)additionalCapacity), RecyclableDefaults.MaxPooledBlockSize); - - var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < newSize) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableLinkedList._needsClearing); - } - - newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - } - - newChunk.Top = 0; - newChunk.Bottom = 0; - newChunk.Previous = list._tail; - newChunk.Next = null; - list._tail.Next = newChunk; - list._tail = newChunk; - list._capacity += newSize; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void EnsureCapacity(RecyclableLinkedList list, long requiredCapacity) - { - if (requiredCapacity <= list._capacity) - { - return; - } - - long needed = requiredCapacity - list._capacity; - - do - { - int size = needed >= RecyclableDefaults.MaxPooledBlockSize - ? RecyclableDefaults.MaxPooledBlockSize - : (int)BitOperations.RoundUpToPowerOf2((uint)needed); - - var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < size) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableLinkedList._needsClearing); - } - - newChunk.Value = size >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(size) - : new T[size]; - } - - newChunk.Top = 0; - newChunk.Bottom = 0; - newChunk.Previous = list._tail; - newChunk.Next = null; - list._tail.Next = newChunk; - list._tail = newChunk; - list._capacity += size; - - needed -= size; - } - while (needed > 0); - } - } -} +using System.Collections; +using System.Linq.Expressions; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class zRecyclableLinkedListAddRange + { + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Action, object>? _sortedDictionaryAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + private static readonly Type? _sortedDictionaryType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); + + MethodInfo? method = typeof(zRecyclableLinkedListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableLinkedList<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableLinkedList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + + method = typeof(zRecyclableLinkedListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableLinkedList<>).MakeGenericType(elementType), _sortedDictionaryType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableLinkedList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedDictionaryType)); + _sortedDictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableLinkedListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableLinkedList<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableLinkedList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclableLinkedList list, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(list, items); + return true; + } + + if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) + { + _sortedDictionaryAdder(list, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(list, items); + return true; + } + + return false; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, ReadOnlySpan items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, Span items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, T[] items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(items, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, in Array items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + int lower = items.GetLowerBound(0); + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(items, lower + copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, List items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + Span source = CollectionsMarshal.AsSpan(items); + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + source.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(buffer, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableLinkedList._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(buffer, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableLinkedList._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, IReadOnlyList items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(list, list._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + for (int i = 0; i < count; i++) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + chunk.Value[index++] = items[i]; + } + + chunk.Top = index; + list._count += count; + } + + internal static IEnumerator AddRange(this RecyclableLinkedList list, IEnumerable source) + { + IEnumerator enumerator = source.GetEnumerator(); + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + while (enumerator.MoveNext()) + { + if (index == chunkLength) + { + chunk.Top = index; + if (chunk.Next == null) + { + Grow(list); + chunk = list._tail; + } + else + { + chunk = chunk.Next; + } + + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + chunk.Value[index++] = (T)enumerator.Current!; + list._count++; + } + + chunk.Top = index; + return enumerator; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, IEnumerable items) + { + if (items is RecyclableList recyclableList) + { + AddRange(list, recyclableList); + } + else if (items is RecyclableLongList recyclableLongList) + { + AddRange(list, recyclableLongList); + } + else if (items is T[] array) + { + AddRange(list, array); + } + else if (items is List listSource) + { + AddRange(list, listSource); + } + else if (items is ICollection iCollection) + { + AddRange(list, iCollection); + } + else if (items is ICollection collection) + { + AddRange(list, collection); + } + else if (items is RecyclableHashSet hashSet) + { + AddRange(list, hashSet); + } + else if (items is RecyclableStack stack) + { + AddRange(list, stack); + } + else if (items is RecyclableSortedSet sortedSet) + { + AddRange(list, sortedSet); + } + else if (items is RecyclableLinkedList linkedList) + { + AddRange(list, linkedList); + } + else if (items is RecyclablePriorityQueue priorityQueue) + { + AddRange(list, priorityQueue); + } + else if (items is RecyclableQueue queue) + { + AddRange(list, queue); + } + else if (AddRangeHelper.TryAddRange(list, items)) + { + } + else if (items is IReadOnlyList readOnlyList) + { + AddRange(list, readOnlyList); + } + else + { + using IEnumerator enumerator = items.GetEnumerator(); + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + while (enumerator.MoveNext()) + { + if (index == chunkLength) + { + chunk.Top = index; + if (chunk.Next == null) + { + Grow(list); + chunk = list._tail; + } + else + { + chunk = chunk.Next; + } + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + chunk.Value[index++] = enumerator.Current; + list._count++; + } + + chunk.Top = index; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableList items) + { + int count = items._count; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + int chunkLength = chunk.Value.Length; + int copied = 0; + T[] source = items._memoryBlock; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(source, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableLongList items) + { + long longCount = items._longCount; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + longCount); + + int blockSize = items._blockSize; + int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); + int lastBlockLength = (int)(longCount & items._blockSizeMinus1); + int chunkLength = chunk.Value.Length; + + for (int block = 0; block < fullBlocks; block++) + { + T[] source = items._memoryBlocks[block]; + int sourceIndex = 0; + while (sourceIndex < blockSize) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, blockSize - sourceIndex); + Array.Copy(source, sourceIndex, chunk.Value, index, toCopy); + sourceIndex += toCopy; + index += toCopy; + } + } + + if (lastBlockLength > 0) + { + T[] source = items._memoryBlocks[fullBlocks]; + int sourceIndex = 0; + while (sourceIndex < lastBlockLength) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, lastBlockLength - sourceIndex); + Array.Copy(source, sourceIndex, chunk.Value, index, toCopy); + sourceIndex += toCopy; + index += toCopy; + } + } + + chunk.Top = index; + list._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableHashSet items) + { + int count = items._count; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = entries[(copied + i) >> shift][(copied + i) & mask].Value; + } + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableStack items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk destChunk = list._tail; + int destIndex = destChunk.Top; + int destLength = destChunk.Value.Length; + + EnsureCapacity(list, list._count + longCount); + + RecyclableArrayPoolChunk sourceChunk = items._current; + while (sourceChunk.Previous != null) + { + sourceChunk = sourceChunk.Previous; + } + + while (sourceChunk != null) + { + T[] source = sourceChunk.Value; + int sourceCount = sourceChunk.Index; + int sourceIndex = 0; + + while (sourceIndex < sourceCount) + { + if (destIndex == destLength) + { + destChunk.Top = destIndex; + destChunk = destChunk.Next!; + destIndex = destChunk.Top; + destLength = destChunk.Value.Length; + } + + int toCopy = Math.Min(destLength - destIndex, sourceCount - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + } + + sourceChunk = sourceChunk.Next!; + } + + destChunk.Top = destIndex; + list._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableSortedSet items) + { + int count = items._count; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + T[] source = items._items; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(source, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableLinkedList items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk destChunk = list._tail; + int destIndex = destChunk.Top; + int destLength = destChunk.Value.Length; + + EnsureCapacity(list, list._count + longCount); + + var sourceChunk = items._head; + while (sourceChunk != null) + { + int sourceIndex = sourceChunk.Bottom; + int sourceTop = sourceChunk.Top; + T[] source = sourceChunk.Value; + + while (sourceIndex < sourceTop) + { + if (destIndex == destLength) + { + destChunk.Top = destIndex; + destChunk = destChunk.Next!; + destIndex = destChunk.Top; + destLength = destChunk.Value.Length; + } + + int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + } + + sourceChunk = sourceChunk.Next; + } + + destChunk.Top = destIndex; + list._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclablePriorityQueue items) + { + int count = items._size; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + T[] source = items._heap; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(source, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList list, RecyclableQueue items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk destChunk = list._tail; + int destIndex = destChunk.Top; + int destLength = destChunk.Value.Length; + + EnsureCapacity(list, list._count + longCount); + + var sourceChunk = items._head; + while (sourceChunk != null) + { + int sourceIndex = sourceChunk.Bottom; + int sourceTop = sourceChunk.Top; + T[] source = sourceChunk.Value; + + while (sourceIndex < sourceTop) + { + if (destIndex == destLength) + { + destChunk.Top = destIndex; + destChunk = destChunk.Next!; + destIndex = destChunk.Top; + destLength = destChunk.Value.Length; + } + + int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + } + + sourceChunk = sourceChunk.Next; + } + + destChunk.Top = destIndex; + list._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList> list, RecyclableDictionary items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk> chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + ref var entry = ref entries[(local + i) >> shift][(local + i) & mask]; + destination[index + i] = new KeyValuePair(entry.Key, entry.Value); + } + + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList> list, RecyclableSortedDictionary items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk> chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = new KeyValuePair(items.GetKey(local + i), items.GetValue(local + i)); + } + + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLinkedList<(TKey Key, TValue Value)> list, RecyclableSortedList items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk<(TKey Key, TValue Value)> chunk = list._tail; + int index = chunk.Top; + + EnsureCapacity(list, list._count + count); + + TKey[] keys = items._keys; + TValue[] values = items._values; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + chunk = chunk.Next!; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = (keys[local + i], values[local + i]); + } + + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + list._count += count; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Grow(RecyclableLinkedList list) + { + int newSize; + if (list._capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + long doubled = list._capacity << 1; + newSize = (int)Math.Min(doubled - list._capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < newSize) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableLinkedList._needsClearing); + } + + newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + } + + newChunk.Top = 0; + newChunk.Bottom = 0; + newChunk.Previous = list._tail; + newChunk.Next = null; + list._tail.Next = newChunk; + list._tail = newChunk; + list._capacity += newSize; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Grow(RecyclableLinkedList list, long additionalCapacity) + { + int newSize = additionalCapacity >= RecyclableDefaults.MaxPooledBlockSize + ? RecyclableDefaults.MaxPooledBlockSize + : (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)additionalCapacity), RecyclableDefaults.MaxPooledBlockSize); + + var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < newSize) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableLinkedList._needsClearing); + } + + newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + } + + newChunk.Top = 0; + newChunk.Bottom = 0; + newChunk.Previous = list._tail; + newChunk.Next = null; + list._tail.Next = newChunk; + list._tail = newChunk; + list._capacity += newSize; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnsureCapacity(RecyclableLinkedList list, long requiredCapacity) + { + if (requiredCapacity <= list._capacity) + { + return; + } + + long needed = requiredCapacity - list._capacity; + + do + { + int size = needed >= RecyclableDefaults.MaxPooledBlockSize + ? RecyclableDefaults.MaxPooledBlockSize + : (int)BitOperations.RoundUpToPowerOf2((uint)needed); + + var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < size) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableLinkedList._needsClearing); + } + + newChunk.Value = size >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(size) + : new T[size]; + } + + newChunk.Top = 0; + newChunk.Bottom = 0; + newChunk.Previous = list._tail; + newChunk.Next = null; + list._tail.Next = newChunk; + list._tail = newChunk; + list._capacity += size; + + needed -= size; + } + while (needed > 0); + } + } +} diff --git a/Recyclable.Collections/RecyclableLinkedList.cs b/Recyclable.Collections/RecyclableLinkedList.cs index ae2bc16..72844c2 100644 --- a/Recyclable.Collections/RecyclableLinkedList.cs +++ b/Recyclable.Collections/RecyclableLinkedList.cs @@ -1,323 +1,323 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableLinkedList : IEnumerable, IDisposable - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static BiDirectionalRecyclableArrayPoolChunk RentChunk(int size, BiDirectionalRecyclableArrayPoolChunk? previous, bool forHead) - { - var chunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (chunk.Value.Length < size) - { - if (chunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(chunk.Value, _needsClearing); - } - - chunk.Value = size >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(size) - : new T[size]; - } - - if (forHead) - { - chunk.Top = size; - chunk.Bottom = size; - } - else - { - chunk.Top = 0; - chunk.Bottom = 0; - } - - chunk.Previous = previous; - chunk.Next = null; - return chunk; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void ReturnChunk(BiDirectionalRecyclableArrayPoolChunk chunk) - { - BiDirectionalRecyclableArrayPoolChunkPool.Return(chunk); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void DisposeChunk(BiDirectionalRecyclableArrayPoolChunk chunk) - { - BiDirectionalRecyclableArrayPoolChunkPool.Dispose(chunk, _needsClearing); - } - - internal BiDirectionalRecyclableArrayPoolChunk _head; - internal BiDirectionalRecyclableArrayPoolChunk _tail; - internal bool _disposed; - internal long _capacity; - internal long _count; - - public RecyclableLinkedList(int initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _head = RentChunk(initialCapacity, null, false); - _tail = _head; - _capacity = initialCapacity; - _count = 0; - } - - public RecyclableLinkedList(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) : this(initialCapacity) - { - foreach (var item in source) - { - AddLast(item); - } - } - - public int Count => checked((int)_count); - public long LongCount => _count; - - public void AddLast(T item) - { - if (_tail.Top == _tail.Value.Length) - { - GrowTail(); - } - - _tail.Value[_tail.Top++] = item; - _count++; - } - - public void AddFirst(T item) - { - if (_head.Bottom == 0) - { - GrowHead(); - } - - _head.Value[--_head.Bottom] = item; - _count++; - } - - public T RemoveFirst() - { - if (_count == 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "List is empty"); - } - - _count--; - var value = _head.Value[_head.Bottom]; - if (_needsClearing) - { - _head.Value[_head.Bottom] = default!; - } - - _head.Bottom++; - if (_head.Bottom == _head.Top && _head.Next != null) - { - ReleaseHeadChunk(); - } - else if (_head.Bottom == _head.Top) - { - _head.Bottom = _head.Top; - } - - return value; - } - - public T RemoveLast() - { - if (_count == 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "List is empty"); - } - - _count--; - _tail.Top--; - var value = _tail.Value[_tail.Top]; - if (_needsClearing) - { - _tail.Value[_tail.Top] = default!; - } - - if (_tail.Top == _tail.Bottom && _tail.Previous != null) - { - ReleaseTailChunk(); - } - else if (_tail.Top == _tail.Bottom) - { - _tail.Top = _tail.Bottom; - } - - return value; - } - - public void Clear() - { - while (_head.Next != null) - { - ReleaseHeadChunk(); - } - - while (_tail.Previous != null) - { - ReleaseTailChunk(); - } - - if (_needsClearing && _head.Top > _head.Bottom) - { - Array.Clear(_head.Value, _head.Bottom, _head.Top - _head.Bottom); - } - - _capacity = _head.Value.Length; - _head.Bottom = _head.Top; - _tail = _head; - _count = 0; - } - - public Enumerator GetEnumerator() => new(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - private void GrowTail() - { - int newSize; - if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - var doubled = _capacity << 1; - newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = RentChunk(newSize, _tail, false); - _tail.Next = newChunk; - _tail = newChunk; - _capacity += newSize; - } - - private void GrowHead() - { - int newSize; - if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - var doubled = _capacity << 1; - newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = RentChunk(newSize, null, true); - newChunk.Next = _head; - _head.Previous = newChunk; - _head = newChunk; - _capacity += newSize; - } - - private void ReleaseHeadChunk() - { - var toReturn = _head; - _head = toReturn.Next!; - _head.Previous = null; - _capacity -= toReturn.Value.Length; - ReturnChunk(toReturn); - } - - private void ReleaseTailChunk() - { - var toReturn = _tail; - _tail = toReturn.Previous!; - _tail.Next = null; - _capacity -= toReturn.Value.Length; - ReturnChunk(toReturn); - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - var chunk = _head; - while (chunk != null) - { - var next = chunk.Next; - DisposeChunk(chunk); - chunk = next; - } - - _disposed = true; - GC.SuppressFinalize(this); - } - - public struct Enumerator : IEnumerator - { - private readonly BiDirectionalRecyclableArrayPoolChunk? _start; - private BiDirectionalRecyclableArrayPoolChunk? _chunk; - private int _index; - private T? _current; - - internal Enumerator(RecyclableLinkedList list) - { - _start = list._head; - _chunk = list._head; - _index = _chunk != null ? _chunk.Bottom : 0; - _current = default; - } - - public T Current => _current!; - object IEnumerator.Current => _current!; - - public bool MoveNext() - { - if (_chunk == null) - { - return false; - } - - while (_index >= _chunk.Top) - { - _chunk = _chunk.Next; - if (_chunk == null) - { - return false; - } - _index = _chunk.Bottom; - } - - _current = _chunk.Value[_index++]; - return true; - } - - public void Reset() - { - _chunk = _start; - _index = _chunk != null ? _chunk.Bottom : 0; - } - - public void Dispose() - { - _chunk = null; - _current = default; - } - } - } -} - +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableLinkedList : IEnumerable, IDisposable + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static BiDirectionalRecyclableArrayPoolChunk RentChunk(int size, BiDirectionalRecyclableArrayPoolChunk? previous, bool forHead) + { + var chunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (chunk.Value.Length < size) + { + if (chunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(chunk.Value, _needsClearing); + } + + chunk.Value = size >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(size) + : new T[size]; + } + + if (forHead) + { + chunk.Top = size; + chunk.Bottom = size; + } + else + { + chunk.Top = 0; + chunk.Bottom = 0; + } + + chunk.Previous = previous; + chunk.Next = null; + return chunk; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void ReturnChunk(BiDirectionalRecyclableArrayPoolChunk chunk) + { + BiDirectionalRecyclableArrayPoolChunkPool.Return(chunk); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void DisposeChunk(BiDirectionalRecyclableArrayPoolChunk chunk) + { + BiDirectionalRecyclableArrayPoolChunkPool.Dispose(chunk, _needsClearing); + } + + internal BiDirectionalRecyclableArrayPoolChunk _head; + internal BiDirectionalRecyclableArrayPoolChunk _tail; + internal bool _disposed; + internal long _capacity; + internal long _count; + + public RecyclableLinkedList(int initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _head = RentChunk(initialCapacity, null, false); + _tail = _head; + _capacity = initialCapacity; + _count = 0; + } + + public RecyclableLinkedList(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) : this(initialCapacity) + { + foreach (var item in source) + { + AddLast(item); + } + } + + public int Count => checked((int)_count); + public long LongCount => _count; + + public void AddLast(T item) + { + if (_tail.Top == _tail.Value.Length) + { + GrowTail(); + } + + _tail.Value[_tail.Top++] = item; + _count++; + } + + public void AddFirst(T item) + { + if (_head.Bottom == 0) + { + GrowHead(); + } + + _head.Value[--_head.Bottom] = item; + _count++; + } + + public T RemoveFirst() + { + if (_count == 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "List is empty"); + } + + _count--; + var value = _head.Value[_head.Bottom]; + if (_needsClearing) + { + _head.Value[_head.Bottom] = default!; + } + + _head.Bottom++; + if (_head.Bottom == _head.Top && _head.Next != null) + { + ReleaseHeadChunk(); + } + else if (_head.Bottom == _head.Top) + { + _head.Bottom = _head.Top; + } + + return value; + } + + public T RemoveLast() + { + if (_count == 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "List is empty"); + } + + _count--; + _tail.Top--; + var value = _tail.Value[_tail.Top]; + if (_needsClearing) + { + _tail.Value[_tail.Top] = default!; + } + + if (_tail.Top == _tail.Bottom && _tail.Previous != null) + { + ReleaseTailChunk(); + } + else if (_tail.Top == _tail.Bottom) + { + _tail.Top = _tail.Bottom; + } + + return value; + } + + public void Clear() + { + while (_head.Next != null) + { + ReleaseHeadChunk(); + } + + while (_tail.Previous != null) + { + ReleaseTailChunk(); + } + + if (_needsClearing && _head.Top > _head.Bottom) + { + Array.Clear(_head.Value, _head.Bottom, _head.Top - _head.Bottom); + } + + _capacity = _head.Value.Length; + _head.Bottom = _head.Top; + _tail = _head; + _count = 0; + } + + public Enumerator GetEnumerator() => new(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + private void GrowTail() + { + int newSize; + if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + var doubled = _capacity << 1; + newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = RentChunk(newSize, _tail, false); + _tail.Next = newChunk; + _tail = newChunk; + _capacity += newSize; + } + + private void GrowHead() + { + int newSize; + if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + var doubled = _capacity << 1; + newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = RentChunk(newSize, null, true); + newChunk.Next = _head; + _head.Previous = newChunk; + _head = newChunk; + _capacity += newSize; + } + + private void ReleaseHeadChunk() + { + var toReturn = _head; + _head = toReturn.Next!; + _head.Previous = null; + _capacity -= toReturn.Value.Length; + ReturnChunk(toReturn); + } + + private void ReleaseTailChunk() + { + var toReturn = _tail; + _tail = toReturn.Previous!; + _tail.Next = null; + _capacity -= toReturn.Value.Length; + ReturnChunk(toReturn); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + var chunk = _head; + while (chunk != null) + { + var next = chunk.Next; + DisposeChunk(chunk); + chunk = next; + } + + _disposed = true; + GC.SuppressFinalize(this); + } + + public struct Enumerator : IEnumerator + { + private readonly BiDirectionalRecyclableArrayPoolChunk? _start; + private BiDirectionalRecyclableArrayPoolChunk? _chunk; + private int _index; + private T? _current; + + internal Enumerator(RecyclableLinkedList list) + { + _start = list._head; + _chunk = list._head; + _index = _chunk != null ? _chunk.Bottom : 0; + _current = default; + } + + public T Current => _current!; + object IEnumerator.Current => _current!; + + public bool MoveNext() + { + if (_chunk == null) + { + return false; + } + + while (_index >= _chunk.Top) + { + _chunk = _chunk.Next; + if (_chunk == null) + { + return false; + } + _index = _chunk.Bottom; + } + + _current = _chunk.Value[_index++]; + return true; + } + + public void Reset() + { + _chunk = _start; + _index = _chunk != null ? _chunk.Bottom : 0; + } + + public void Dispose() + { + _chunk = null; + _current = default; + } + } + } +} + diff --git a/Recyclable.Collections/RecyclableList.AddRange.cs b/Recyclable.Collections/RecyclableList.AddRange.cs index 68db403..6f86faa 100644 --- a/Recyclable.Collections/RecyclableList.AddRange.cs +++ b/Recyclable.Collections/RecyclableList.AddRange.cs @@ -1,707 +1,707 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Linq.Expressions; -using System.Reflection; - -namespace Recyclable.Collections -{ - public static class zRecyclableListAddRange - { - - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableList<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableList<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclableList list, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(list, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(list, items); - return true; - } - - return false; - } - } - - private static void AddRangeEnumerated(this RecyclableList list, IEnumerable items, int growByCount) - { - var enumerator = items.GetEnumerator(); - if (!enumerator.MoveNext()) - { - return; - } - - int capacity = list._capacity, - targetItemIndex = list._count, - available = capacity - targetItemIndex, - i; - - Span targetSpan = list._memoryBlock; - do - { - if (targetItemIndex + growByCount > capacity) - { - capacity = RecyclableListHelpers.EnsureCapacity(list, targetItemIndex, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); - targetSpan = list._memoryBlock; - available = capacity - targetItemIndex; - } - - for (i = 0; i < available; i++) - { - targetSpan[targetItemIndex++] = enumerator.Current; - if (!enumerator.MoveNext()) - { - break; - } - } - } - while (i >= available); - - list._capacity = capacity; - list._count = targetItemIndex; - } - - private static void AddRangeWithKnownCount(this RecyclableList list, IEnumerable items, int currentItemsCount, int requiredAdditionalCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, currentItemsCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)(currentItemsCount + requiredAdditionalCapacity)))); - - Span targetSpan = list._memoryBlock; - foreach (var item in items) - { - targetSpan[currentItemsCount++] = item; - } - - list._count = currentItemsCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - [VersionedCollectionsGenerator.RewriteForVersioned] - public static void AddRange(this RecyclableList list, in Array items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - Array.Copy(items, items.GetLowerBound(0), list._memoryBlock, list._count, items.Length); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, in T[] items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - new ReadOnlySpan(items).CopyTo(new Span(list._memoryBlock, list._count, items.Length)); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, ReadOnlySpan items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - items.CopyTo(new Span(list._memoryBlock, list._count, items.Length)); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, Span items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - items.CopyTo(new Span(list._memoryBlock, list._count, items.Length)); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, List items) - { - if (list._capacity < list._count + items.Count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); - } - - items.CopyTo(list._memoryBlock, list._count); - list._count += items.Count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, ICollection items) - { - if (list._capacity < list._count + items.Count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); - } - - items.CopyTo(list._memoryBlock, list._count); - list._count += items.Count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, ICollection items) - { - if (list._capacity < list._count + items.Count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); - } - - items.CopyTo(list._memoryBlock, list._count); - list._count += items.Count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, RecyclableList items) - { - if (list._capacity < list._count + items._count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items._count)))); - } - - new ReadOnlySpan(items._memoryBlock, 0, items._count).CopyTo(new Span(list._memoryBlock, list._count, items._count)); - list._count += items._count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, RecyclableLongList items) - { - if (items._longCount == 0) - { - return; - } - - int oldCount = list._count; - long sourceItemsCount = items._longCount; - if (oldCount + sourceItemsCount > int.MaxValue) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items in source and target table exceeds the maximum capacity of {nameof(RecyclableList)}, equal {int.MaxValue}. Please consider using {nameof(RecyclableLongList)}, instead"); - } - - int targetCapacity = oldCount + (int)sourceItemsCount; - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - // TODO: Avoid unnecessary range operator - pass as arguments instead. - Span targetSpan = new Span(list._memoryBlock)[oldCount..], - itemsSpan; - - int blockIndex, - sourceBlockSize = items._blockSize, - lastBlockIndex = (int)(sourceItemsCount >> items._blockSizePow2BitShift) - 1; - - for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++) - { - itemsSpan = new(items._memoryBlocks[blockIndex], 0, sourceBlockSize); - itemsSpan.CopyTo(targetSpan); - targetSpan = targetSpan[sourceBlockSize..]; - } - - if (blockIndex == 0) - { - itemsSpan = new(items._memoryBlocks[blockIndex], 0, (int)sourceItemsCount); - itemsSpan.CopyTo(targetSpan); - } - else if (blockIndex <= items._lastBlockWithData) - { - itemsSpan = new(items._memoryBlocks[blockIndex], 0, items._nextItemIndex); - itemsSpan.CopyTo(targetSpan); - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList list, RecyclableHashSet items) - { - if (items._count == 0) - { - return; - } - - int oldCount = list._count, - sourceCount = items._count, - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (int i = 0; i < sourceCount; i++) - { - targetSpan[i] = entries[i >> shift][i & mask].Value; - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList list, RecyclableStack items) - { - if (items._count == 0) - { - return; - } - - if (items._count > int.MaxValue - list._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), "The total number of items exceeds the capacity of RecyclableList."); - } - - int oldCount = list._count, - sourceCount = checked((int)items._count), - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); - int index = 0; - var chunk = items._current; - while (chunk != null) - { - var array = chunk.Value; - for (int i = chunk.Index - 1; i >= 0; i--) - { - targetSpan[index++] = array[i]; - } - - chunk = chunk.Previous; - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList list, RecyclableSortedSet items) - { - if (items._count == 0) - { - return; - } - - int oldCount = list._count, - sourceCount = items._count, - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - new ReadOnlySpan(items._items, 0, sourceCount).CopyTo(new Span(list._memoryBlock, oldCount, sourceCount)); - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList list, RecyclableLinkedList items) - { - if (items._count == 0) - { - return; - } - - if (items._count > int.MaxValue - list._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), "The total number of items exceeds the capacity of RecyclableList."); - } - - int oldCount = list._count, - sourceCount = checked((int)items._count), - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); - int index = 0; - var chunk = items._head; - while (chunk != null) - { - for (int i = chunk.Bottom; i < chunk.Top; i++) - { - targetSpan[index++] = chunk.Value[i]; - } - - chunk = chunk.Next; - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList list, RecyclablePriorityQueue items) - { - if (items._size == 0) - { - return; - } - - int oldCount = list._count, - sourceCount = items._size, - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - new ReadOnlySpan(items._heap, 0, sourceCount).CopyTo(new Span(list._memoryBlock, oldCount, sourceCount)); - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList list, RecyclableQueue items) - { - if (items._count == 0) - { - return; - } - - if (items._count > int.MaxValue - list._count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), "The total number of items exceeds the capacity of RecyclableList."); - } - - int oldCount = list._count, - sourceCount = checked((int)items._count), - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); - int index = 0; - var chunk = items._head; - while (chunk != null) - { - for (int i = chunk.Bottom; i < chunk.Top; i++) - { - targetSpan[index++] = chunk.Value[i]; - } - - chunk = chunk.Next; - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList> list, RecyclableDictionary items) - { - if (items._count == 0) - { - return; - } - - int oldCount = list._count, - sourceCount = items._count, - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers>.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - Span> targetSpan = new(list._memoryBlock, oldCount, sourceCount); - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (int i = 0; i < sourceCount; i++) - { - ref var entry = ref entries[i >> shift][i & mask]; - targetSpan[i] = new KeyValuePair(entry.Key, entry.Value); - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableList<(TKey Key, TValue Value)> list, RecyclableSortedList items) - { - if (items._count == 0) - { - return; - } - - int oldCount = list._count, - sourceCount = items._count, - targetCapacity = oldCount + sourceCount; - - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers<(TKey Key, TValue Value)>.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - Span<(TKey Key, TValue Value)> targetSpan = new(list._memoryBlock, oldCount, sourceCount); - for (int i = 0; i < sourceCount; i++) - { - targetSpan[i] = (items._keys[i], items._values[i]); - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - public static IEnumerator AddRange(this RecyclableList list, IEnumerable source, int growByCount = RecyclableDefaults.MinPooledArrayLength) - { - int targetItemIndex = list._count; - Span targetSpan; - - int i; - var enumerator = source.GetEnumerator(); - - int capacity = list._capacity; - targetSpan = list._memoryBlock; - if (enumerator.MoveNext()) - { - int available = capacity - targetItemIndex; - do - { - if (targetItemIndex + growByCount > capacity) - { - capacity = RecyclableListHelpers.EnsureCapacity(list, targetItemIndex, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); - targetSpan = list._memoryBlock; - available = capacity - targetItemIndex; - } - - for (i = 0; i < available; i++) - { - targetSpan[targetItemIndex++] = (T)enumerator.Current; - if (!enumerator.MoveNext()) - { - break; - } - } - } - while (i >= available); - } - - list._capacity = capacity; - list._count = targetItemIndex; - return enumerator; - } - - public static void AddRange(this RecyclableList list, IReadOnlyList items) - { - int sourceItemsCount = items.Count; - if (list._capacity < list._count + sourceItemsCount) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + sourceItemsCount)))); - } - - Span targetSpan = new(list._memoryBlock, list._count, sourceItemsCount); - for (var sourceItemIndex = 0; sourceItemIndex < sourceItemsCount; sourceItemIndex++) - { - targetSpan[sourceItemIndex] = items[sourceItemIndex]; - } - - list._count += sourceItemsCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void AddRange(this RecyclableList list, IEnumerable items, int growByCount = RecyclableDefaults.MinPooledArrayLength) - { - if (items is RecyclableList sourceRecyclableList) - { - AddRange(list, sourceRecyclableList); - } - else if (items is RecyclableLongList sourceRecyclableLongList) - { - AddRange(list, sourceRecyclableLongList); - } - else if (items is T[] sourceArray) - { - AddRange(list, sourceArray); - } - else if (items is Array sourceArrayWithObjects) - { - AddRange(list, sourceArrayWithObjects); - } - else if (items is List sourceList) - { - AddRange(list, sourceList); - } - else if (items is ICollection sourceICollection) - { - AddRange(list, sourceICollection); - } - else if (items is ICollection sourceICollectionWithObjects) - { - AddRange(list, sourceICollectionWithObjects); - } - else if (items is RecyclableHashSet sourceHashSet) - { - AddRange(list, sourceHashSet); - } - else if (items is RecyclableStack sourceStack) - { - AddRange(list, sourceStack); - } - else if (items is RecyclableSortedSet sourceSortedSet) - { - AddRange(list, sourceSortedSet); - } - else if (items is RecyclableLinkedList sourceLinkedList) - { - AddRange(list, sourceLinkedList); - } - else if (items is RecyclablePriorityQueue sourcePriorityQueue) - { - AddRange(list, sourcePriorityQueue); - } - else if (items is RecyclableQueue sourceQueue) - { - AddRange(list, sourceQueue); - } - else if (AddRangeHelper.TryAddRange(list, items)) - { - } - else if (items is IReadOnlyList sourceIReadOnlyList) - { - AddRange(list, sourceIReadOnlyList); - } - else if (items.TryGetNonEnumeratedCount(out var requiredAdditionalCapacity) && requiredAdditionalCapacity != 0) - { - AddRangeWithKnownCount(list, items, list._count, requiredAdditionalCapacity); - #if WITH_VERSIONING - list._version++; - #endif - } - else - { - AddRangeEnumerated(list, items, growByCount); - #if WITH_VERSIONING - list._version++; - #endif - } - } - } +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Linq.Expressions; +using System.Reflection; + +namespace Recyclable.Collections +{ + public static class zRecyclableListAddRange + { + + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableList<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableList<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclableList list, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(list, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(list, items); + return true; + } + + return false; + } + } + + private static void AddRangeEnumerated(this RecyclableList list, IEnumerable items, int growByCount) + { + var enumerator = items.GetEnumerator(); + if (!enumerator.MoveNext()) + { + return; + } + + int capacity = list._capacity, + targetItemIndex = list._count, + available = capacity - targetItemIndex, + i; + + Span targetSpan = list._memoryBlock; + do + { + if (targetItemIndex + growByCount > capacity) + { + capacity = RecyclableListHelpers.EnsureCapacity(list, targetItemIndex, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); + targetSpan = list._memoryBlock; + available = capacity - targetItemIndex; + } + + for (i = 0; i < available; i++) + { + targetSpan[targetItemIndex++] = enumerator.Current; + if (!enumerator.MoveNext()) + { + break; + } + } + } + while (i >= available); + + list._capacity = capacity; + list._count = targetItemIndex; + } + + private static void AddRangeWithKnownCount(this RecyclableList list, IEnumerable items, int currentItemsCount, int requiredAdditionalCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, currentItemsCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)(currentItemsCount + requiredAdditionalCapacity)))); + + Span targetSpan = list._memoryBlock; + foreach (var item in items) + { + targetSpan[currentItemsCount++] = item; + } + + list._count = currentItemsCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + [VersionedCollectionsGenerator.RewriteForVersioned] + public static void AddRange(this RecyclableList list, in Array items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + Array.Copy(items, items.GetLowerBound(0), list._memoryBlock, list._count, items.Length); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, in T[] items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + new ReadOnlySpan(items).CopyTo(new Span(list._memoryBlock, list._count, items.Length)); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, ReadOnlySpan items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + items.CopyTo(new Span(list._memoryBlock, list._count, items.Length)); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, Span items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + items.CopyTo(new Span(list._memoryBlock, list._count, items.Length)); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, List items) + { + if (list._capacity < list._count + items.Count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); + } + + items.CopyTo(list._memoryBlock, list._count); + list._count += items.Count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, ICollection items) + { + if (list._capacity < list._count + items.Count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); + } + + items.CopyTo(list._memoryBlock, list._count); + list._count += items.Count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, ICollection items) + { + if (list._capacity < list._count + items.Count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); + } + + items.CopyTo(list._memoryBlock, list._count); + list._count += items.Count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, RecyclableList items) + { + if (list._capacity < list._count + items._count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items._count)))); + } + + new ReadOnlySpan(items._memoryBlock, 0, items._count).CopyTo(new Span(list._memoryBlock, list._count, items._count)); + list._count += items._count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, RecyclableLongList items) + { + if (items._longCount == 0) + { + return; + } + + int oldCount = list._count; + long sourceItemsCount = items._longCount; + if (oldCount + sourceItemsCount > int.MaxValue) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items in source and target table exceeds the maximum capacity of {nameof(RecyclableList)}, equal {int.MaxValue}. Please consider using {nameof(RecyclableLongList)}, instead"); + } + + int targetCapacity = oldCount + (int)sourceItemsCount; + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + // TODO: Avoid unnecessary range operator - pass as arguments instead. + Span targetSpan = new Span(list._memoryBlock)[oldCount..], + itemsSpan; + + int blockIndex, + sourceBlockSize = items._blockSize, + lastBlockIndex = (int)(sourceItemsCount >> items._blockSizePow2BitShift) - 1; + + for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++) + { + itemsSpan = new(items._memoryBlocks[blockIndex], 0, sourceBlockSize); + itemsSpan.CopyTo(targetSpan); + targetSpan = targetSpan[sourceBlockSize..]; + } + + if (blockIndex == 0) + { + itemsSpan = new(items._memoryBlocks[blockIndex], 0, (int)sourceItemsCount); + itemsSpan.CopyTo(targetSpan); + } + else if (blockIndex <= items._lastBlockWithData) + { + itemsSpan = new(items._memoryBlocks[blockIndex], 0, items._nextItemIndex); + itemsSpan.CopyTo(targetSpan); + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList list, RecyclableHashSet items) + { + if (items._count == 0) + { + return; + } + + int oldCount = list._count, + sourceCount = items._count, + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (int i = 0; i < sourceCount; i++) + { + targetSpan[i] = entries[i >> shift][i & mask].Value; + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList list, RecyclableStack items) + { + if (items._count == 0) + { + return; + } + + if (items._count > int.MaxValue - list._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), "The total number of items exceeds the capacity of RecyclableList."); + } + + int oldCount = list._count, + sourceCount = checked((int)items._count), + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); + int index = 0; + var chunk = items._current; + while (chunk != null) + { + var array = chunk.Value; + for (int i = chunk.Index - 1; i >= 0; i--) + { + targetSpan[index++] = array[i]; + } + + chunk = chunk.Previous; + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList list, RecyclableSortedSet items) + { + if (items._count == 0) + { + return; + } + + int oldCount = list._count, + sourceCount = items._count, + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + new ReadOnlySpan(items._items, 0, sourceCount).CopyTo(new Span(list._memoryBlock, oldCount, sourceCount)); + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList list, RecyclableLinkedList items) + { + if (items._count == 0) + { + return; + } + + if (items._count > int.MaxValue - list._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), "The total number of items exceeds the capacity of RecyclableList."); + } + + int oldCount = list._count, + sourceCount = checked((int)items._count), + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); + int index = 0; + var chunk = items._head; + while (chunk != null) + { + for (int i = chunk.Bottom; i < chunk.Top; i++) + { + targetSpan[index++] = chunk.Value[i]; + } + + chunk = chunk.Next; + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList list, RecyclablePriorityQueue items) + { + if (items._size == 0) + { + return; + } + + int oldCount = list._count, + sourceCount = items._size, + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + new ReadOnlySpan(items._heap, 0, sourceCount).CopyTo(new Span(list._memoryBlock, oldCount, sourceCount)); + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList list, RecyclableQueue items) + { + if (items._count == 0) + { + return; + } + + if (items._count > int.MaxValue - list._count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), "The total number of items exceeds the capacity of RecyclableList."); + } + + int oldCount = list._count, + sourceCount = checked((int)items._count), + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + Span targetSpan = new(list._memoryBlock, oldCount, sourceCount); + int index = 0; + var chunk = items._head; + while (chunk != null) + { + for (int i = chunk.Bottom; i < chunk.Top; i++) + { + targetSpan[index++] = chunk.Value[i]; + } + + chunk = chunk.Next; + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList> list, RecyclableDictionary items) + { + if (items._count == 0) + { + return; + } + + int oldCount = list._count, + sourceCount = items._count, + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers>.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + Span> targetSpan = new(list._memoryBlock, oldCount, sourceCount); + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (int i = 0; i < sourceCount; i++) + { + ref var entry = ref entries[i >> shift][i & mask]; + targetSpan[i] = new KeyValuePair(entry.Key, entry.Value); + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableList<(TKey Key, TValue Value)> list, RecyclableSortedList items) + { + if (items._count == 0) + { + return; + } + + int oldCount = list._count, + sourceCount = items._count, + targetCapacity = oldCount + sourceCount; + + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers<(TKey Key, TValue Value)>.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + Span<(TKey Key, TValue Value)> targetSpan = new(list._memoryBlock, oldCount, sourceCount); + for (int i = 0; i < sourceCount; i++) + { + targetSpan[i] = (items._keys[i], items._values[i]); + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + public static IEnumerator AddRange(this RecyclableList list, IEnumerable source, int growByCount = RecyclableDefaults.MinPooledArrayLength) + { + int targetItemIndex = list._count; + Span targetSpan; + + int i; + var enumerator = source.GetEnumerator(); + + int capacity = list._capacity; + targetSpan = list._memoryBlock; + if (enumerator.MoveNext()) + { + int available = capacity - targetItemIndex; + do + { + if (targetItemIndex + growByCount > capacity) + { + capacity = RecyclableListHelpers.EnsureCapacity(list, targetItemIndex, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); + targetSpan = list._memoryBlock; + available = capacity - targetItemIndex; + } + + for (i = 0; i < available; i++) + { + targetSpan[targetItemIndex++] = (T)enumerator.Current; + if (!enumerator.MoveNext()) + { + break; + } + } + } + while (i >= available); + } + + list._capacity = capacity; + list._count = targetItemIndex; + return enumerator; + } + + public static void AddRange(this RecyclableList list, IReadOnlyList items) + { + int sourceItemsCount = items.Count; + if (list._capacity < list._count + sourceItemsCount) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + sourceItemsCount)))); + } + + Span targetSpan = new(list._memoryBlock, list._count, sourceItemsCount); + for (var sourceItemIndex = 0; sourceItemIndex < sourceItemsCount; sourceItemIndex++) + { + targetSpan[sourceItemIndex] = items[sourceItemIndex]; + } + + list._count += sourceItemsCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void AddRange(this RecyclableList list, IEnumerable items, int growByCount = RecyclableDefaults.MinPooledArrayLength) + { + if (items is RecyclableList sourceRecyclableList) + { + AddRange(list, sourceRecyclableList); + } + else if (items is RecyclableLongList sourceRecyclableLongList) + { + AddRange(list, sourceRecyclableLongList); + } + else if (items is T[] sourceArray) + { + AddRange(list, sourceArray); + } + else if (items is Array sourceArrayWithObjects) + { + AddRange(list, sourceArrayWithObjects); + } + else if (items is List sourceList) + { + AddRange(list, sourceList); + } + else if (items is ICollection sourceICollection) + { + AddRange(list, sourceICollection); + } + else if (items is ICollection sourceICollectionWithObjects) + { + AddRange(list, sourceICollectionWithObjects); + } + else if (items is RecyclableHashSet sourceHashSet) + { + AddRange(list, sourceHashSet); + } + else if (items is RecyclableStack sourceStack) + { + AddRange(list, sourceStack); + } + else if (items is RecyclableSortedSet sourceSortedSet) + { + AddRange(list, sourceSortedSet); + } + else if (items is RecyclableLinkedList sourceLinkedList) + { + AddRange(list, sourceLinkedList); + } + else if (items is RecyclablePriorityQueue sourcePriorityQueue) + { + AddRange(list, sourcePriorityQueue); + } + else if (items is RecyclableQueue sourceQueue) + { + AddRange(list, sourceQueue); + } + else if (AddRangeHelper.TryAddRange(list, items)) + { + } + else if (items is IReadOnlyList sourceIReadOnlyList) + { + AddRange(list, sourceIReadOnlyList); + } + else if (items.TryGetNonEnumeratedCount(out var requiredAdditionalCapacity) && requiredAdditionalCapacity != 0) + { + AddRangeWithKnownCount(list, items, list._count, requiredAdditionalCapacity); + #if WITH_VERSIONING + list._version++; + #endif + } + else + { + AddRangeEnumerated(list, items, growByCount); + #if WITH_VERSIONING + list._version++; + #endif + } + } + } } \ No newline at end of file diff --git a/Recyclable.Collections/RecyclableList.Compatibility.List.Find.cs b/Recyclable.Collections/RecyclableList.Compatibility.List.Find.cs index 00871d0..14f5951 100644 --- a/Recyclable.Collections/RecyclableList.Compatibility.List.Find.cs +++ b/Recyclable.Collections/RecyclableList.Compatibility.List.Find.cs @@ -1,272 +1,272 @@ -using System.Numerics; - -namespace Recyclable.Collections -{ - [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] - public static class zRecyclableListCompatibilityListFind - { - public static bool Exists(this RecyclableList list, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return false; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - return true; - } - } - - return false; - } - - public static T? Find(this RecyclableList list, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return default; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - return sourceSpan[itemIndex]; - } - } - - return default; - } - - public static RecyclableList FindAll(this RecyclableList list, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return new(); - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - RecyclableList result = new(sourceItemsCount >> 3); - Span resultSpan = result._memoryBlock; - int capacity = result._capacity, - resultItemsCount = 0; - - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - if (resultItemsCount + 1 > capacity) - { - capacity = checked((int)BitOperations.RoundUpToPowerOf2((uint)resultItemsCount + 1)); - _ = RecyclableListHelpers.EnsureCapacity(result, resultItemsCount, capacity); - resultSpan = result._memoryBlock; - } - - resultSpan[resultItemsCount++] = sourceSpan[itemIndex]; - } - } - - result._capacity = capacity; - result._count = resultItemsCount; - return result; - } - public static RecyclableList FindAllIndexes(this RecyclableList list, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return new(); - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - RecyclableList result = new(sourceItemsCount >> 3); - Span resultSpan = result._memoryBlock; - int capacity = result._capacity, - resultItemsCount = 0; - - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - if (resultItemsCount + 1 > capacity) - { - capacity = checked((int)BitOperations.RoundUpToPowerOf2((uint)resultItemsCount + 1)); - _ = RecyclableListHelpers.EnsureCapacity(result, resultItemsCount, capacity); - resultSpan = result._memoryBlock; - } - - resultSpan[resultItemsCount++] = itemIndex; - } - } - - result._capacity = capacity; - result._count = resultItemsCount; - return result; - } - - public static int FindIndex(this RecyclableList list, int startIndex, int count, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0 || startIndex >= sourceItemsCount) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - sourceItemsCount = Math.Min(sourceItemsCount, startIndex + sourceItemsCount); - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = startIndex; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - return itemIndex; - } - } - - return RecyclableDefaults.ItemNotFoundIndex; - } - - public static int FindIndex(this RecyclableList list, int startIndex, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0 || startIndex >= sourceItemsCount) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - sourceItemsCount = Math.Min(sourceItemsCount, startIndex + sourceItemsCount); - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = startIndex; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - return itemIndex; - } - } - - return RecyclableDefaults.ItemNotFoundIndex; - } - - public static int FindIndex(this RecyclableList list, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - if (match(sourceSpan[itemIndex])) - { - return itemIndex; - } - } - - return RecyclableDefaults.ItemNotFoundIndex; - } - - public static T? FindLast(this RecyclableList list, Predicate match) - { - if (list._count == 0) - { - return default; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = list._count - 1; itemIndex >= 0; itemIndex--) - { - if (match(sourceSpan[itemIndex])) - { - return sourceSpan[itemIndex]; - } - } - - return default; - } - - public static int FindLastIndex(this RecyclableList list, int startIndex, int count, Predicate match) - { - if (count == 0) - { - if (startIndex != -1) - { - ThrowHelper.ThrowArgumentOutOfRangeException_Index(); - } - } - else if (count < 0 || startIndex - count + 1 < 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException_Count(); - } - - if (startIndex < 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - int sourceItemsCount = count; // startIndex - count + 1 >= 0 ? count : startIndex + 1; - if (sourceItemsCount == 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - int lastItemIndex = startIndex - sourceItemsCount; - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = startIndex; itemIndex > lastItemIndex; itemIndex--) - { - if (match(sourceSpan[itemIndex])) - { - return itemIndex; - } - } - - return RecyclableDefaults.ItemNotFoundIndex; - } - - public static int FindLastIndex(this RecyclableList list, int startIndex, Predicate match) - { - if (list._count == 0 || startIndex < 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = startIndex; itemIndex >= 0; itemIndex--) - { - if (match(sourceSpan[itemIndex])) - { - return itemIndex; - } - } - - return RecyclableDefaults.ItemNotFoundIndex; - } - - public static int FindLastIndex(this RecyclableList list, Predicate match) - { - if (list._count == 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = list._count - 1; itemIndex >= 0; itemIndex--) - { - if (match(sourceSpan[itemIndex])) - { - return itemIndex; - } - } - - return RecyclableDefaults.ItemNotFoundIndex; - } - } -} +using System.Numerics; + +namespace Recyclable.Collections +{ + [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] + public static class zRecyclableListCompatibilityListFind + { + public static bool Exists(this RecyclableList list, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return false; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + return true; + } + } + + return false; + } + + public static T? Find(this RecyclableList list, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return default; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + return sourceSpan[itemIndex]; + } + } + + return default; + } + + public static RecyclableList FindAll(this RecyclableList list, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return new(); + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + RecyclableList result = new(sourceItemsCount >> 3); + Span resultSpan = result._memoryBlock; + int capacity = result._capacity, + resultItemsCount = 0; + + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + if (resultItemsCount + 1 > capacity) + { + capacity = checked((int)BitOperations.RoundUpToPowerOf2((uint)resultItemsCount + 1)); + _ = RecyclableListHelpers.EnsureCapacity(result, resultItemsCount, capacity); + resultSpan = result._memoryBlock; + } + + resultSpan[resultItemsCount++] = sourceSpan[itemIndex]; + } + } + + result._capacity = capacity; + result._count = resultItemsCount; + return result; + } + public static RecyclableList FindAllIndexes(this RecyclableList list, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return new(); + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + RecyclableList result = new(sourceItemsCount >> 3); + Span resultSpan = result._memoryBlock; + int capacity = result._capacity, + resultItemsCount = 0; + + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + if (resultItemsCount + 1 > capacity) + { + capacity = checked((int)BitOperations.RoundUpToPowerOf2((uint)resultItemsCount + 1)); + _ = RecyclableListHelpers.EnsureCapacity(result, resultItemsCount, capacity); + resultSpan = result._memoryBlock; + } + + resultSpan[resultItemsCount++] = itemIndex; + } + } + + result._capacity = capacity; + result._count = resultItemsCount; + return result; + } + + public static int FindIndex(this RecyclableList list, int startIndex, int count, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0 || startIndex >= sourceItemsCount) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + sourceItemsCount = Math.Min(sourceItemsCount, startIndex + sourceItemsCount); + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = startIndex; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + return itemIndex; + } + } + + return RecyclableDefaults.ItemNotFoundIndex; + } + + public static int FindIndex(this RecyclableList list, int startIndex, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0 || startIndex >= sourceItemsCount) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + sourceItemsCount = Math.Min(sourceItemsCount, startIndex + sourceItemsCount); + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = startIndex; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + return itemIndex; + } + } + + return RecyclableDefaults.ItemNotFoundIndex; + } + + public static int FindIndex(this RecyclableList list, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + if (match(sourceSpan[itemIndex])) + { + return itemIndex; + } + } + + return RecyclableDefaults.ItemNotFoundIndex; + } + + public static T? FindLast(this RecyclableList list, Predicate match) + { + if (list._count == 0) + { + return default; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = list._count - 1; itemIndex >= 0; itemIndex--) + { + if (match(sourceSpan[itemIndex])) + { + return sourceSpan[itemIndex]; + } + } + + return default; + } + + public static int FindLastIndex(this RecyclableList list, int startIndex, int count, Predicate match) + { + if (count == 0) + { + if (startIndex != -1) + { + ThrowHelper.ThrowArgumentOutOfRangeException_Index(); + } + } + else if (count < 0 || startIndex - count + 1 < 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException_Count(); + } + + if (startIndex < 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + int sourceItemsCount = count; // startIndex - count + 1 >= 0 ? count : startIndex + 1; + if (sourceItemsCount == 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + int lastItemIndex = startIndex - sourceItemsCount; + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = startIndex; itemIndex > lastItemIndex; itemIndex--) + { + if (match(sourceSpan[itemIndex])) + { + return itemIndex; + } + } + + return RecyclableDefaults.ItemNotFoundIndex; + } + + public static int FindLastIndex(this RecyclableList list, int startIndex, Predicate match) + { + if (list._count == 0 || startIndex < 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = startIndex; itemIndex >= 0; itemIndex--) + { + if (match(sourceSpan[itemIndex])) + { + return itemIndex; + } + } + + return RecyclableDefaults.ItemNotFoundIndex; + } + + public static int FindLastIndex(this RecyclableList list, Predicate match) + { + if (list._count == 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = list._count - 1; itemIndex >= 0; itemIndex--) + { + if (match(sourceSpan[itemIndex])) + { + return itemIndex; + } + } + + return RecyclableDefaults.ItemNotFoundIndex; + } + } +} diff --git a/Recyclable.Collections/RecyclableList.Compatibility.List.IndexOf.cs b/Recyclable.Collections/RecyclableList.Compatibility.List.IndexOf.cs index 09aa8d4..c721e9b 100644 --- a/Recyclable.Collections/RecyclableList.Compatibility.List.IndexOf.cs +++ b/Recyclable.Collections/RecyclableList.Compatibility.List.IndexOf.cs @@ -1,26 +1,26 @@ -namespace Recyclable.Collections -{ - [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] - public static class zRecyclableListCompatibilityListIndexOf - { - public static int IndexOf(this RecyclableList list, T item, int index) => list._count != 0 - ? Array.IndexOf(list._memoryBlock, item, index, list._count - index) - : RecyclableDefaults.ItemNotFoundIndex; - - public static int IndexOf(this RecyclableList list, T item, int index, int count) => list._count != 0 - ? Array.IndexOf(list._memoryBlock, item, index, count) - : RecyclableDefaults.ItemNotFoundIndex; - - public static int LastIndexOf(this RecyclableList list, T item) => list._count != 0 - ? Array.LastIndexOf(list._memoryBlock, item, list._count - 1) - : RecyclableDefaults.ItemNotFoundIndex; - - public static int LastIndexOf(this RecyclableList list, T item, int index) => list._count != 0 - ? Array.LastIndexOf(list._memoryBlock, item, index) - : RecyclableDefaults.ItemNotFoundIndex; - - public static int LastIndexOf(this RecyclableList list, T item, int index, int count) => list._count != 0 - ? Array.LastIndexOf(list._memoryBlock, item, index, count) - : RecyclableDefaults.ItemNotFoundIndex; - } -} +namespace Recyclable.Collections +{ + [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] + public static class zRecyclableListCompatibilityListIndexOf + { + public static int IndexOf(this RecyclableList list, T item, int index) => list._count != 0 + ? Array.IndexOf(list._memoryBlock, item, index, list._count - index) + : RecyclableDefaults.ItemNotFoundIndex; + + public static int IndexOf(this RecyclableList list, T item, int index, int count) => list._count != 0 + ? Array.IndexOf(list._memoryBlock, item, index, count) + : RecyclableDefaults.ItemNotFoundIndex; + + public static int LastIndexOf(this RecyclableList list, T item) => list._count != 0 + ? Array.LastIndexOf(list._memoryBlock, item, list._count - 1) + : RecyclableDefaults.ItemNotFoundIndex; + + public static int LastIndexOf(this RecyclableList list, T item, int index) => list._count != 0 + ? Array.LastIndexOf(list._memoryBlock, item, index) + : RecyclableDefaults.ItemNotFoundIndex; + + public static int LastIndexOf(this RecyclableList list, T item, int index, int count) => list._count != 0 + ? Array.LastIndexOf(list._memoryBlock, item, index, count) + : RecyclableDefaults.ItemNotFoundIndex; + } +} diff --git a/Recyclable.Collections/RecyclableList.Compatibility.List.InsertRange.cs b/Recyclable.Collections/RecyclableList.Compatibility.List.InsertRange.cs index 38d55ae..5242fb7 100644 --- a/Recyclable.Collections/RecyclableList.Compatibility.List.InsertRange.cs +++ b/Recyclable.Collections/RecyclableList.Compatibility.List.InsertRange.cs @@ -1,378 +1,378 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] - public static class zRecyclableListCompatibilityListInsertRange - { - private static void InsertRangeEnumerated(this RecyclableList list, int index, IEnumerable items, int growByCount) - { - var enumerator = items.GetEnumerator(); - if (!enumerator.MoveNext()) - { - return; - } - - int capacity = list._capacity, - added = 0, - available = capacity - list._count, - i, - movingBlockLength = list._count - index; - - T[] memoryBlock = list._memoryBlock; - if (available > 0) - { - Array.Copy(memoryBlock, index, memoryBlock, capacity - movingBlockLength, movingBlockLength); - } - - Span memorySpan = memoryBlock; - do - { - if (index + available + movingBlockLength > capacity) - { - var capacityBeforeIncrease = capacity; - capacity = checked((int)BitOperations.RoundUpToPowerOf2((uint)(capacity + growByCount))); - _ = RecyclableListHelpers.EnsureCapacity(list, memoryBlock.Length, capacity); - memorySpan = memoryBlock = list._memoryBlock; - available = capacity - index - movingBlockLength; - Array.Copy(memoryBlock, capacityBeforeIncrease - movingBlockLength, memoryBlock, capacity - movingBlockLength, movingBlockLength); - } - - for (i = 0; i < available; i++) - { - memorySpan[index++] = enumerator.Current; - if (!enumerator.MoveNext()) - { - added++; - break; - } - } - - added += i; - } - while (i == available); - - if (i != available) - { - Array.Copy(memoryBlock, capacity - movingBlockLength, memoryBlock, index, movingBlockLength); - if (RecyclableList._needsClearing) - { - Array.Clear(memoryBlock, capacity - movingBlockLength, movingBlockLength); - } - } - - list._count += added; - list._capacity = capacity; - } - - private static void InsertRangeWithKnownCount(this RecyclableList list, int index, IEnumerable items, int currentItemsCount, int requiredAdditionalCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, currentItemsCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)(currentItemsCount + requiredAdditionalCapacity)))); - - Array.Copy(list._memoryBlock, index, list._memoryBlock, index + requiredAdditionalCapacity, list._count - index); - Span memorySpan = list._memoryBlock; - foreach (var item in items) - { - memorySpan[index++] = item; - } - - list._count += requiredAdditionalCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, in Array items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); - Array.Copy(items, items.GetLowerBound(0), memoryBlock, index, items.Length); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, in T[] items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); - new ReadOnlySpan(items).CopyTo(new Span(memoryBlock, index, items.Length)); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, ReadOnlySpan items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); - items.CopyTo(new Span(memoryBlock, index, items.Length)); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, Span items) - { - if (list._capacity < list._count + items.Length) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); - items.CopyTo(new Span(memoryBlock, index, items.Length)); - list._count += items.Length; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, List items) - { - if (list._capacity < list._count + items.Count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); - items.CopyTo(memoryBlock, index); - list._count += items.Count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, ICollection items) - { - if (list._capacity < list._count + items.Count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); - items.CopyTo(list._memoryBlock, index); - list._count += items.Count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, ICollection items) - { - if (list._capacity < list._count + items.Count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); - items.CopyTo(memoryBlock, index); - list._count += items.Count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, RecyclableList items) - { - if (list._capacity < list._count + items._count) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items._count)))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); - new ReadOnlySpan(items._memoryBlock, 0, items._count).CopyTo(new(list._memoryBlock, index, items._count)); - list._count += items._count; - #if WITH_VERSIONING - list._version++; - #endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, RecyclableLongList items) - { - if (items._longCount == 0) - { - return; - } - - int oldCount = list._count; - long sourceItemsCount = items._longCount; - if (oldCount + sourceItemsCount > int.MaxValue) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items in source and target table exceeds the maximum capacity of {nameof(RecyclableList)}, equal {int.MaxValue}. Please consider using {nameof(RecyclableLongList)}, instead"); - } - - int targetCapacity = oldCount + (int)sourceItemsCount; - if (list._capacity < targetCapacity) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); - } - - T[] memoryBlock = list._memoryBlock; - Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, oldCount - index); - Span targetSpan = new(list._memoryBlock, index, list._capacity - index), - itemsSpan; - - int blockIndex, - sourceBlockSize = items._blockSize, - lastBlockIndex = (int)(sourceItemsCount >> items._blockSizePow2BitShift) - 1; - - for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++) - { - itemsSpan = new(items._memoryBlocks[blockIndex], 0, sourceBlockSize); - itemsSpan.CopyTo(targetSpan); - targetSpan = targetSpan[sourceBlockSize..]; - } - - if (blockIndex == 0) - { - itemsSpan = new(items._memoryBlocks[blockIndex], 0, (int)sourceItemsCount); - itemsSpan.CopyTo(targetSpan); - } - else if (blockIndex <= items._lastBlockWithData) - { - itemsSpan = new(items._memoryBlocks[blockIndex], 0, items._nextItemIndex > 0 ? items._nextItemIndex : sourceBlockSize); - itemsSpan.CopyTo(targetSpan); - } - - list._count = targetCapacity; - #if WITH_VERSIONING - list._version++; - #endif - } - - public static IEnumerator InsertRange(this RecyclableList list, int index, IEnumerable source, int growByCount = RecyclableDefaults.MinPooledArrayLength) - { - int targetItemIndex = list._count; - Span memorySpan; - - int i; - var enumerator = source.GetEnumerator(); - - int capacity = list._capacity; - memorySpan = list._memoryBlock; - if (enumerator.MoveNext()) - { - int available = capacity - targetItemIndex; - do - { - if (targetItemIndex + growByCount > capacity) - { - capacity = RecyclableListHelpers.EnsureCapacity(list, targetItemIndex, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); - memorySpan = list._memoryBlock; - available = capacity - targetItemIndex; - } - - for (i = 0; i < available; i++) - { - memorySpan[targetItemIndex++] = (T)enumerator.Current; - if (!enumerator.MoveNext()) - { - break; - } - } - } - while (i >= available); - } - - list._capacity = capacity; - list._count = targetItemIndex; - return enumerator; - } - - public static void InsertRange(this RecyclableList list, int index, IReadOnlyList items) - { - int sourceItemsCount = items.Count; - if (list._capacity < list._count + sourceItemsCount) - { - list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + sourceItemsCount)))); - } - - Span memorySpan = new(list._memoryBlock, list._count, sourceItemsCount); - for (var sourceItemIndex = 0; sourceItemIndex < sourceItemsCount; sourceItemIndex++) - { - memorySpan[sourceItemIndex] = items[sourceItemIndex]; - } - - list._count += sourceItemsCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void InsertRange(this RecyclableList list, int index, IEnumerable items, int growByCount = RecyclableDefaults.MinPooledArrayLength) - { - if (items is RecyclableList sourceRecyclableList) - { - InsertRange(list, index, sourceRecyclableList); - } - else if (items is RecyclableLongList sourceRecyclableLongList) - { - InsertRange(list, index, sourceRecyclableLongList); - } - else if (items is T[] sourceArray) - { - InsertRange(list, index, sourceArray); - } - else if (items is Array sourceArrayWithObjects) - { - InsertRange(list, index, sourceArrayWithObjects); - } - else if (items is List sourceList) - { - InsertRange(list, index, sourceList); - } - else if (items is ICollection sourceICollection) - { - InsertRange(list, index, sourceICollection); - } - else if (items is ICollection sourceICollectionWithObjects) - { - InsertRange(list, index, sourceICollectionWithObjects); - } - else if (items is IReadOnlyList sourceIReadOnlyList) - { - InsertRange(list, index, sourceIReadOnlyList); - } - else if (items.TryGetNonEnumeratedCount(out var requiredAdditionalCapacity) && requiredAdditionalCapacity != 0) - { - InsertRangeWithKnownCount(list, index, items, list._count, requiredAdditionalCapacity); - } - else - { - InsertRangeEnumerated(list, index, items, growByCount); - } - } - } +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections +{ + [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] + public static class zRecyclableListCompatibilityListInsertRange + { + private static void InsertRangeEnumerated(this RecyclableList list, int index, IEnumerable items, int growByCount) + { + var enumerator = items.GetEnumerator(); + if (!enumerator.MoveNext()) + { + return; + } + + int capacity = list._capacity, + added = 0, + available = capacity - list._count, + i, + movingBlockLength = list._count - index; + + T[] memoryBlock = list._memoryBlock; + if (available > 0) + { + Array.Copy(memoryBlock, index, memoryBlock, capacity - movingBlockLength, movingBlockLength); + } + + Span memorySpan = memoryBlock; + do + { + if (index + available + movingBlockLength > capacity) + { + var capacityBeforeIncrease = capacity; + capacity = checked((int)BitOperations.RoundUpToPowerOf2((uint)(capacity + growByCount))); + _ = RecyclableListHelpers.EnsureCapacity(list, memoryBlock.Length, capacity); + memorySpan = memoryBlock = list._memoryBlock; + available = capacity - index - movingBlockLength; + Array.Copy(memoryBlock, capacityBeforeIncrease - movingBlockLength, memoryBlock, capacity - movingBlockLength, movingBlockLength); + } + + for (i = 0; i < available; i++) + { + memorySpan[index++] = enumerator.Current; + if (!enumerator.MoveNext()) + { + added++; + break; + } + } + + added += i; + } + while (i == available); + + if (i != available) + { + Array.Copy(memoryBlock, capacity - movingBlockLength, memoryBlock, index, movingBlockLength); + if (RecyclableList._needsClearing) + { + Array.Clear(memoryBlock, capacity - movingBlockLength, movingBlockLength); + } + } + + list._count += added; + list._capacity = capacity; + } + + private static void InsertRangeWithKnownCount(this RecyclableList list, int index, IEnumerable items, int currentItemsCount, int requiredAdditionalCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, currentItemsCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)(currentItemsCount + requiredAdditionalCapacity)))); + + Array.Copy(list._memoryBlock, index, list._memoryBlock, index + requiredAdditionalCapacity, list._count - index); + Span memorySpan = list._memoryBlock; + foreach (var item in items) + { + memorySpan[index++] = item; + } + + list._count += requiredAdditionalCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, in Array items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); + Array.Copy(items, items.GetLowerBound(0), memoryBlock, index, items.Length); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, in T[] items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); + new ReadOnlySpan(items).CopyTo(new Span(memoryBlock, index, items.Length)); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, ReadOnlySpan items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); + items.CopyTo(new Span(memoryBlock, index, items.Length)); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, Span items) + { + if (list._capacity < list._count + items.Length) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Length)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Length, list._count - index); + items.CopyTo(new Span(memoryBlock, index, items.Length)); + list._count += items.Length; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, List items) + { + if (list._capacity < list._count + items.Count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); + items.CopyTo(memoryBlock, index); + list._count += items.Count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, ICollection items) + { + if (list._capacity < list._count + items.Count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); + items.CopyTo(list._memoryBlock, index); + list._count += items.Count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, ICollection items) + { + if (list._capacity < list._count + items.Count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items.Count)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); + items.CopyTo(memoryBlock, index); + list._count += items.Count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, RecyclableList items) + { + if (list._capacity < list._count + items._count) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + items._count)))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, list._count - index); + new ReadOnlySpan(items._memoryBlock, 0, items._count).CopyTo(new(list._memoryBlock, index, items._count)); + list._count += items._count; + #if WITH_VERSIONING + list._version++; + #endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, RecyclableLongList items) + { + if (items._longCount == 0) + { + return; + } + + int oldCount = list._count; + long sourceItemsCount = items._longCount; + if (oldCount + sourceItemsCount > int.MaxValue) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(items), $"The total number of items in source and target table exceeds the maximum capacity of {nameof(RecyclableList)}, equal {int.MaxValue}. Please consider using {nameof(RecyclableLongList)}, instead"); + } + + int targetCapacity = oldCount + (int)sourceItemsCount; + if (list._capacity < targetCapacity) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)targetCapacity))); + } + + T[] memoryBlock = list._memoryBlock; + Array.Copy(memoryBlock, index, memoryBlock, index + items.Count, oldCount - index); + Span targetSpan = new(list._memoryBlock, index, list._capacity - index), + itemsSpan; + + int blockIndex, + sourceBlockSize = items._blockSize, + lastBlockIndex = (int)(sourceItemsCount >> items._blockSizePow2BitShift) - 1; + + for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++) + { + itemsSpan = new(items._memoryBlocks[blockIndex], 0, sourceBlockSize); + itemsSpan.CopyTo(targetSpan); + targetSpan = targetSpan[sourceBlockSize..]; + } + + if (blockIndex == 0) + { + itemsSpan = new(items._memoryBlocks[blockIndex], 0, (int)sourceItemsCount); + itemsSpan.CopyTo(targetSpan); + } + else if (blockIndex <= items._lastBlockWithData) + { + itemsSpan = new(items._memoryBlocks[blockIndex], 0, items._nextItemIndex > 0 ? items._nextItemIndex : sourceBlockSize); + itemsSpan.CopyTo(targetSpan); + } + + list._count = targetCapacity; + #if WITH_VERSIONING + list._version++; + #endif + } + + public static IEnumerator InsertRange(this RecyclableList list, int index, IEnumerable source, int growByCount = RecyclableDefaults.MinPooledArrayLength) + { + int targetItemIndex = list._count; + Span memorySpan; + + int i; + var enumerator = source.GetEnumerator(); + + int capacity = list._capacity; + memorySpan = list._memoryBlock; + if (enumerator.MoveNext()) + { + int available = capacity - targetItemIndex; + do + { + if (targetItemIndex + growByCount > capacity) + { + capacity = RecyclableListHelpers.EnsureCapacity(list, targetItemIndex, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); + memorySpan = list._memoryBlock; + available = capacity - targetItemIndex; + } + + for (i = 0; i < available; i++) + { + memorySpan[targetItemIndex++] = (T)enumerator.Current; + if (!enumerator.MoveNext()) + { + break; + } + } + } + while (i >= available); + } + + list._capacity = capacity; + list._count = targetItemIndex; + return enumerator; + } + + public static void InsertRange(this RecyclableList list, int index, IReadOnlyList items) + { + int sourceItemsCount = items.Count; + if (list._capacity < list._count + sourceItemsCount) + { + list._capacity = RecyclableListHelpers.EnsureCapacity(list, list._count, checked((int)BitOperations.RoundUpToPowerOf2((uint)(list._count + sourceItemsCount)))); + } + + Span memorySpan = new(list._memoryBlock, list._count, sourceItemsCount); + for (var sourceItemIndex = 0; sourceItemIndex < sourceItemsCount; sourceItemIndex++) + { + memorySpan[sourceItemIndex] = items[sourceItemIndex]; + } + + list._count += sourceItemsCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void InsertRange(this RecyclableList list, int index, IEnumerable items, int growByCount = RecyclableDefaults.MinPooledArrayLength) + { + if (items is RecyclableList sourceRecyclableList) + { + InsertRange(list, index, sourceRecyclableList); + } + else if (items is RecyclableLongList sourceRecyclableLongList) + { + InsertRange(list, index, sourceRecyclableLongList); + } + else if (items is T[] sourceArray) + { + InsertRange(list, index, sourceArray); + } + else if (items is Array sourceArrayWithObjects) + { + InsertRange(list, index, sourceArrayWithObjects); + } + else if (items is List sourceList) + { + InsertRange(list, index, sourceList); + } + else if (items is ICollection sourceICollection) + { + InsertRange(list, index, sourceICollection); + } + else if (items is ICollection sourceICollectionWithObjects) + { + InsertRange(list, index, sourceICollectionWithObjects); + } + else if (items is IReadOnlyList sourceIReadOnlyList) + { + InsertRange(list, index, sourceIReadOnlyList); + } + else if (items.TryGetNonEnumeratedCount(out var requiredAdditionalCapacity) && requiredAdditionalCapacity != 0) + { + InsertRangeWithKnownCount(list, index, items, list._count, requiredAdditionalCapacity); + } + else + { + InsertRangeEnumerated(list, index, items, growByCount); + } + } + } } \ No newline at end of file diff --git a/Recyclable.Collections/RecyclableList.Compatibility.List.cs b/Recyclable.Collections/RecyclableList.Compatibility.List.cs index 3e4a1fa..c34de5f 100644 --- a/Recyclable.Collections/RecyclableList.Compatibility.List.cs +++ b/Recyclable.Collections/RecyclableList.Compatibility.List.cs @@ -1,230 +1,230 @@ -using System.Collections.ObjectModel; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - - [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] - public static class zRecyclableListCompatibilityList - { - public static ReadOnlyCollection AsReadOnly(this RecyclableList list) => new(list); - - public static int BinarySearch(this RecyclableList list, T item) - => Array.BinarySearch(list._memoryBlock, 0, list._count, item); - - public static int BinarySearch(this RecyclableList list, T item, IComparer? comparer) - => Array.BinarySearch(list._memoryBlock, 0, list._count, item, comparer); - - public static int BinarySearch(this RecyclableList list, int index, int count, T item, IComparer? comparer) - => Array.BinarySearch(list._memoryBlock, index, count, item, comparer); - - public static RecyclableList ConvertAll(this RecyclableList list, Converter converter) - { - int itemsCount = list._count; - if (itemsCount == 0) - { - return new(); - } - - RecyclableList result = new(itemsCount); - TOutput[] resultSpan = result._memoryBlock; - ReadOnlySpan sourceSpan = list._memoryBlock; - for (int bufferIndex = 0; bufferIndex < itemsCount; bufferIndex++) - { - resultSpan[bufferIndex] = converter(sourceSpan[bufferIndex]); - } - - result._count = itemsCount; - return result; - } - - public static void CopyTo(this RecyclableList list, T[] array) => Array.Copy(list._memoryBlock, array, list._count); - - public static void CopyTo(this RecyclableList list, int index, T[] array, int arrayIndex, int count) => Array.Copy(list._memoryBlock, index, array, arrayIndex, count); - - public static void ForEach(this RecyclableList list, Action action) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - action(sourceSpan[itemIndex]); - } - } - - public static RecyclableList GetRange(this RecyclableList list, int index, int count) - { - int sourceItemsCount = index + count <= list._count ? count : list._count - index; - if (sourceItemsCount <= 0) - { - return new(); - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - RecyclableList result = new(sourceItemsCount); - Span targetSpan = result._memoryBlock; - int resultItemsCount = 0; - sourceItemsCount += index; - for (var itemIndex = index; itemIndex < sourceItemsCount; itemIndex++) - { - targetSpan[resultItemsCount++] = sourceSpan[itemIndex]; - } - - result._count = resultItemsCount; - return result; - } - - public static int RemoveAll(this RecyclableList list, Predicate match) - { - using var allIndexes = list.FindAllIndexes(match); - int foundItemsCount = allIndexes._count; - if (foundItemsCount == 0) - { - return foundItemsCount; - } - - for (int removed = 0; removed < foundItemsCount; removed++) - { - var indexToRemove = allIndexes[removed] - removed; - Array.Copy(list._memoryBlock, indexToRemove + 1, list._memoryBlock, indexToRemove, list._count - indexToRemove - removed - 1); - } - - if (RecyclableList._needsClearing) - { - Array.Clear(list._memoryBlock, list._count - foundItemsCount, foundItemsCount); - } - - list._count -= foundItemsCount; - #if WITH_VERSIONING - list._version++; - #endif - return foundItemsCount; - } - - public static void RemoveRange(this RecyclableList list, int index, int count) - { - int oldCount = list._count; - count = count - index + 1 <= oldCount ? count : oldCount - index + 1; - if (count == 0) - { - return; - } - - if (index + count < oldCount) - { - Array.Copy(list._memoryBlock, index + count, list._memoryBlock, index, oldCount - count - index); - } - - if (RecyclableList._needsClearing) - { - Array.Clear(list._memoryBlock, oldCount - count, count); - } - - list._count -= count; - #if WITH_VERSIONING - list._version++; - #endif - } - - public static void Reverse(this RecyclableList list) - { - Array.Reverse(list._memoryBlock, 0, list._count); - #if WITH_VERSIONING - list._version++; - #endif - } - - public static void Reverse(this RecyclableList list, int index, int count) - { - Array.Reverse(list._memoryBlock, index, count); - #if WITH_VERSIONING - list._version++; - #endif - } - - public static void Sort(this RecyclableList list) - { - Array.Sort(list._memoryBlock, 0, list._count); - #if WITH_VERSIONING - list._version++; - #endif - } - - public static void Sort(this RecyclableList list, Comparison comparison) - { - Array.Sort(list._memoryBlock, 0, list._count, new ComparisonToComparerAdapter(comparison)); - #if WITH_VERSIONING - list._version++; - #endif - } - - public static void Sort(this RecyclableList list, IComparer? comparer) - { - Array.Sort(list._memoryBlock, 0, list._count, comparer); - #if WITH_VERSIONING - list._version++; - #endif - } - - public static void Sort(this RecyclableList list, int index, int count, IComparer? comparer) - { - Array.Sort(list._memoryBlock, index, count, comparer); - #if WITH_VERSIONING - list._version++; - #endif - } - - public static T[] ToArray(this RecyclableList list) - { - T[] result = new T[list._count]; - new ReadOnlySpan(list._memoryBlock, 0, list._count).CopyTo(result); - return result; - } - - public static void TrimExcess(this RecyclableList list) - { - var requiredCapacity = list._count >= RecyclableDefaults.InitialCapacity ? list._count : RecyclableDefaults.InitialCapacity; - - T[] oldMemoryBlock = list._memoryBlock; - T[] result = requiredCapacity >= RecyclableDefaults.MinPooledArrayLength && BitOperations.IsPow2(requiredCapacity) - ? RecyclableArrayPool.RentShared(requiredCapacity) - : new T[requiredCapacity]; - - new ReadOnlySpan(oldMemoryBlock, 0, list._count).CopyTo(result); - - if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(oldMemoryBlock, RecyclableList._needsClearing); - } - - list._memoryBlock = result; - list._capacity = requiredCapacity; - } - - public static bool TrueForAll(this RecyclableList list, Predicate match) - { - int sourceItemsCount = list._count; - if (sourceItemsCount == 0) - { - return false; - } - - ReadOnlySpan sourceSpan = list._memoryBlock; - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - if (!match(sourceSpan[itemIndex])) - { - return false; - } - } - - return true; - } - } -} +using System.Collections.ObjectModel; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + + [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] + public static class zRecyclableListCompatibilityList + { + public static ReadOnlyCollection AsReadOnly(this RecyclableList list) => new(list); + + public static int BinarySearch(this RecyclableList list, T item) + => Array.BinarySearch(list._memoryBlock, 0, list._count, item); + + public static int BinarySearch(this RecyclableList list, T item, IComparer? comparer) + => Array.BinarySearch(list._memoryBlock, 0, list._count, item, comparer); + + public static int BinarySearch(this RecyclableList list, int index, int count, T item, IComparer? comparer) + => Array.BinarySearch(list._memoryBlock, index, count, item, comparer); + + public static RecyclableList ConvertAll(this RecyclableList list, Converter converter) + { + int itemsCount = list._count; + if (itemsCount == 0) + { + return new(); + } + + RecyclableList result = new(itemsCount); + TOutput[] resultSpan = result._memoryBlock; + ReadOnlySpan sourceSpan = list._memoryBlock; + for (int bufferIndex = 0; bufferIndex < itemsCount; bufferIndex++) + { + resultSpan[bufferIndex] = converter(sourceSpan[bufferIndex]); + } + + result._count = itemsCount; + return result; + } + + public static void CopyTo(this RecyclableList list, T[] array) => Array.Copy(list._memoryBlock, array, list._count); + + public static void CopyTo(this RecyclableList list, int index, T[] array, int arrayIndex, int count) => Array.Copy(list._memoryBlock, index, array, arrayIndex, count); + + public static void ForEach(this RecyclableList list, Action action) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + action(sourceSpan[itemIndex]); + } + } + + public static RecyclableList GetRange(this RecyclableList list, int index, int count) + { + int sourceItemsCount = index + count <= list._count ? count : list._count - index; + if (sourceItemsCount <= 0) + { + return new(); + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + RecyclableList result = new(sourceItemsCount); + Span targetSpan = result._memoryBlock; + int resultItemsCount = 0; + sourceItemsCount += index; + for (var itemIndex = index; itemIndex < sourceItemsCount; itemIndex++) + { + targetSpan[resultItemsCount++] = sourceSpan[itemIndex]; + } + + result._count = resultItemsCount; + return result; + } + + public static int RemoveAll(this RecyclableList list, Predicate match) + { + using var allIndexes = list.FindAllIndexes(match); + int foundItemsCount = allIndexes._count; + if (foundItemsCount == 0) + { + return foundItemsCount; + } + + for (int removed = 0; removed < foundItemsCount; removed++) + { + var indexToRemove = allIndexes[removed] - removed; + Array.Copy(list._memoryBlock, indexToRemove + 1, list._memoryBlock, indexToRemove, list._count - indexToRemove - removed - 1); + } + + if (RecyclableList._needsClearing) + { + Array.Clear(list._memoryBlock, list._count - foundItemsCount, foundItemsCount); + } + + list._count -= foundItemsCount; + #if WITH_VERSIONING + list._version++; + #endif + return foundItemsCount; + } + + public static void RemoveRange(this RecyclableList list, int index, int count) + { + int oldCount = list._count; + count = count - index + 1 <= oldCount ? count : oldCount - index + 1; + if (count == 0) + { + return; + } + + if (index + count < oldCount) + { + Array.Copy(list._memoryBlock, index + count, list._memoryBlock, index, oldCount - count - index); + } + + if (RecyclableList._needsClearing) + { + Array.Clear(list._memoryBlock, oldCount - count, count); + } + + list._count -= count; + #if WITH_VERSIONING + list._version++; + #endif + } + + public static void Reverse(this RecyclableList list) + { + Array.Reverse(list._memoryBlock, 0, list._count); + #if WITH_VERSIONING + list._version++; + #endif + } + + public static void Reverse(this RecyclableList list, int index, int count) + { + Array.Reverse(list._memoryBlock, index, count); + #if WITH_VERSIONING + list._version++; + #endif + } + + public static void Sort(this RecyclableList list) + { + Array.Sort(list._memoryBlock, 0, list._count); + #if WITH_VERSIONING + list._version++; + #endif + } + + public static void Sort(this RecyclableList list, Comparison comparison) + { + Array.Sort(list._memoryBlock, 0, list._count, new ComparisonToComparerAdapter(comparison)); + #if WITH_VERSIONING + list._version++; + #endif + } + + public static void Sort(this RecyclableList list, IComparer? comparer) + { + Array.Sort(list._memoryBlock, 0, list._count, comparer); + #if WITH_VERSIONING + list._version++; + #endif + } + + public static void Sort(this RecyclableList list, int index, int count, IComparer? comparer) + { + Array.Sort(list._memoryBlock, index, count, comparer); + #if WITH_VERSIONING + list._version++; + #endif + } + + public static T[] ToArray(this RecyclableList list) + { + T[] result = new T[list._count]; + new ReadOnlySpan(list._memoryBlock, 0, list._count).CopyTo(result); + return result; + } + + public static void TrimExcess(this RecyclableList list) + { + var requiredCapacity = list._count >= RecyclableDefaults.InitialCapacity ? list._count : RecyclableDefaults.InitialCapacity; + + T[] oldMemoryBlock = list._memoryBlock; + T[] result = requiredCapacity >= RecyclableDefaults.MinPooledArrayLength && BitOperations.IsPow2(requiredCapacity) + ? RecyclableArrayPool.RentShared(requiredCapacity) + : new T[requiredCapacity]; + + new ReadOnlySpan(oldMemoryBlock, 0, list._count).CopyTo(result); + + if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(oldMemoryBlock, RecyclableList._needsClearing); + } + + list._memoryBlock = result; + list._capacity = requiredCapacity; + } + + public static bool TrueForAll(this RecyclableList list, Predicate match) + { + int sourceItemsCount = list._count; + if (sourceItemsCount == 0) + { + return false; + } + + ReadOnlySpan sourceSpan = list._memoryBlock; + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + if (!match(sourceSpan[itemIndex])) + { + return false; + } + } + + return true; + } + } +} diff --git a/Recyclable.Collections/RecyclableList.Enumerator.cs b/Recyclable.Collections/RecyclableList.Enumerator.cs index 7a0b603..7bbd7b0 100644 --- a/Recyclable.Collections/RecyclableList.Enumerator.cs +++ b/Recyclable.Collections/RecyclableList.Enumerator.cs @@ -1,53 +1,53 @@ -using System.Collections; -using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; - -namespace Recyclable.Collections -{ - public partial class RecyclableList - { - [StructLayout(LayoutKind.Sequential, Pack = 1)] - [VersionedCollectionsGenerator.CloneForVersioned] - public struct Enumerator : IEnumerator - { - private static readonly bool _isReferenceType = !typeof(T).IsValueType; - - private int _currentItemIndex; - private readonly RecyclableList _list; - -#nullable disable - [Pure] - public readonly T Current => _list._memoryBlock[_currentItemIndex - 1]; - [Pure] - readonly object IEnumerator.Current => _list._memoryBlock[_currentItemIndex - 1]; -#nullable restore - - public bool MoveNext() - { - if (_currentItemIndex < _list._count) - { - _currentItemIndex++; - return true; - } - - return false; - } - - public Enumerator(RecyclableList list) - { - _currentItemIndex = 0; - _list = list; - } - - [Pure] - public readonly void Dispose() - { - } - - void IEnumerator.Reset() - { - _currentItemIndex = 0; - } - } - } -} +using System.Collections; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Recyclable.Collections +{ + public partial class RecyclableList + { + [StructLayout(LayoutKind.Sequential, Pack = 1)] + [VersionedCollectionsGenerator.CloneForVersioned] + public struct Enumerator : IEnumerator + { + private static readonly bool _isReferenceType = !typeof(T).IsValueType; + + private int _currentItemIndex; + private readonly RecyclableList _list; + +#nullable disable + [Pure] + public readonly T Current => _list._memoryBlock[_currentItemIndex - 1]; + [Pure] + readonly object IEnumerator.Current => _list._memoryBlock[_currentItemIndex - 1]; +#nullable restore + + public bool MoveNext() + { + if (_currentItemIndex < _list._count) + { + _currentItemIndex++; + return true; + } + + return false; + } + + public Enumerator(RecyclableList list) + { + _currentItemIndex = 0; + _list = list; + } + + [Pure] + public readonly void Dispose() + { + } + + void IEnumerator.Reset() + { + _currentItemIndex = 0; + } + } + } +} diff --git a/Recyclable.Collections/RecyclableList.Extensions.cs b/Recyclable.Collections/RecyclableList.Extensions.cs index bf55211..b0fe987 100644 --- a/Recyclable.Collections/RecyclableList.Extensions.cs +++ b/Recyclable.Collections/RecyclableList.Extensions.cs @@ -1,45 +1,45 @@ -using System.Collections; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - [VersionedCollectionsGenerator.GenerateVersioned] - public static class RecyclableListExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this Array values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this ICollection values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this ICollection values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this IEnumerable values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this IEnumerable values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this IReadOnlyList values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this List values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this ReadOnlySpan values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this RecyclableList values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this RecyclableLongList values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this Span values) => new(values); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableList ToRecyclableList(this T[] values) => new(values); - } -} +using System.Collections; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections +{ + [VersionedCollectionsGenerator.GenerateVersioned] + public static class RecyclableListExtensions + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this Array values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this ICollection values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this ICollection values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this IEnumerable values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this IEnumerable values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this IReadOnlyList values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this List values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this ReadOnlySpan values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this RecyclableList values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this RecyclableLongList values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this Span values) => new(values); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableList ToRecyclableList(this T[] values) => new(values); + } +} diff --git a/Recyclable.Collections/RecyclableList.Helpers.cs b/Recyclable.Collections/RecyclableList.Helpers.cs index e8882c8..aaebe27 100644 --- a/Recyclable.Collections/RecyclableList.Helpers.cs +++ b/Recyclable.Collections/RecyclableList.Helpers.cs @@ -1,89 +1,89 @@ -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class RecyclableListHelpers - { - private static readonly bool NeedsClearing = !typeof(T).IsValueType; - - public static int CalculateIndex(int index, int lowerBound) => index >= 0 ? index + lowerBound : RecyclableDefaults.ItemNotFoundIndex; - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void EnsureCapacity(RecyclableList list) - { - // TODO: Measure performance - // T[] newMemoryBlock = RecyclableListHelpers._arrayPool.Rent(_capacity <<= 1); - T[] oldMemoryBlock = list._memoryBlock; - list._memoryBlock = checked(list._capacity <<= 1) < RecyclableDefaults.MinPooledArrayLength - ? new T[list._capacity] - : RecyclableArrayPool.RentShared(list._capacity); - - // & WAS SLOWER WITHOUT - new ReadOnlySpan(oldMemoryBlock, 0, list._count).CopyTo(list._memoryBlock); - - if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) - { - // TODO: Measure gain vs relying on arrayPool to clear - //if (NeedsClearing) - //{ - // Array.Clear(source); - //} - - RecyclableArrayPool.ReturnShared(oldMemoryBlock, NeedsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static int EnsureCapacity(RecyclableList sourceList, int newSize) - { - T[] oldMemoryBlock = sourceList._memoryBlock; - sourceList._memoryBlock = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - - // & WAS SLOWER AS ARRAY - new ReadOnlySpan(oldMemoryBlock, 0, sourceList._capacity).CopyTo(sourceList._memoryBlock); - - if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) - { - // TODO: Measure gain vs relying on arrayPool to clear - //if (NeedsClearing) - //{ - // Array.Clear(source); - //} - - // If anything, it has been already cleared above, so we don't need to repeat it. - RecyclableArrayPool.ReturnShared(oldMemoryBlock, NeedsClearing); - } - - return newSize; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static int EnsureCapacity(RecyclableList sourceList, int oldSize, int newSize) - { - T[] oldMemoryBlock = sourceList._memoryBlock; - sourceList._memoryBlock = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - - // & WAS SLOWER AS ARRAY - new ReadOnlySpan(oldMemoryBlock, 0, oldSize).CopyTo(sourceList._memoryBlock); - - if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) - { - // TODO: Measure gain vs relying on arrayPool to clear - //if (NeedsClearing) - //{ - // Array.Clear(source); - //} - - // If anything, it has been already cleared above, so we don't need to repeat it. - RecyclableArrayPool.ReturnShared(oldMemoryBlock, NeedsClearing); - } - - return newSize; - } - } -} +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class RecyclableListHelpers + { + private static readonly bool NeedsClearing = !typeof(T).IsValueType; + + public static int CalculateIndex(int index, int lowerBound) => index >= 0 ? index + lowerBound : RecyclableDefaults.ItemNotFoundIndex; + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void EnsureCapacity(RecyclableList list) + { + // TODO: Measure performance + // T[] newMemoryBlock = RecyclableListHelpers._arrayPool.Rent(_capacity <<= 1); + T[] oldMemoryBlock = list._memoryBlock; + list._memoryBlock = checked(list._capacity <<= 1) < RecyclableDefaults.MinPooledArrayLength + ? new T[list._capacity] + : RecyclableArrayPool.RentShared(list._capacity); + + // & WAS SLOWER WITHOUT + new ReadOnlySpan(oldMemoryBlock, 0, list._count).CopyTo(list._memoryBlock); + + if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) + { + // TODO: Measure gain vs relying on arrayPool to clear + //if (NeedsClearing) + //{ + // Array.Clear(source); + //} + + RecyclableArrayPool.ReturnShared(oldMemoryBlock, NeedsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static int EnsureCapacity(RecyclableList sourceList, int newSize) + { + T[] oldMemoryBlock = sourceList._memoryBlock; + sourceList._memoryBlock = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + + // & WAS SLOWER AS ARRAY + new ReadOnlySpan(oldMemoryBlock, 0, sourceList._capacity).CopyTo(sourceList._memoryBlock); + + if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) + { + // TODO: Measure gain vs relying on arrayPool to clear + //if (NeedsClearing) + //{ + // Array.Clear(source); + //} + + // If anything, it has been already cleared above, so we don't need to repeat it. + RecyclableArrayPool.ReturnShared(oldMemoryBlock, NeedsClearing); + } + + return newSize; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static int EnsureCapacity(RecyclableList sourceList, int oldSize, int newSize) + { + T[] oldMemoryBlock = sourceList._memoryBlock; + sourceList._memoryBlock = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + + // & WAS SLOWER AS ARRAY + new ReadOnlySpan(oldMemoryBlock, 0, oldSize).CopyTo(sourceList._memoryBlock); + + if (oldMemoryBlock.Length >= RecyclableDefaults.MinPooledArrayLength) + { + // TODO: Measure gain vs relying on arrayPool to clear + //if (NeedsClearing) + //{ + // Array.Clear(source); + //} + + // If anything, it has been already cleared above, so we don't need to repeat it. + RecyclableArrayPool.ReturnShared(oldMemoryBlock, NeedsClearing); + } + + return newSize; + } + } +} diff --git a/Recyclable.Collections/RecyclableList.IList.cs b/Recyclable.Collections/RecyclableList.IList.cs index a7537b1..5a53ab0 100644 --- a/Recyclable.Collections/RecyclableList.IList.cs +++ b/Recyclable.Collections/RecyclableList.IList.cs @@ -1,122 +1,122 @@ -using System.Collections; - -namespace Recyclable.Collections -{ - public partial class RecyclableList : IList - { - private static readonly bool _defaultIsNull = default(T) == null; - - public bool IsFixedSize => false; - public bool IsSynchronized => false; - - [NonSerialized] - private object? _syncRoot; - - public object SyncRoot - { - get - { - if (_syncRoot == null) - { - _ = Interlocked.CompareExchange(ref _syncRoot, new object(), null); - } - - return _syncRoot; - } - } - - object? IList.this[int index] - { - get => _memoryBlock[index]; - - set - { - if (value is T typedValue) - { - new Span(_memoryBlock)[index] = typedValue; - } - else if (value == null && _defaultIsNull) - { -#nullable disable - new Span(_memoryBlock)[index] = default; -#nullable restore - } - else - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - } - } - } - - public int Add(object? value) - { - if (value is T typeValue) - { - Add(typeValue); - return _count - 1; - } - else if (value == null && _defaultIsNull) - { - Add(null); - return _count - 1; - } - else - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - return RecyclableDefaults.ItemNotFoundIndex; - } - } - - public bool Contains(object? value) => value is T typeValue - ? Contains(typeValue) -#nullable disable - : value == null && _defaultIsNull && Contains(default); -#nullable restore - - public int IndexOf(object? value) => value is T typeValue - ? IndexOf(typeValue) - : value == null && _defaultIsNull -#nullable disable - ? IndexOf(default) -#nullable restore - : RecyclableDefaults.ItemNotFoundIndex; - - public void Insert(int index, object? value) - { - if (value is T typeValue) - { - Insert(index, typeValue); - } - else if (value == null && _defaultIsNull) - { -#nullable disable - Insert(index, default); -#nullable restore - } - else - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - } - } - - public void Remove(object? value) - { - if (value is T typeValue) - { - _ = Remove(typeValue); - } - else if (value == null && _defaultIsNull) - { -#nullable disable - _ = Remove(default); -#nullable restore - } - else - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - } - } - - public void CopyTo(Array array, int index) => Array.Copy(_memoryBlock, 0, array, index, _count); - } -} +using System.Collections; + +namespace Recyclable.Collections +{ + public partial class RecyclableList : IList + { + private static readonly bool _defaultIsNull = default(T) == null; + + public bool IsFixedSize => false; + public bool IsSynchronized => false; + + [NonSerialized] + private object? _syncRoot; + + public object SyncRoot + { + get + { + if (_syncRoot == null) + { + _ = Interlocked.CompareExchange(ref _syncRoot, new object(), null); + } + + return _syncRoot; + } + } + + object? IList.this[int index] + { + get => _memoryBlock[index]; + + set + { + if (value is T typedValue) + { + new Span(_memoryBlock)[index] = typedValue; + } + else if (value == null && _defaultIsNull) + { +#nullable disable + new Span(_memoryBlock)[index] = default; +#nullable restore + } + else + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + } + } + } + + public int Add(object? value) + { + if (value is T typeValue) + { + Add(typeValue); + return _count - 1; + } + else if (value == null && _defaultIsNull) + { + Add(null); + return _count - 1; + } + else + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + return RecyclableDefaults.ItemNotFoundIndex; + } + } + + public bool Contains(object? value) => value is T typeValue + ? Contains(typeValue) +#nullable disable + : value == null && _defaultIsNull && Contains(default); +#nullable restore + + public int IndexOf(object? value) => value is T typeValue + ? IndexOf(typeValue) + : value == null && _defaultIsNull +#nullable disable + ? IndexOf(default) +#nullable restore + : RecyclableDefaults.ItemNotFoundIndex; + + public void Insert(int index, object? value) + { + if (value is T typeValue) + { + Insert(index, typeValue); + } + else if (value == null && _defaultIsNull) + { +#nullable disable + Insert(index, default); +#nullable restore + } + else + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + } + } + + public void Remove(object? value) + { + if (value is T typeValue) + { + _ = Remove(typeValue); + } + else if (value == null && _defaultIsNull) + { +#nullable disable + _ = Remove(default); +#nullable restore + } + else + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + } + } + + public void CopyTo(Array array, int index) => Array.Copy(_memoryBlock, 0, array, index, _count); + } +} diff --git a/Recyclable.Collections/RecyclableList.VersionedEnumerator.cs b/Recyclable.Collections/RecyclableList.VersionedEnumerator.cs index 2623ebd..0e50762 100644 --- a/Recyclable.Collections/RecyclableList.VersionedEnumerator.cs +++ b/Recyclable.Collections/RecyclableList.VersionedEnumerator.cs @@ -1,69 +1,69 @@ -using System.Collections; -using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; - -namespace Recyclable.Collections -{ - public partial class RecyclableList : IRecyclableVersionedList - { - [VersionedCollectionsGenerator.CloneForVersioned] - VersionedEnumerator IRecyclableVersionedList.GetEnumerator() => new(this); - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - [VersionedCollectionsGenerator.CloneForVersioned] - public struct VersionedEnumerator : IEnumerator - { - private int _currentItemIndex; - private readonly ulong _enumeratorVersion; - private readonly RecyclableList _list; - -#nullable disable - [Pure] - public readonly T Current => _enumeratorVersion == _list._version ? _list._memoryBlock[_currentItemIndex - 1] : throw new InvalidOperationException(); - - [Pure] - readonly object IEnumerator.Current => _enumeratorVersion == _list._version ? _list._memoryBlock[_currentItemIndex - 1] : throw new InvalidOperationException(); -#nullable restore - - public bool MoveNext() - { - if (_enumeratorVersion != _list._version) - { - throw new InvalidOperationException(); - } - - Contract.EndContractBlock(); - - if (_currentItemIndex < _list._count) - { - _currentItemIndex++; - return true; - } - - return false; - } - - public VersionedEnumerator(RecyclableList list) - { - _currentItemIndex = 0; - _list = list; - _enumeratorVersion = list._version; - } - - [Pure] - public readonly void Dispose() - { - } - - void IEnumerator.Reset() - { - if (_enumeratorVersion != _list._version) - { - throw new InvalidOperationException(); - } - - _currentItemIndex = 0; - } - } - } -} +using System.Collections; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Recyclable.Collections +{ + public partial class RecyclableList : IRecyclableVersionedList + { + [VersionedCollectionsGenerator.CloneForVersioned] + VersionedEnumerator IRecyclableVersionedList.GetEnumerator() => new(this); + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + [VersionedCollectionsGenerator.CloneForVersioned] + public struct VersionedEnumerator : IEnumerator + { + private int _currentItemIndex; + private readonly ulong _enumeratorVersion; + private readonly RecyclableList _list; + +#nullable disable + [Pure] + public readonly T Current => _enumeratorVersion == _list._version ? _list._memoryBlock[_currentItemIndex - 1] : throw new InvalidOperationException(); + + [Pure] + readonly object IEnumerator.Current => _enumeratorVersion == _list._version ? _list._memoryBlock[_currentItemIndex - 1] : throw new InvalidOperationException(); +#nullable restore + + public bool MoveNext() + { + if (_enumeratorVersion != _list._version) + { + throw new InvalidOperationException(); + } + + Contract.EndContractBlock(); + + if (_currentItemIndex < _list._count) + { + _currentItemIndex++; + return true; + } + + return false; + } + + public VersionedEnumerator(RecyclableList list) + { + _currentItemIndex = 0; + _list = list; + _enumeratorVersion = list._version; + } + + [Pure] + public readonly void Dispose() + { + } + + void IEnumerator.Reset() + { + if (_enumeratorVersion != _list._version) + { + throw new InvalidOperationException(); + } + + _currentItemIndex = 0; + } + } + } +} diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 8f068dc..3918f9c 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -1,415 +1,415 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - [Serializable] - [VersionedCollectionsGenerator.GenerateVersioned] - public sealed partial class RecyclableList : IList, IReadOnlyList, IDisposable - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - public static explicit operator ReadOnlySpan(RecyclableList source) => new(source._memoryBlock, 0, source._count); - -#nullable disable - internal T[] _memoryBlock; -#nullable restore - - internal ulong _version; - [VersionedCollectionsGenerator.CloneForVersioned] - public ulong Version => _version; - - public RecyclableList() - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - } - - public RecyclableList(int initialCapacity) - { - if (initialCapacity >= RecyclableDefaults.InitialCapacity) - { - _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) - : new T[initialCapacity]; - _capacity = _memoryBlock.Length; - } - else - { - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - _capacity = RecyclableDefaults.InitialCapacity; - } - } - - public RecyclableList(int initialCapacity, int lowerBound) - { - if (initialCapacity >= RecyclableDefaults.InitialCapacity) - { - _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) - : new T[initialCapacity]; - _capacity = _memoryBlock.Length; - } - else - { - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - _capacity = RecyclableDefaults.InitialCapacity; - } - } - - public RecyclableList(in Array source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(RecyclableList source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(RecyclableLongList source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(ReadOnlySpan source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(in T[] source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(IReadOnlyList source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(List source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(ICollection source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(ICollection source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (initialCapacity >= RecyclableDefaults.InitialCapacity) - { - _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) - : new T[initialCapacity]; - _capacity = _memoryBlock.Length; - } - else - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - } - - zRecyclableListAddRange.AddRange(this, source, RecyclableDefaults.MinPooledArrayLength); - } - - public RecyclableList(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (initialCapacity >= RecyclableDefaults.InitialCapacity) - { - _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) - : new T[initialCapacity]; - _capacity = _memoryBlock.Length; - } - else - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - } - - zRecyclableListAddRange.AddRange(this, source); - } - - public RecyclableList(Span source) - { - _capacity = RecyclableDefaults.InitialCapacity; - _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; - zRecyclableListAddRange.AddRange(this, source); - } - - public T this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _memoryBlock[index]; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set - { - _memoryBlock[index] = value; - #if WITH_VERSIONING - _version++; - #endif - } - } - - internal int _capacity; - public int Capacity - { - get => _capacity; - set - { - if (_capacity != value) - { - _capacity = RecyclableListHelpers.EnsureCapacity(this, _count, checked((int)BitOperations.RoundUpToPowerOf2((uint)value))); - #if WITH_VERSIONING - _version++; - #endif - } - } - } - - internal int _count; - public int Count - { - get => _count; - set - { - if (_count != value) - { - if (value > _capacity) - { - _capacity = RecyclableListHelpers.EnsureCapacity(this, _capacity, checked((int)BitOperations.RoundUpToPowerOf2((uint)value))); - } - - _count = value; - #if WITH_VERSIONING - _version++; - #endif - } - } - } - - /// - /// Ensures that the capacity of this list is at least the specified value. - /// - /// The minimum capacity to ensure. - /// The new capacity of the list. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int EnsureCapacity(int capacity) - { - if (capacity > _capacity) - { - _capacity = RecyclableListHelpers.EnsureCapacity(this, _count, checked((int)BitOperations.RoundUpToPowerOf2((uint)capacity))); - } - - return _capacity; - } - - public bool IsReadOnly => false; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(T item) - { - if (_count >= _capacity) - { - if (BitOperations.IsPow2(_capacity)) - { - RecyclableListHelpers.EnsureCapacity(this); - } - else - { - _capacity = RecyclableListHelpers.EnsureCapacity(this, checked((int)BitOperations.RoundUpToPowerOf2((uint)_capacity))); - } - } - - _memoryBlock[_count++] = item; - #if WITH_VERSIONING - _version++; - #endif - } - - public T[] AsArray => _memoryBlock; - - [MethodImpl(MethodImplOptions.NoInlining)] - public void Clear() - { - if (_count == 0) - { - return; - } - - if (_needsClearing) - { - Array.Clear(_memoryBlock, 0, _count); - } - - _count = 0; - #if WITH_VERSIONING - _version++; - #endif - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Contains(T item) => _count != 0 && Array.IndexOf(_memoryBlock, item, 0, _count) >= 0; - - [MethodImpl(MethodImplOptions.NoInlining)] - public void CopyTo(T[] array, int index) => Array.Copy(_memoryBlock, 0, array, index, _count); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int IndexOf(T itemToFind) => _count != 0 - ? Array.IndexOf(_memoryBlock, itemToFind, 0, _count) - : RecyclableDefaults.ItemNotFoundIndex; - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public void Insert(int index, T item) - { - int oldCount = _count; - if (_capacity < oldCount + 1) - { - _capacity = RecyclableListHelpers.EnsureCapacity(this, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)oldCount + 1))); - } - - if (index < oldCount) - { - // TODO: Compare performance - // Array.Copy(_memoryBlock, index, _memoryBlock, index + 1, oldCount); - new ReadOnlySpan(_memoryBlock, index, oldCount -= index) - .CopyTo(new Span(_memoryBlock, index + 1, oldCount)); - } - - _memoryBlock[index] = item; - _count++; - #if WITH_VERSIONING - _version++; - #endif - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public bool Remove(T itemToRemove) - { - var index = IndexOf(itemToRemove); - if (index >= 0) - { - _count--; - if (index < _count) - { - Array.Copy(_memoryBlock, index + 1, _memoryBlock, index, _count - index); - } - - if (_needsClearing) - { - _memoryBlock[_count] = default; - } - - #if WITH_VERSIONING - _version++; - #endif - - return true; - } - - return false; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public void RemoveAt(int index) - { - if (index >= _count) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(index), $"Provided value {index} exceeds the no. of items on the list {_count}"); - } - - _count--; - if (index < _count) - { - Array.Copy(_memoryBlock, index + 1, _memoryBlock, index, _count - index); - } - - if (_needsClearing) - { - _memoryBlock[_count] = default; - } - - #if WITH_VERSIONING - _version++; - #endif - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VersionedCollectionsGenerator.CloneForVersioned] -#if WITH_VERSIONING - public VersionedEnumerator GetEnumerator() => new(this); -#else - public Enumerator GetEnumerator() => new(this); -#endif - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VersionedCollectionsGenerator.CloneForVersioned] -#if WITH_VERSIONING - IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); -#else - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); -#endif - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VersionedCollectionsGenerator.CloneForVersioned] -#if WITH_VERSIONING - IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); -#else - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); -#endif - - public void Dispose() - { - #if WITH_VERSIONING - _version++; - #endif - if (_count != 0) - { - if (_needsClearing) - { - Array.Clear(_memoryBlock, 0, _count); - } - - _count = 0; - } - - if (_capacity >= RecyclableDefaults.MinPooledArrayLength) - { - // If anything, it has been already cleared by .Clear(), Remove() or RemoveAt() methods, as the list was modified / disposed. - RecyclableArrayPool.ReturnShared(_memoryBlock, false); - } - - _capacity = 0; - GC.SuppressFinalize(this); - } - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + [Serializable] + [VersionedCollectionsGenerator.GenerateVersioned] + public sealed partial class RecyclableList : IList, IReadOnlyList, IDisposable + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + public static explicit operator ReadOnlySpan(RecyclableList source) => new(source._memoryBlock, 0, source._count); + +#nullable disable + internal T[] _memoryBlock; +#nullable restore + + internal ulong _version; + [VersionedCollectionsGenerator.CloneForVersioned] + public ulong Version => _version; + + public RecyclableList() + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + } + + public RecyclableList(int initialCapacity) + { + if (initialCapacity >= RecyclableDefaults.InitialCapacity) + { + _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) + : new T[initialCapacity]; + _capacity = _memoryBlock.Length; + } + else + { + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + _capacity = RecyclableDefaults.InitialCapacity; + } + } + + public RecyclableList(int initialCapacity, int lowerBound) + { + if (initialCapacity >= RecyclableDefaults.InitialCapacity) + { + _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) + : new T[initialCapacity]; + _capacity = _memoryBlock.Length; + } + else + { + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + _capacity = RecyclableDefaults.InitialCapacity; + } + } + + public RecyclableList(in Array source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(RecyclableList source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(RecyclableLongList source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(ReadOnlySpan source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(in T[] source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(IReadOnlyList source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(List source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(ICollection source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(ICollection source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (initialCapacity >= RecyclableDefaults.InitialCapacity) + { + _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) + : new T[initialCapacity]; + _capacity = _memoryBlock.Length; + } + else + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + } + + zRecyclableListAddRange.AddRange(this, source, RecyclableDefaults.MinPooledArrayLength); + } + + public RecyclableList(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (initialCapacity >= RecyclableDefaults.InitialCapacity) + { + _memoryBlock = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity))) + : new T[initialCapacity]; + _capacity = _memoryBlock.Length; + } + else + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + } + + zRecyclableListAddRange.AddRange(this, source); + } + + public RecyclableList(Span source) + { + _capacity = RecyclableDefaults.InitialCapacity; + _memoryBlock = new T[RecyclableDefaults.InitialCapacity]; + zRecyclableListAddRange.AddRange(this, source); + } + + public T this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _memoryBlock[index]; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set + { + _memoryBlock[index] = value; + #if WITH_VERSIONING + _version++; + #endif + } + } + + internal int _capacity; + public int Capacity + { + get => _capacity; + set + { + if (_capacity != value) + { + _capacity = RecyclableListHelpers.EnsureCapacity(this, _count, checked((int)BitOperations.RoundUpToPowerOf2((uint)value))); + #if WITH_VERSIONING + _version++; + #endif + } + } + } + + internal int _count; + public int Count + { + get => _count; + set + { + if (_count != value) + { + if (value > _capacity) + { + _capacity = RecyclableListHelpers.EnsureCapacity(this, _capacity, checked((int)BitOperations.RoundUpToPowerOf2((uint)value))); + } + + _count = value; + #if WITH_VERSIONING + _version++; + #endif + } + } + } + + /// + /// Ensures that the capacity of this list is at least the specified value. + /// + /// The minimum capacity to ensure. + /// The new capacity of the list. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int EnsureCapacity(int capacity) + { + if (capacity > _capacity) + { + _capacity = RecyclableListHelpers.EnsureCapacity(this, _count, checked((int)BitOperations.RoundUpToPowerOf2((uint)capacity))); + } + + return _capacity; + } + + public bool IsReadOnly => false; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(T item) + { + if (_count >= _capacity) + { + if (BitOperations.IsPow2(_capacity)) + { + RecyclableListHelpers.EnsureCapacity(this); + } + else + { + _capacity = RecyclableListHelpers.EnsureCapacity(this, checked((int)BitOperations.RoundUpToPowerOf2((uint)_capacity))); + } + } + + _memoryBlock[_count++] = item; + #if WITH_VERSIONING + _version++; + #endif + } + + public T[] AsArray => _memoryBlock; + + [MethodImpl(MethodImplOptions.NoInlining)] + public void Clear() + { + if (_count == 0) + { + return; + } + + if (_needsClearing) + { + Array.Clear(_memoryBlock, 0, _count); + } + + _count = 0; + #if WITH_VERSIONING + _version++; + #endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(T item) => _count != 0 && Array.IndexOf(_memoryBlock, item, 0, _count) >= 0; + + [MethodImpl(MethodImplOptions.NoInlining)] + public void CopyTo(T[] array, int index) => Array.Copy(_memoryBlock, 0, array, index, _count); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int IndexOf(T itemToFind) => _count != 0 + ? Array.IndexOf(_memoryBlock, itemToFind, 0, _count) + : RecyclableDefaults.ItemNotFoundIndex; + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public void Insert(int index, T item) + { + int oldCount = _count; + if (_capacity < oldCount + 1) + { + _capacity = RecyclableListHelpers.EnsureCapacity(this, oldCount, checked((int)BitOperations.RoundUpToPowerOf2((uint)oldCount + 1))); + } + + if (index < oldCount) + { + // TODO: Compare performance + // Array.Copy(_memoryBlock, index, _memoryBlock, index + 1, oldCount); + new ReadOnlySpan(_memoryBlock, index, oldCount -= index) + .CopyTo(new Span(_memoryBlock, index + 1, oldCount)); + } + + _memoryBlock[index] = item; + _count++; + #if WITH_VERSIONING + _version++; + #endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public bool Remove(T itemToRemove) + { + var index = IndexOf(itemToRemove); + if (index >= 0) + { + _count--; + if (index < _count) + { + Array.Copy(_memoryBlock, index + 1, _memoryBlock, index, _count - index); + } + + if (_needsClearing) + { + _memoryBlock[_count] = default; + } + + #if WITH_VERSIONING + _version++; + #endif + + return true; + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public void RemoveAt(int index) + { + if (index >= _count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(index), $"Provided value {index} exceeds the no. of items on the list {_count}"); + } + + _count--; + if (index < _count) + { + Array.Copy(_memoryBlock, index + 1, _memoryBlock, index, _count - index); + } + + if (_needsClearing) + { + _memoryBlock[_count] = default; + } + + #if WITH_VERSIONING + _version++; + #endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VersionedCollectionsGenerator.CloneForVersioned] +#if WITH_VERSIONING + public VersionedEnumerator GetEnumerator() => new(this); +#else + public Enumerator GetEnumerator() => new(this); +#endif + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VersionedCollectionsGenerator.CloneForVersioned] +#if WITH_VERSIONING + IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); +#else + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); +#endif + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VersionedCollectionsGenerator.CloneForVersioned] +#if WITH_VERSIONING + IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); +#else + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); +#endif + + public void Dispose() + { + #if WITH_VERSIONING + _version++; + #endif + if (_count != 0) + { + if (_needsClearing) + { + Array.Clear(_memoryBlock, 0, _count); + } + + _count = 0; + } + + if (_capacity >= RecyclableDefaults.MinPooledArrayLength) + { + // If anything, it has been already cleared by .Clear(), Remove() or RemoveAt() methods, as the list was modified / disposed. + RecyclableArrayPool.ReturnShared(_memoryBlock, false); + } + + _capacity = 0; + GC.SuppressFinalize(this); + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.AddRange.cs b/Recyclable.Collections/RecyclableLongList.AddRange.cs index 9e1bd79..9131b24 100644 --- a/Recyclable.Collections/RecyclableLongList.AddRange.cs +++ b/Recyclable.Collections/RecyclableLongList.AddRange.cs @@ -1,1293 +1,1293 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Linq.Expressions; -using System.Reflection; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - public static class zRecyclableLongListAddRange - { - - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableLongListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableLongList<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableLongList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableLongListAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableLongList<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var listParam = Expression.Parameter(typeof(RecyclableLongList)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclableLongList list, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(list, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(list, items); - return true; - } - - return false; - } - } - - private static void AddRangeEnumerated(this RecyclableLongList targetList, IEnumerable items) - { - using IEnumerator enumerator = items.GetEnumerator(); - if (!enumerator.MoveNext()) - { - return; - } - - int blockSize = targetList._blockSize, - targetBlockIdx = targetList._nextItemBlockIndex, - targetItemIdx = targetList._nextItemIndex; - - long capacity = targetList._capacity, - copied = targetList._longCount, - available = capacity - copied, - i; - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span blockArraySpan; - - while (true) - { - if (copied + blockSize > capacity) - { - capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)(capacity + blockSize)))); - memoryBlocksSpan = targetList._memoryBlocks; - available = capacity - copied; - } - - blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - for (i = 1; i <= available; i++) - { - blockArraySpan[targetItemIdx++] = enumerator.Current; - - if (!enumerator.MoveNext()) - { - targetList._lastBlockWithData = targetBlockIdx; - targetList._longCount += copied + i - targetList._longCount; - if (targetItemIdx < blockSize) - { - targetList._nextItemBlockIndex = targetBlockIdx; - targetList._nextItemIndex = targetItemIdx; - } - else - { - targetList._nextItemBlockIndex = targetBlockIdx + 1; - targetList._nextItemIndex = 0; - } - - targetList._capacity = capacity; - #if WITH_VERSIONING -targetList._version++; -#endif - return; - } - - if (targetItemIdx == blockSize) - { - targetBlockIdx++; - targetItemIdx = 0; - if (i == available) - { - break; - } - - blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - } - } - - copied += available; - } - } - - private static void AddRangeWithKnownCount(this RecyclableLongList targetList, IEnumerable items, int requiredAdditionalCapacity) - { - long requiredCapacity = targetList._longCount + requiredAdditionalCapacity; - if (requiredCapacity == 0) - { - return; - } - - int blockSize = targetList._blockSize, - targetBlockIdx = targetList._nextItemBlockIndex, - targetItemIdx = targetList._nextItemIndex; - - if (targetList._capacity < requiredCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)requiredCapacity))); - } - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - foreach (var item in items) - { - blockArraySpan[targetItemIdx++] = item; - if (targetItemIdx == blockSize) - { - targetBlockIdx++; - targetItemIdx = 0; - if (targetBlockIdx == memoryBlocksSpan.Length) - { - break; - } - - blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - } - } - - targetList._longCount = requiredCapacity; - targetList._nextItemBlockIndex = targetBlockIdx; - targetList._nextItemIndex = targetItemIdx; - targetList._lastBlockWithData = targetBlockIdx - (targetItemIdx > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [VersionedCollectionsGenerator.RewriteForVersioned] - public static void AddRange(this RecyclableLongList targetList, in Array items) - { - if (items.LongLength == 0) - { - return; - } - - int blockSize = targetList._blockSize, - targetBlockIndex = targetList._nextItemBlockIndex; - - long fullBlockItemsCount = items.LongLength - blockSize, - sourceItemIndex = Math.Min(blockSize - targetList._nextItemIndex, items.LongLength), - targetCapacity = targetList._longCount + items.LongLength; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Array.Copy(items, 0, memoryBlocksSpan[targetBlockIndex++], targetList._nextItemIndex, sourceItemIndex); - while (sourceItemIndex < fullBlockItemsCount) - { - Array.Copy(items, sourceItemIndex, memoryBlocksSpan[targetBlockIndex++], 0, blockSize); - sourceItemIndex += blockSize; - } - - // We're reusing a variable which is no longer needed. That's to avoid unnecessary - // allocation. - if ((blockSize = (int)(items.LongLength - sourceItemIndex)) > 0) - { - Array.Copy(items, sourceItemIndex, memoryBlocksSpan[targetBlockIndex], 0, blockSize); - targetList._lastBlockWithData = targetBlockIndex; - targetList._nextItemBlockIndex = targetBlockIndex; - targetList._nextItemIndex = blockSize; - } - else - { - targetList._lastBlockWithData = targetBlockIndex - 1; - if (targetList._nextItemIndex + sourceItemIndex >= targetList._blockSize) - { - targetList._nextItemBlockIndex = targetBlockIndex; - targetList._nextItemIndex = 0; - } - else - { - targetList._nextItemIndex += checked((int)sourceItemIndex); - } - } - - targetList._longCount = targetCapacity; - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, ICollection items) - { - if (items.Count == 0) - { - return; - } - - int targetBlockIndex = targetList._nextItemBlockIndex; - long targetCapacity = targetList._longCount + items.Count; - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - // We're better off to temporarily copy it to a fixed array, - // than copying them item by item. We may run into OOMs, though. - T[] itemsBuffer = items.Count >= RecyclableDefaults.MinPooledArrayLength ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)items.Count))) : new T[items.Count]; - items.CopyTo(itemsBuffer, 0); - - ReadOnlySpan itemsSpan = new(itemsBuffer, 0, items.Count); - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - while (targetBlockArraySpan.Length <= itemsSpan.Length) - { - itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); - itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; - targetBlockIndex++; - if (itemsSpan.Length == 0) - { - break; - } - - targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; - } - - if (itemsSpan.Length > 0) - { - itemsSpan.CopyTo(targetBlockArraySpan); - if (targetList._nextItemBlockIndex != targetBlockIndex) - { - targetList._nextItemIndex = itemsSpan.Length; - targetList._nextItemBlockIndex = targetBlockIndex; - } - else - { - targetList._nextItemIndex += itemsSpan.Length; - } - } - else - { - targetList._nextItemIndex = 0; - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = targetBlockIndex; - targetList._lastBlockWithData = targetBlockIndex - (itemsSpan.Length > 0 ? 0 : 1); - - if (items.Count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(itemsBuffer, RecyclableLongList._needsClearing); - } - - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, ICollection items) - { - if (items.Count == 0) - { - return; - } - - int targetBlockIndex = targetList._nextItemBlockIndex; - - long targetCapacity = targetList._longCount + items.Count; - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - // We're better off to temporarily copy it to a fixed array, - // than copying them item by item. We may run into OOMs, though. - T[] itemsBuffer = items.Count >= RecyclableDefaults.MinPooledArrayLength ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)items.Count))) : new T[items.Count]; - - items.CopyTo(itemsBuffer, 0); - - ReadOnlySpan itemsSpan = new(itemsBuffer, 0, items.Count); - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - - while (targetBlockArraySpan.Length <= itemsSpan.Length) - { - itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); - itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; - targetBlockIndex++; - if (itemsSpan.Length == 0) - { - break; - } - - targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; - } - - if (itemsSpan.Length > 0) - { - itemsSpan.CopyTo(targetBlockArraySpan); - if (targetList._nextItemBlockIndex != targetBlockIndex) - { - targetList._nextItemIndex = itemsSpan.Length; - targetList._nextItemBlockIndex = targetBlockIndex; - } - else - { - targetList._nextItemIndex += itemsSpan.Length; - } - } - else - { - targetList._nextItemIndex = 0; - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = targetBlockIndex; - targetList._lastBlockWithData = targetBlockIndex - (itemsSpan.Length > 0 ? 0 : 1); - - if (items.Count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(itemsBuffer, RecyclableLongList._needsClearing); - } - - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, IEnumerable source) - { - IEnumerator enumerator = source.GetEnumerator(); - if (!enumerator.MoveNext()) - { - return; - } - - int blockSize = targetList._blockSize, - targetBlockIdx = targetList._nextItemBlockIndex, - targetItemIdx = targetList._nextItemIndex; - - long capacity = targetList._capacity, - copied = targetList._longCount, - available = capacity - copied, - i; - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span blockArraySpan; - - while (true) - { - if (copied + blockSize > capacity) - { - capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)(capacity + blockSize)))); - memoryBlocksSpan = targetList._memoryBlocks; - available = capacity - copied; - } - - blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - for (i = 1; i <= available; i++) - { - blockArraySpan[targetItemIdx++] = (T)enumerator.Current; - - if (!enumerator.MoveNext()) - { - targetList._lastBlockWithData = targetBlockIdx; - targetList._longCount += copied + i - targetList._longCount; - if (targetItemIdx < blockSize) - { - targetList._nextItemBlockIndex = targetBlockIdx; - targetList._nextItemIndex = targetItemIdx; - } - else - { - targetList._nextItemBlockIndex = targetBlockIdx + 1; - targetList._nextItemIndex = 0; - } - - targetList._capacity = capacity; - return; - } - - if (targetItemIdx == blockSize) - { - targetBlockIdx++; - targetItemIdx = 0; - - if (i == available) - { - break; - } - - blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - } - } - - copied += available; - } - } - - public static void AddRange(this RecyclableLongList targetList, IEnumerable items) - { - switch (items) - { - case RecyclableList sourceRecyclableList: - targetList.AddRange(sourceRecyclableList); - return; - - case RecyclableLongList sourceRecyclableLongList: - targetList.AddRange(sourceRecyclableLongList); - return; - - case T[] sourceArray: - targetList.AddRange(sourceArray); - return; - - case Array sourceArrayWithObjects: - targetList.AddRange(sourceArrayWithObjects); - return; - - case List sourceList: - targetList.AddRange(sourceList); - return; - - case ICollection sourceICollection: - targetList.AddRange(sourceICollection); - return; - - case ICollection sourceICollectionWithObjects: - targetList.AddRange(sourceICollectionWithObjects); - return; - - case IReadOnlyList sourceIReadOnlyList: - targetList.AddRange(sourceIReadOnlyList); - return; - - case RecyclableHashSet sourceHashSet: - targetList.AddRange(sourceHashSet); - return; - - case RecyclableStack sourceStack: - targetList.AddRange(sourceStack); - return; - - case RecyclableSortedSet sourceSortedSet: - targetList.AddRange(sourceSortedSet); - return; - - case RecyclableLinkedList sourceLinkedList: - targetList.AddRange(sourceLinkedList); - return; - - case RecyclablePriorityQueue sourcePriorityQueue: - targetList.AddRange(sourcePriorityQueue); - return; - - case RecyclableQueue sourceQueue: - targetList.AddRange(sourceQueue); - return; - - default: - if (AddRangeHelper.TryAddRange(targetList, items)) - { - return; - } - - if (items.TryGetNonEnumeratedCount(out var requiredAdditionalCapacity)) - { - targetList.AddRangeWithKnownCount(items, requiredAdditionalCapacity); - } - else - { - targetList.AddRangeEnumerated(items); - } - - return; - } - } - - public static void AddRange(this RecyclableLongList targetList, IReadOnlyList items) - { - long sourceItemsCount = items.Count, - requiredCapacity = targetList._longCount + sourceItemsCount; - - if (requiredCapacity == 0) - { - return; - } - - int blockSize = targetList._blockSize, - targetBlockIdx = targetList._nextItemBlockIndex, - targetItemIdx = targetList._nextItemIndex; - - if (targetList._capacity < requiredCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)requiredCapacity))); - } - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - - for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) - { - blockArraySpan[targetItemIdx++] = items[itemIndex]; - if (targetItemIdx == blockSize) - { - targetItemIdx = 0; - targetBlockIdx++; - if (itemIndex + 1 == sourceItemsCount) - { - break; - } - - blockArraySpan = memoryBlocksSpan[targetBlockIdx]; - } - } - - targetList._longCount = requiredCapacity; - targetList._nextItemBlockIndex = targetBlockIdx; - targetList._nextItemIndex = targetItemIdx; - targetList._lastBlockWithData = targetBlockIdx - (targetItemIdx > 0 ? 0 : 1); - } - - public static void AddRange(this RecyclableLongList targetList, List items) - { - if (items.Count == 0) - { - return; - } - - int blockSize = targetList._blockSize, - itemsCount = items.Count, - copied = Math.Min(blockSize - targetList._nextItemIndex, itemsCount), - targetBlockIndex = targetList._nextItemBlockIndex; - - long targetCapacity = targetList._longCount + items.Count; - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - items.CopyTo(0, memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, copied); - - if (targetList._nextItemIndex + copied == blockSize) - { - targetBlockIndex++; - targetList._nextItemIndex = 0; - } - else - { - targetList._nextItemIndex += copied; - } - - while (blockSize <= itemsCount - copied) - { - items.CopyTo(copied, memoryBlocksSpan[targetBlockIndex++], 0, blockSize); - copied += blockSize; - } - - if ((itemsCount - copied < blockSize) && (itemsCount - copied != 0)) - { - targetList._nextItemIndex = itemsCount - copied; - items.CopyTo(copied, memoryBlocksSpan[targetBlockIndex], 0, targetList._nextItemIndex); - } - - targetList._nextItemBlockIndex = targetBlockIndex; - targetList._longCount = targetCapacity; - targetList._lastBlockWithData = targetBlockIndex - (targetList._nextItemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, ReadOnlySpan items) - { - if (items.Length == 0) - { - return; - } - - int targetBlockIndex = targetList._nextItemBlockIndex; - - long targetCapacity = targetList._longCount + items.Length; - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - - while (items.Length >= targetBlockArraySpan.Length) - { - items[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); - items = items[targetBlockArraySpan.Length..]; - if (items.Length == 0) - { - break; - } - - targetBlockIndex++; - targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; - } - - if (items.Length > 0) - { - items.CopyTo(targetBlockArraySpan); - if (targetList._nextItemBlockIndex != targetBlockIndex) - { - targetList._nextItemIndex = items.Length; - targetList._nextItemBlockIndex = targetBlockIndex; - } - else - { - targetList._nextItemIndex += items.Length; - } - } - else - { - targetList._nextItemBlockIndex = targetBlockIndex + 1; - targetList._nextItemIndex = 0; - } - - targetList._longCount = targetCapacity; - targetList._lastBlockWithData = targetBlockIndex; - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, RecyclableList items) - { - if (items._count == 0) - { - return; - } - - int targetBlockIndex = targetList._nextItemBlockIndex; - - long targetCapacity = targetList._longCount + items._count; - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan itemsSpan = new(items._memoryBlock, 0, items._count); - ReadOnlySpan targetMemoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(targetMemoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - - while (itemsSpan.Length >= targetBlockArraySpan.Length) - { - itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); - itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; - targetBlockIndex++; - if (itemsSpan.Length == 0) - { - break; - } - - targetBlockArraySpan = targetMemoryBlocksSpan[targetBlockIndex]; - } - - if (itemsSpan.Length > 0) - { - itemsSpan.CopyTo(targetBlockArraySpan); - targetList._lastBlockWithData = targetBlockIndex; - if (targetList._nextItemBlockIndex != targetBlockIndex) - { - targetList._nextItemIndex = itemsSpan.Length; - targetList._nextItemBlockIndex = targetBlockIndex; - } - else - { - targetList._nextItemIndex += itemsSpan.Length; - } - } - else - { - targetList._lastBlockWithData = targetBlockIndex - 1; - targetList._nextItemBlockIndex = targetBlockIndex; - targetList._nextItemIndex = 0; - } - - targetList._longCount = targetCapacity; - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, RecyclableLongList items) - { - if (items._longCount == 0) - { - return; - } - - int sourceBlockIndex = 0, - targetBlockIndex = targetList._nextItemBlockIndex, - toCopy; - - long copiedCount = 0, - itemsCount = items._longCount, - targetCapacity = targetList._longCount + itemsCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan sourceMemoryBlocksSpan = items._memoryBlocks; - ReadOnlySpan itemsSpan = sourceMemoryBlocksSpan[sourceBlockIndex]; - ReadOnlySpan targetMemoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(targetMemoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - - while (copiedCount < itemsCount) - { - toCopy = (int)Math.Min(itemsCount - copiedCount, itemsSpan.Length); - if (targetBlockArraySpan.Length < toCopy) - { - toCopy = targetBlockArraySpan.Length; - itemsSpan[..toCopy].CopyTo(targetBlockArraySpan); - targetBlockIndex++; - targetBlockArraySpan = targetMemoryBlocksSpan[targetBlockIndex]; - itemsSpan = itemsSpan[toCopy..]; - copiedCount += toCopy; - } - else - { - itemsSpan[..toCopy].CopyTo(targetBlockArraySpan); - targetBlockArraySpan = targetBlockArraySpan[toCopy..]; - itemsSpan = itemsSpan[toCopy..]; - if (itemsSpan.IsEmpty && sourceBlockIndex + 1 < sourceMemoryBlocksSpan.Length) - { - sourceBlockIndex++; - itemsSpan = sourceMemoryBlocksSpan[sourceBlockIndex]; - } - - copiedCount += toCopy; - if (targetBlockArraySpan.IsEmpty && copiedCount < itemsCount) - { - targetBlockIndex++; - targetBlockArraySpan = targetMemoryBlocksSpan[targetBlockIndex]; - } - } - } - - targetList._lastBlockWithData = targetBlockIndex; - if ((targetCapacity & targetList._blockSizeMinus1) == 0) - { - targetList._nextItemIndex = 0; - targetList._nextItemBlockIndex = targetBlockIndex + 1; - } - else - { - targetList._nextItemIndex = (int)(targetCapacity & targetList._blockSizeMinus1); - targetList._nextItemBlockIndex = targetBlockIndex; - } - - targetList._longCount = targetCapacity; - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, Span items) - { - if (items.Length == 0) - { - return; - } - - int targetBlockIndex = targetList._nextItemBlockIndex; - long targetCapacity = targetList._longCount + items.Length; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - - while (items.Length >= targetBlockArraySpan.Length) - { - items[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); - items = items[targetBlockArraySpan.Length..]; - if (items.Length == 0) - { - break; - } - - targetBlockIndex++; - targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; - } - - if (items.Length > 0) - { - items.CopyTo(targetBlockArraySpan); - if (targetList._nextItemBlockIndex != targetBlockIndex) - { - targetList._nextItemIndex = items.Length; - targetList._nextItemBlockIndex = targetBlockIndex; - } - else - { - targetList._nextItemIndex += items.Length; - } - } - else - { - targetList._nextItemBlockIndex = targetBlockIndex + 1; - targetList._nextItemIndex = 0; - } - - targetList._longCount = targetCapacity; - targetList._lastBlockWithData = targetBlockIndex; - #if WITH_VERSIONING -targetList._version++; -#endif - } - - public static void AddRange(this RecyclableLongList targetList, in T[] items) - { - if (items.LongLength == 0) - { - return; - } - - int targetBlockIndex = targetList._nextItemBlockIndex; - - long targetCapacity = targetList._longCount + items.LongLength; - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - ReadOnlySpan itemsSpan = items; - ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; - Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); - - while (itemsSpan.Length >= targetBlockArraySpan.Length) - { - itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); - itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; - if (itemsSpan.Length == 0) - { - break; - } - - targetBlockIndex++; - targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; - } - - if (itemsSpan.Length > 0) - { - itemsSpan.CopyTo(targetBlockArraySpan); - if (targetList._nextItemBlockIndex != targetBlockIndex) - { - targetList._nextItemIndex = itemsSpan.Length; - targetList._nextItemBlockIndex = targetBlockIndex; - } - else - { - targetList._nextItemIndex += itemsSpan.Length; - } - } - else - { - targetList._nextItemBlockIndex = targetBlockIndex + 1; - targetList._nextItemIndex = 0; - } - - targetList._longCount = targetCapacity; - targetList._lastBlockWithData = targetBlockIndex; - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList targetList, RecyclableHashSet items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (long i = 0; i < sourceCount; i++) - { - blocks[blockIndex][itemIndex++] = entries[i >> shift][(int)(i & mask)].Value; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList targetList, RecyclableStack items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - var chunk = items._current; - while (chunk != null) - { - var array = chunk.Value; - for (int i = chunk.Index - 1; i >= 0; i--) - { - blocks[blockIndex][itemIndex++] = array[i]; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - chunk = chunk.Previous; - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList targetList, RecyclableSortedSet items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - int idx = 0; - while (idx < items._count) - { - blocks[blockIndex][itemIndex++] = items._items[idx++]; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList targetList, RecyclableLinkedList items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - var chunk = items._head; - while (chunk != null) - { - for (int i = chunk.Bottom; i < chunk.Top; i++) - { - blocks[blockIndex][itemIndex++] = chunk.Value[i]; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - chunk = chunk.Next; - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList targetList, RecyclablePriorityQueue items) - { - if (items._size == 0) - { - return; - } - - long sourceCount = items._size, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - int idx = 0; - while (idx < items._size) - { - blocks[blockIndex][itemIndex++] = items._heap[idx++]; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList targetList, RecyclableQueue items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - var chunkQ = items._head; - while (chunkQ != null) - { - for (int i = chunkQ.Bottom; i < chunkQ.Top; i++) - { - blocks[blockIndex][itemIndex++] = chunkQ.Value[i]; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - chunkQ = chunkQ.Next; - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList> targetList, RecyclableDictionary items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList>.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (long i = 0; i < sourceCount; i++) - { - ref var entry = ref entries[i >> shift][(int)(i & mask)]; - blocks[blockIndex][itemIndex++] = new KeyValuePair(entry.Key, entry.Value); - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableLongList<(TKey Key, TValue Value)> targetList, RecyclableSortedList items) - { - if (items._count == 0) - { - return; - } - - long sourceCount = items._count, - targetCapacity = targetList._longCount + sourceCount; - - if (targetList._capacity < targetCapacity) - { - targetList._capacity = RecyclableLongList<(TKey Key, TValue Value)>.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); - } - - var blocks = targetList._memoryBlocks; - int blockIndex = targetList._nextItemBlockIndex, - itemIndex = targetList._nextItemIndex, - blockSize = targetList._blockSize; - - int idx2 = 0; - while (idx2 < items._count) - { - blocks[blockIndex][itemIndex++] = (items._keys[idx2], items._values[idx2]); - idx2++; - if (itemIndex == blockSize) - { - itemIndex = 0; - blockIndex++; - } - } - - targetList._longCount = targetCapacity; - targetList._nextItemBlockIndex = blockIndex; - targetList._nextItemIndex = itemIndex; - targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); - #if WITH_VERSIONING -targetList._version++; -#endif - } - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Linq.Expressions; +using System.Reflection; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + public static class zRecyclableLongListAddRange + { + + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableLongListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableLongList<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableLongList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableLongListAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableLongList<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var listParam = Expression.Parameter(typeof(RecyclableLongList)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, listParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, listParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclableLongList list, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(list, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(list, items); + return true; + } + + return false; + } + } + + private static void AddRangeEnumerated(this RecyclableLongList targetList, IEnumerable items) + { + using IEnumerator enumerator = items.GetEnumerator(); + if (!enumerator.MoveNext()) + { + return; + } + + int blockSize = targetList._blockSize, + targetBlockIdx = targetList._nextItemBlockIndex, + targetItemIdx = targetList._nextItemIndex; + + long capacity = targetList._capacity, + copied = targetList._longCount, + available = capacity - copied, + i; + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span blockArraySpan; + + while (true) + { + if (copied + blockSize > capacity) + { + capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)(capacity + blockSize)))); + memoryBlocksSpan = targetList._memoryBlocks; + available = capacity - copied; + } + + blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + for (i = 1; i <= available; i++) + { + blockArraySpan[targetItemIdx++] = enumerator.Current; + + if (!enumerator.MoveNext()) + { + targetList._lastBlockWithData = targetBlockIdx; + targetList._longCount += copied + i - targetList._longCount; + if (targetItemIdx < blockSize) + { + targetList._nextItemBlockIndex = targetBlockIdx; + targetList._nextItemIndex = targetItemIdx; + } + else + { + targetList._nextItemBlockIndex = targetBlockIdx + 1; + targetList._nextItemIndex = 0; + } + + targetList._capacity = capacity; + #if WITH_VERSIONING +targetList._version++; +#endif + return; + } + + if (targetItemIdx == blockSize) + { + targetBlockIdx++; + targetItemIdx = 0; + if (i == available) + { + break; + } + + blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + } + } + + copied += available; + } + } + + private static void AddRangeWithKnownCount(this RecyclableLongList targetList, IEnumerable items, int requiredAdditionalCapacity) + { + long requiredCapacity = targetList._longCount + requiredAdditionalCapacity; + if (requiredCapacity == 0) + { + return; + } + + int blockSize = targetList._blockSize, + targetBlockIdx = targetList._nextItemBlockIndex, + targetItemIdx = targetList._nextItemIndex; + + if (targetList._capacity < requiredCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)requiredCapacity))); + } + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + foreach (var item in items) + { + blockArraySpan[targetItemIdx++] = item; + if (targetItemIdx == blockSize) + { + targetBlockIdx++; + targetItemIdx = 0; + if (targetBlockIdx == memoryBlocksSpan.Length) + { + break; + } + + blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + } + } + + targetList._longCount = requiredCapacity; + targetList._nextItemBlockIndex = targetBlockIdx; + targetList._nextItemIndex = targetItemIdx; + targetList._lastBlockWithData = targetBlockIdx - (targetItemIdx > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [VersionedCollectionsGenerator.RewriteForVersioned] + public static void AddRange(this RecyclableLongList targetList, in Array items) + { + if (items.LongLength == 0) + { + return; + } + + int blockSize = targetList._blockSize, + targetBlockIndex = targetList._nextItemBlockIndex; + + long fullBlockItemsCount = items.LongLength - blockSize, + sourceItemIndex = Math.Min(blockSize - targetList._nextItemIndex, items.LongLength), + targetCapacity = targetList._longCount + items.LongLength; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Array.Copy(items, 0, memoryBlocksSpan[targetBlockIndex++], targetList._nextItemIndex, sourceItemIndex); + while (sourceItemIndex < fullBlockItemsCount) + { + Array.Copy(items, sourceItemIndex, memoryBlocksSpan[targetBlockIndex++], 0, blockSize); + sourceItemIndex += blockSize; + } + + // We're reusing a variable which is no longer needed. That's to avoid unnecessary + // allocation. + if ((blockSize = (int)(items.LongLength - sourceItemIndex)) > 0) + { + Array.Copy(items, sourceItemIndex, memoryBlocksSpan[targetBlockIndex], 0, blockSize); + targetList._lastBlockWithData = targetBlockIndex; + targetList._nextItemBlockIndex = targetBlockIndex; + targetList._nextItemIndex = blockSize; + } + else + { + targetList._lastBlockWithData = targetBlockIndex - 1; + if (targetList._nextItemIndex + sourceItemIndex >= targetList._blockSize) + { + targetList._nextItemBlockIndex = targetBlockIndex; + targetList._nextItemIndex = 0; + } + else + { + targetList._nextItemIndex += checked((int)sourceItemIndex); + } + } + + targetList._longCount = targetCapacity; + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, ICollection items) + { + if (items.Count == 0) + { + return; + } + + int targetBlockIndex = targetList._nextItemBlockIndex; + long targetCapacity = targetList._longCount + items.Count; + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + // We're better off to temporarily copy it to a fixed array, + // than copying them item by item. We may run into OOMs, though. + T[] itemsBuffer = items.Count >= RecyclableDefaults.MinPooledArrayLength ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)items.Count))) : new T[items.Count]; + items.CopyTo(itemsBuffer, 0); + + ReadOnlySpan itemsSpan = new(itemsBuffer, 0, items.Count); + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + while (targetBlockArraySpan.Length <= itemsSpan.Length) + { + itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); + itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; + targetBlockIndex++; + if (itemsSpan.Length == 0) + { + break; + } + + targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; + } + + if (itemsSpan.Length > 0) + { + itemsSpan.CopyTo(targetBlockArraySpan); + if (targetList._nextItemBlockIndex != targetBlockIndex) + { + targetList._nextItemIndex = itemsSpan.Length; + targetList._nextItemBlockIndex = targetBlockIndex; + } + else + { + targetList._nextItemIndex += itemsSpan.Length; + } + } + else + { + targetList._nextItemIndex = 0; + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = targetBlockIndex; + targetList._lastBlockWithData = targetBlockIndex - (itemsSpan.Length > 0 ? 0 : 1); + + if (items.Count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(itemsBuffer, RecyclableLongList._needsClearing); + } + + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, ICollection items) + { + if (items.Count == 0) + { + return; + } + + int targetBlockIndex = targetList._nextItemBlockIndex; + + long targetCapacity = targetList._longCount + items.Count; + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + // We're better off to temporarily copy it to a fixed array, + // than copying them item by item. We may run into OOMs, though. + T[] itemsBuffer = items.Count >= RecyclableDefaults.MinPooledArrayLength ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)items.Count))) : new T[items.Count]; + + items.CopyTo(itemsBuffer, 0); + + ReadOnlySpan itemsSpan = new(itemsBuffer, 0, items.Count); + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + + while (targetBlockArraySpan.Length <= itemsSpan.Length) + { + itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); + itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; + targetBlockIndex++; + if (itemsSpan.Length == 0) + { + break; + } + + targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; + } + + if (itemsSpan.Length > 0) + { + itemsSpan.CopyTo(targetBlockArraySpan); + if (targetList._nextItemBlockIndex != targetBlockIndex) + { + targetList._nextItemIndex = itemsSpan.Length; + targetList._nextItemBlockIndex = targetBlockIndex; + } + else + { + targetList._nextItemIndex += itemsSpan.Length; + } + } + else + { + targetList._nextItemIndex = 0; + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = targetBlockIndex; + targetList._lastBlockWithData = targetBlockIndex - (itemsSpan.Length > 0 ? 0 : 1); + + if (items.Count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(itemsBuffer, RecyclableLongList._needsClearing); + } + + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, IEnumerable source) + { + IEnumerator enumerator = source.GetEnumerator(); + if (!enumerator.MoveNext()) + { + return; + } + + int blockSize = targetList._blockSize, + targetBlockIdx = targetList._nextItemBlockIndex, + targetItemIdx = targetList._nextItemIndex; + + long capacity = targetList._capacity, + copied = targetList._longCount, + available = capacity - copied, + i; + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span blockArraySpan; + + while (true) + { + if (copied + blockSize > capacity) + { + capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)(capacity + blockSize)))); + memoryBlocksSpan = targetList._memoryBlocks; + available = capacity - copied; + } + + blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + for (i = 1; i <= available; i++) + { + blockArraySpan[targetItemIdx++] = (T)enumerator.Current; + + if (!enumerator.MoveNext()) + { + targetList._lastBlockWithData = targetBlockIdx; + targetList._longCount += copied + i - targetList._longCount; + if (targetItemIdx < blockSize) + { + targetList._nextItemBlockIndex = targetBlockIdx; + targetList._nextItemIndex = targetItemIdx; + } + else + { + targetList._nextItemBlockIndex = targetBlockIdx + 1; + targetList._nextItemIndex = 0; + } + + targetList._capacity = capacity; + return; + } + + if (targetItemIdx == blockSize) + { + targetBlockIdx++; + targetItemIdx = 0; + + if (i == available) + { + break; + } + + blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + } + } + + copied += available; + } + } + + public static void AddRange(this RecyclableLongList targetList, IEnumerable items) + { + switch (items) + { + case RecyclableList sourceRecyclableList: + targetList.AddRange(sourceRecyclableList); + return; + + case RecyclableLongList sourceRecyclableLongList: + targetList.AddRange(sourceRecyclableLongList); + return; + + case T[] sourceArray: + targetList.AddRange(sourceArray); + return; + + case Array sourceArrayWithObjects: + targetList.AddRange(sourceArrayWithObjects); + return; + + case List sourceList: + targetList.AddRange(sourceList); + return; + + case ICollection sourceICollection: + targetList.AddRange(sourceICollection); + return; + + case ICollection sourceICollectionWithObjects: + targetList.AddRange(sourceICollectionWithObjects); + return; + + case IReadOnlyList sourceIReadOnlyList: + targetList.AddRange(sourceIReadOnlyList); + return; + + case RecyclableHashSet sourceHashSet: + targetList.AddRange(sourceHashSet); + return; + + case RecyclableStack sourceStack: + targetList.AddRange(sourceStack); + return; + + case RecyclableSortedSet sourceSortedSet: + targetList.AddRange(sourceSortedSet); + return; + + case RecyclableLinkedList sourceLinkedList: + targetList.AddRange(sourceLinkedList); + return; + + case RecyclablePriorityQueue sourcePriorityQueue: + targetList.AddRange(sourcePriorityQueue); + return; + + case RecyclableQueue sourceQueue: + targetList.AddRange(sourceQueue); + return; + + default: + if (AddRangeHelper.TryAddRange(targetList, items)) + { + return; + } + + if (items.TryGetNonEnumeratedCount(out var requiredAdditionalCapacity)) + { + targetList.AddRangeWithKnownCount(items, requiredAdditionalCapacity); + } + else + { + targetList.AddRangeEnumerated(items); + } + + return; + } + } + + public static void AddRange(this RecyclableLongList targetList, IReadOnlyList items) + { + long sourceItemsCount = items.Count, + requiredCapacity = targetList._longCount + sourceItemsCount; + + if (requiredCapacity == 0) + { + return; + } + + int blockSize = targetList._blockSize, + targetBlockIdx = targetList._nextItemBlockIndex, + targetItemIdx = targetList._nextItemIndex; + + if (targetList._capacity < requiredCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)requiredCapacity))); + } + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + + for (var itemIndex = 0; itemIndex < sourceItemsCount; itemIndex++) + { + blockArraySpan[targetItemIdx++] = items[itemIndex]; + if (targetItemIdx == blockSize) + { + targetItemIdx = 0; + targetBlockIdx++; + if (itemIndex + 1 == sourceItemsCount) + { + break; + } + + blockArraySpan = memoryBlocksSpan[targetBlockIdx]; + } + } + + targetList._longCount = requiredCapacity; + targetList._nextItemBlockIndex = targetBlockIdx; + targetList._nextItemIndex = targetItemIdx; + targetList._lastBlockWithData = targetBlockIdx - (targetItemIdx > 0 ? 0 : 1); + } + + public static void AddRange(this RecyclableLongList targetList, List items) + { + if (items.Count == 0) + { + return; + } + + int blockSize = targetList._blockSize, + itemsCount = items.Count, + copied = Math.Min(blockSize - targetList._nextItemIndex, itemsCount), + targetBlockIndex = targetList._nextItemBlockIndex; + + long targetCapacity = targetList._longCount + items.Count; + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + items.CopyTo(0, memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, copied); + + if (targetList._nextItemIndex + copied == blockSize) + { + targetBlockIndex++; + targetList._nextItemIndex = 0; + } + else + { + targetList._nextItemIndex += copied; + } + + while (blockSize <= itemsCount - copied) + { + items.CopyTo(copied, memoryBlocksSpan[targetBlockIndex++], 0, blockSize); + copied += blockSize; + } + + if ((itemsCount - copied < blockSize) && (itemsCount - copied != 0)) + { + targetList._nextItemIndex = itemsCount - copied; + items.CopyTo(copied, memoryBlocksSpan[targetBlockIndex], 0, targetList._nextItemIndex); + } + + targetList._nextItemBlockIndex = targetBlockIndex; + targetList._longCount = targetCapacity; + targetList._lastBlockWithData = targetBlockIndex - (targetList._nextItemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, ReadOnlySpan items) + { + if (items.Length == 0) + { + return; + } + + int targetBlockIndex = targetList._nextItemBlockIndex; + + long targetCapacity = targetList._longCount + items.Length; + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + + while (items.Length >= targetBlockArraySpan.Length) + { + items[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); + items = items[targetBlockArraySpan.Length..]; + if (items.Length == 0) + { + break; + } + + targetBlockIndex++; + targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; + } + + if (items.Length > 0) + { + items.CopyTo(targetBlockArraySpan); + if (targetList._nextItemBlockIndex != targetBlockIndex) + { + targetList._nextItemIndex = items.Length; + targetList._nextItemBlockIndex = targetBlockIndex; + } + else + { + targetList._nextItemIndex += items.Length; + } + } + else + { + targetList._nextItemBlockIndex = targetBlockIndex + 1; + targetList._nextItemIndex = 0; + } + + targetList._longCount = targetCapacity; + targetList._lastBlockWithData = targetBlockIndex; + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, RecyclableList items) + { + if (items._count == 0) + { + return; + } + + int targetBlockIndex = targetList._nextItemBlockIndex; + + long targetCapacity = targetList._longCount + items._count; + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan itemsSpan = new(items._memoryBlock, 0, items._count); + ReadOnlySpan targetMemoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(targetMemoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + + while (itemsSpan.Length >= targetBlockArraySpan.Length) + { + itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); + itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; + targetBlockIndex++; + if (itemsSpan.Length == 0) + { + break; + } + + targetBlockArraySpan = targetMemoryBlocksSpan[targetBlockIndex]; + } + + if (itemsSpan.Length > 0) + { + itemsSpan.CopyTo(targetBlockArraySpan); + targetList._lastBlockWithData = targetBlockIndex; + if (targetList._nextItemBlockIndex != targetBlockIndex) + { + targetList._nextItemIndex = itemsSpan.Length; + targetList._nextItemBlockIndex = targetBlockIndex; + } + else + { + targetList._nextItemIndex += itemsSpan.Length; + } + } + else + { + targetList._lastBlockWithData = targetBlockIndex - 1; + targetList._nextItemBlockIndex = targetBlockIndex; + targetList._nextItemIndex = 0; + } + + targetList._longCount = targetCapacity; + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, RecyclableLongList items) + { + if (items._longCount == 0) + { + return; + } + + int sourceBlockIndex = 0, + targetBlockIndex = targetList._nextItemBlockIndex, + toCopy; + + long copiedCount = 0, + itemsCount = items._longCount, + targetCapacity = targetList._longCount + itemsCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan sourceMemoryBlocksSpan = items._memoryBlocks; + ReadOnlySpan itemsSpan = sourceMemoryBlocksSpan[sourceBlockIndex]; + ReadOnlySpan targetMemoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(targetMemoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + + while (copiedCount < itemsCount) + { + toCopy = (int)Math.Min(itemsCount - copiedCount, itemsSpan.Length); + if (targetBlockArraySpan.Length < toCopy) + { + toCopy = targetBlockArraySpan.Length; + itemsSpan[..toCopy].CopyTo(targetBlockArraySpan); + targetBlockIndex++; + targetBlockArraySpan = targetMemoryBlocksSpan[targetBlockIndex]; + itemsSpan = itemsSpan[toCopy..]; + copiedCount += toCopy; + } + else + { + itemsSpan[..toCopy].CopyTo(targetBlockArraySpan); + targetBlockArraySpan = targetBlockArraySpan[toCopy..]; + itemsSpan = itemsSpan[toCopy..]; + if (itemsSpan.IsEmpty && sourceBlockIndex + 1 < sourceMemoryBlocksSpan.Length) + { + sourceBlockIndex++; + itemsSpan = sourceMemoryBlocksSpan[sourceBlockIndex]; + } + + copiedCount += toCopy; + if (targetBlockArraySpan.IsEmpty && copiedCount < itemsCount) + { + targetBlockIndex++; + targetBlockArraySpan = targetMemoryBlocksSpan[targetBlockIndex]; + } + } + } + + targetList._lastBlockWithData = targetBlockIndex; + if ((targetCapacity & targetList._blockSizeMinus1) == 0) + { + targetList._nextItemIndex = 0; + targetList._nextItemBlockIndex = targetBlockIndex + 1; + } + else + { + targetList._nextItemIndex = (int)(targetCapacity & targetList._blockSizeMinus1); + targetList._nextItemBlockIndex = targetBlockIndex; + } + + targetList._longCount = targetCapacity; + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, Span items) + { + if (items.Length == 0) + { + return; + } + + int targetBlockIndex = targetList._nextItemBlockIndex; + long targetCapacity = targetList._longCount + items.Length; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + + while (items.Length >= targetBlockArraySpan.Length) + { + items[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); + items = items[targetBlockArraySpan.Length..]; + if (items.Length == 0) + { + break; + } + + targetBlockIndex++; + targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; + } + + if (items.Length > 0) + { + items.CopyTo(targetBlockArraySpan); + if (targetList._nextItemBlockIndex != targetBlockIndex) + { + targetList._nextItemIndex = items.Length; + targetList._nextItemBlockIndex = targetBlockIndex; + } + else + { + targetList._nextItemIndex += items.Length; + } + } + else + { + targetList._nextItemBlockIndex = targetBlockIndex + 1; + targetList._nextItemIndex = 0; + } + + targetList._longCount = targetCapacity; + targetList._lastBlockWithData = targetBlockIndex; + #if WITH_VERSIONING +targetList._version++; +#endif + } + + public static void AddRange(this RecyclableLongList targetList, in T[] items) + { + if (items.LongLength == 0) + { + return; + } + + int targetBlockIndex = targetList._nextItemBlockIndex; + + long targetCapacity = targetList._longCount + items.LongLength; + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + ReadOnlySpan itemsSpan = items; + ReadOnlySpan memoryBlocksSpan = targetList._memoryBlocks; + Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], targetList._nextItemIndex, targetList._blockSize - targetList._nextItemIndex); + + while (itemsSpan.Length >= targetBlockArraySpan.Length) + { + itemsSpan[..targetBlockArraySpan.Length].CopyTo(targetBlockArraySpan); + itemsSpan = itemsSpan[targetBlockArraySpan.Length..]; + if (itemsSpan.Length == 0) + { + break; + } + + targetBlockIndex++; + targetBlockArraySpan = memoryBlocksSpan[targetBlockIndex]; + } + + if (itemsSpan.Length > 0) + { + itemsSpan.CopyTo(targetBlockArraySpan); + if (targetList._nextItemBlockIndex != targetBlockIndex) + { + targetList._nextItemIndex = itemsSpan.Length; + targetList._nextItemBlockIndex = targetBlockIndex; + } + else + { + targetList._nextItemIndex += itemsSpan.Length; + } + } + else + { + targetList._nextItemBlockIndex = targetBlockIndex + 1; + targetList._nextItemIndex = 0; + } + + targetList._longCount = targetCapacity; + targetList._lastBlockWithData = targetBlockIndex; + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList targetList, RecyclableHashSet items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (long i = 0; i < sourceCount; i++) + { + blocks[blockIndex][itemIndex++] = entries[i >> shift][(int)(i & mask)].Value; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList targetList, RecyclableStack items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + var chunk = items._current; + while (chunk != null) + { + var array = chunk.Value; + for (int i = chunk.Index - 1; i >= 0; i--) + { + blocks[blockIndex][itemIndex++] = array[i]; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + chunk = chunk.Previous; + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList targetList, RecyclableSortedSet items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + int idx = 0; + while (idx < items._count) + { + blocks[blockIndex][itemIndex++] = items._items[idx++]; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList targetList, RecyclableLinkedList items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + var chunk = items._head; + while (chunk != null) + { + for (int i = chunk.Bottom; i < chunk.Top; i++) + { + blocks[blockIndex][itemIndex++] = chunk.Value[i]; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + chunk = chunk.Next; + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList targetList, RecyclablePriorityQueue items) + { + if (items._size == 0) + { + return; + } + + long sourceCount = items._size, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + int idx = 0; + while (idx < items._size) + { + blocks[blockIndex][itemIndex++] = items._heap[idx++]; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList targetList, RecyclableQueue items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + var chunkQ = items._head; + while (chunkQ != null) + { + for (int i = chunkQ.Bottom; i < chunkQ.Top; i++) + { + blocks[blockIndex][itemIndex++] = chunkQ.Value[i]; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + chunkQ = chunkQ.Next; + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList> targetList, RecyclableDictionary items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList>.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (long i = 0; i < sourceCount; i++) + { + ref var entry = ref entries[i >> shift][(int)(i & mask)]; + blocks[blockIndex][itemIndex++] = new KeyValuePair(entry.Key, entry.Value); + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableLongList<(TKey Key, TValue Value)> targetList, RecyclableSortedList items) + { + if (items._count == 0) + { + return; + } + + long sourceCount = items._count, + targetCapacity = targetList._longCount + sourceCount; + + if (targetList._capacity < targetCapacity) + { + targetList._capacity = RecyclableLongList<(TKey Key, TValue Value)>.Helpers.Resize(targetList, targetList._blockSize, targetList._blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)targetCapacity))); + } + + var blocks = targetList._memoryBlocks; + int blockIndex = targetList._nextItemBlockIndex, + itemIndex = targetList._nextItemIndex, + blockSize = targetList._blockSize; + + int idx2 = 0; + while (idx2 < items._count) + { + blocks[blockIndex][itemIndex++] = (items._keys[idx2], items._values[idx2]); + idx2++; + if (itemIndex == blockSize) + { + itemIndex = 0; + blockIndex++; + } + } + + targetList._longCount = targetCapacity; + targetList._nextItemBlockIndex = blockIndex; + targetList._nextItemIndex = itemIndex; + targetList._lastBlockWithData = blockIndex - (itemIndex > 0 ? 0 : 1); + #if WITH_VERSIONING +targetList._version++; +#endif + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.Compatibility.List.Sorted.cs b/Recyclable.Collections/RecyclableLongList.Compatibility.List.Sorted.cs index 885f574..087dec7 100644 --- a/Recyclable.Collections/RecyclableLongList.Compatibility.List.Sorted.cs +++ b/Recyclable.Collections/RecyclableLongList.Compatibility.List.Sorted.cs @@ -1,47 +1,47 @@ -using System.Runtime.CompilerServices; -using System.Collections.Generic; -using Recyclable.Collections.Linq; - -namespace Recyclable.Collections -{ - [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] - public static class zRecyclableLongListCompatibilityListSorted - { - public static void Sort(this RecyclableLongList list) - { - QuickSortExtensions.QuickSort(list); -#if WITH_VERSIONING - list._version++; -#endif - } - - public static void Sort(this RecyclableLongList list, Comparison comparison) - { - QuickSortExtensions.QuickSort(list, new ComparisonToComparerAdapter(comparison), new SystemRandomNumberGenerator()); -#if WITH_VERSIONING - list._version++; -#endif - } - - public static void Sort(this RecyclableLongList list, IComparer? comparer) - { - QuickSortExtensions.QuickSort(list, comparer ?? Comparer.Default, new SystemRandomNumberGenerator()); -#if WITH_VERSIONING - list._version++; -#endif - } - - public static void Sort(this RecyclableLongList list, long index, long count, IComparer? comparer) - { - if (count == 0) - { - return; - } - - QuickSortExtensions.QuickSort(list, (int)index, (int)(index + count - 1), comparer ?? Comparer.Default, new SystemRandomNumberGenerator()); -#if WITH_VERSIONING - list._version++; -#endif - } - } -} +using System.Runtime.CompilerServices; +using System.Collections.Generic; +using Recyclable.Collections.Linq; + +namespace Recyclable.Collections +{ + [Obsolete("It'll be moved to Recyclable.Collections.Compatibility.List NuGet package in the next release.")] + public static class zRecyclableLongListCompatibilityListSorted + { + public static void Sort(this RecyclableLongList list) + { + QuickSortExtensions.QuickSort(list); +#if WITH_VERSIONING + list._version++; +#endif + } + + public static void Sort(this RecyclableLongList list, Comparison comparison) + { + QuickSortExtensions.QuickSort(list, new ComparisonToComparerAdapter(comparison), new SystemRandomNumberGenerator()); +#if WITH_VERSIONING + list._version++; +#endif + } + + public static void Sort(this RecyclableLongList list, IComparer? comparer) + { + QuickSortExtensions.QuickSort(list, comparer ?? Comparer.Default, new SystemRandomNumberGenerator()); +#if WITH_VERSIONING + list._version++; +#endif + } + + public static void Sort(this RecyclableLongList list, long index, long count, IComparer? comparer) + { + if (count == 0) + { + return; + } + + QuickSortExtensions.QuickSort(list, (int)index, (int)(index + count - 1), comparer ?? Comparer.Default, new SystemRandomNumberGenerator()); +#if WITH_VERSIONING + list._version++; +#endif + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.Enumerator.cs b/Recyclable.Collections/RecyclableLongList.Enumerator.cs index b8100c7..82f544a 100644 --- a/Recyclable.Collections/RecyclableLongList.Enumerator.cs +++ b/Recyclable.Collections/RecyclableLongList.Enumerator.cs @@ -1,90 +1,90 @@ -using System.Collections; -using System.Diagnostics.Contracts; - -namespace Recyclable.Collections -{ - public partial class RecyclableLongList - { - [VersionedCollectionsGenerator.CloneForVersioned] - public struct Enumerator : IEnumerator - { -#nullable disable - private static readonly T _default = default; -#nullable restore - - private int _currentBlockIndex; - private int _currentItemIndex; - private readonly RecyclableLongList _list; - -#nullable disable - private T _current; -#nullable restore - - [Pure] - public readonly T Current => _current; - - public bool MoveNext() - { - var list = _list; - - if (_currentBlockIndex < list._lastBlockWithData) - { - _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; - if (_currentItemIndex + 1 < list._blockSize) - { - _currentItemIndex++; - } - else - { - _currentBlockIndex++; - _currentItemIndex = 0; - } - - return true; - } - - // Move to the next item if we're within block boundaries, otherwise report end of collection. - if (list._longCount > 0 && _currentItemIndex < (list._nextItemIndex > 0 ? list._nextItemIndex : list._blockSize)) - { - _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; - _currentItemIndex++; - return true; - } - - return false; - } - -#nullable disable - [Pure] - readonly object IEnumerator.Current => _current; -#nullable restore - - public Enumerator(RecyclableLongList list) - { - _current = _default; - _currentBlockIndex = 0; - _currentItemIndex = 0; - _list = list; - } - - public void Reset() - { - if (_needsClearing) - { - _current = _default; - } - - _currentBlockIndex = 0; - _currentItemIndex = 0; - } - - public void Dispose() - { - if (_needsClearing) - { - _current = _default; - } - } - } - } -} +using System.Collections; +using System.Diagnostics.Contracts; + +namespace Recyclable.Collections +{ + public partial class RecyclableLongList + { + [VersionedCollectionsGenerator.CloneForVersioned] + public struct Enumerator : IEnumerator + { +#nullable disable + private static readonly T _default = default; +#nullable restore + + private int _currentBlockIndex; + private int _currentItemIndex; + private readonly RecyclableLongList _list; + +#nullable disable + private T _current; +#nullable restore + + [Pure] + public readonly T Current => _current; + + public bool MoveNext() + { + var list = _list; + + if (_currentBlockIndex < list._lastBlockWithData) + { + _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; + if (_currentItemIndex + 1 < list._blockSize) + { + _currentItemIndex++; + } + else + { + _currentBlockIndex++; + _currentItemIndex = 0; + } + + return true; + } + + // Move to the next item if we're within block boundaries, otherwise report end of collection. + if (list._longCount > 0 && _currentItemIndex < (list._nextItemIndex > 0 ? list._nextItemIndex : list._blockSize)) + { + _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; + _currentItemIndex++; + return true; + } + + return false; + } + +#nullable disable + [Pure] + readonly object IEnumerator.Current => _current; +#nullable restore + + public Enumerator(RecyclableLongList list) + { + _current = _default; + _currentBlockIndex = 0; + _currentItemIndex = 0; + _list = list; + } + + public void Reset() + { + if (_needsClearing) + { + _current = _default; + } + + _currentBlockIndex = 0; + _currentItemIndex = 0; + } + + public void Dispose() + { + if (_needsClearing) + { + _current = _default; + } + } + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.Extensions.cs b/Recyclable.Collections/RecyclableLongList.Extensions.cs index fc89683..1aeb3c2 100644 --- a/Recyclable.Collections/RecyclableLongList.Extensions.cs +++ b/Recyclable.Collections/RecyclableLongList.Extensions.cs @@ -1,45 +1,45 @@ -using System.Collections; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - [VersionedCollectionsGenerator.GenerateVersioned] - public static class RecyclableLongListExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this Array values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this ICollection values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this ICollection values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this IEnumerable values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize: minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this IEnumerable values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize: minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this IReadOnlyList values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this List values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this ReadOnlySpan values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this RecyclableList values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this RecyclableLongList values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this Span values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RecyclableLongList ToRecyclableLongList(this T[] values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); - } -} +using System.Collections; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections +{ + [VersionedCollectionsGenerator.GenerateVersioned] + public static class RecyclableLongListExtensions + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this Array values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this ICollection values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this ICollection values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this IEnumerable values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize: minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this IEnumerable values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize: minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this IReadOnlyList values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this List values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this ReadOnlySpan values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this RecyclableList values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this RecyclableLongList values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this Span values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RecyclableLongList ToRecyclableLongList(this T[] values, int minBlockSize = RecyclableDefaults.BlockSize) => new(values, minBlockSize); + } +} diff --git a/Recyclable.Collections/RecyclableLongList.Helpers.cs b/Recyclable.Collections/RecyclableLongList.Helpers.cs index 61dc9d7..0a33ecc 100644 --- a/Recyclable.Collections/RecyclableLongList.Helpers.cs +++ b/Recyclable.Collections/RecyclableLongList.Helpers.cs @@ -1,207 +1,207 @@ -using Recyclable.Collections.Pools; -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - public partial class RecyclableLongList - { - internal static class Helpers - { - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static void CopyFollowingItems(RecyclableLongList list, long destinationItemIndex) - { - int blockSizeMinus1 = list._blockSizeMinus1, - targetItemIndex = (int)(destinationItemIndex & blockSizeMinus1), - targetBlockIndex = (int)(destinationItemIndex >> list._blockSizePow2BitShift) + (targetItemIndex + 1 == 0 ? 1 : 0), - lastTakenBlockIndex = list._lastBlockWithData - 1; - - // Each iteration should - // 1. copy the remaining items in the current block (those after the deleted item) - // 2. copy the 1st item from the next block. We deleted 1 item which leaves 1 item gap in the block. - // We need to fill it. - - T[][] memoryBlocks = list._memoryBlocks; - T[] currentBlock = memoryBlocks[targetBlockIndex]; - new ReadOnlySpan(currentBlock, targetItemIndex + 1, blockSizeMinus1 - targetItemIndex) - .CopyTo(new Span(currentBlock, targetItemIndex, blockSizeMinus1 - targetItemIndex)); - - while (targetBlockIndex < lastTakenBlockIndex) - { - new Span(currentBlock)[blockSizeMinus1] = (currentBlock = memoryBlocks[++targetBlockIndex])[0]; - new ReadOnlySpan(currentBlock, 1, blockSizeMinus1) - .CopyTo(currentBlock); - } - - if (targetBlockIndex == lastTakenBlockIndex) - { - new Span(currentBlock)[blockSizeMinus1] = (currentBlock = memoryBlocks[targetBlockIndex + 1])[0]; - new ReadOnlySpan(currentBlock, 1, list._nextItemIndex != 0 ? list._nextItemIndex - 1 : blockSizeMinus1) - .CopyTo(currentBlock); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public static void MakeRoomAndSet(RecyclableLongList list, long startingItemIndex, T item) - { - T[] currentBlock; - T[][] memoryBlocks = list._memoryBlocks; - int blockSizeMinus1 = list._blockSizeMinus1, - targetItemIndex = (int)(startingItemIndex & blockSizeMinus1), - targetBlockIndex = (int)(startingItemIndex >> list._blockSizePow2BitShift) + (targetItemIndex + 1 == 0 ? 1 : 0), - lastTakenBlockIndex = list._lastBlockWithData; - - if (list._nextItemIndex == 0) - { - new Span(memoryBlocks[lastTakenBlockIndex + 1])[0] = memoryBlocks[lastTakenBlockIndex][blockSizeMinus1]; - } - - int currentBlockIndex = lastTakenBlockIndex; - while (currentBlockIndex > targetBlockIndex) - { - new ReadOnlySpan(currentBlock = memoryBlocks[currentBlockIndex--], 0, blockSizeMinus1) - .CopyTo(new Span(currentBlock, 1, blockSizeMinus1)); - new Span(currentBlock)[0] = memoryBlocks[currentBlockIndex][blockSizeMinus1]; - } - - new ReadOnlySpan(currentBlock = memoryBlocks[targetBlockIndex], targetItemIndex, blockSizeMinus1 - targetItemIndex) - .CopyTo(new Span(currentBlock, targetItemIndex + 1, blockSizeMinus1 - targetItemIndex)); - - new Span(memoryBlocks[targetBlockIndex])[targetItemIndex] = item; - } - - public static void CopyTo(T[][] sourceMemoryBlocks, long startingIndex, int blockSize, long itemsCount, T[] destinationArray, int destinationArrayIndex) - { - if (itemsCount <= 0) - { - return; - } - - ReadOnlySpan sourceBlockMemory; - Span destinationArrayMemory; - int blockSizePow2Shift = BitOperations.TrailingZeroCount((uint)blockSize); - int startingBlockIndex = (int)(startingIndex >> blockSizePow2Shift); - int lastBlockIndex = (int)((itemsCount >> blockSizePow2Shift) + ((itemsCount & (blockSize - 1)) != 0 ? 1 : 0)) - 1; - ReadOnlySpan sourceMemoryBlocksSpan = new(sourceMemoryBlocks, startingBlockIndex, lastBlockIndex + 1); - destinationArrayMemory = new Span(destinationArray, destinationArrayIndex, (int)Math.Min(destinationArray.Length - destinationArrayIndex, itemsCount)); - int memoryBlockIndex; - for (memoryBlockIndex = 0; memoryBlockIndex < lastBlockIndex; memoryBlockIndex++) - { - sourceBlockMemory = new(sourceMemoryBlocksSpan[memoryBlockIndex], 0, blockSize); - sourceBlockMemory.CopyTo(destinationArrayMemory); - destinationArrayMemory = destinationArrayMemory[blockSize..]; - } - - if (itemsCount - (lastBlockIndex * blockSize) != 0) - { - sourceBlockMemory = new(sourceMemoryBlocksSpan[lastBlockIndex], 0, (int)(itemsCount - (lastBlockIndex * blockSize))); - sourceBlockMemory.CopyTo(destinationArrayMemory); - } - } - - public static void CopyTo(T[][] sourceMemoryBlocks, long startingIndex, int blockSize, long itemsCount, Array destinationArray, int destinationArrayIndex) - { - if (itemsCount <= 0) - { - return; - } - - int blockSizePow2Shift = BitOperations.TrailingZeroCount((uint)blockSize); - int startingBlockIndex = (int)(startingIndex >> blockSizePow2Shift); - int lastBlockIndex = (int)((itemsCount >> blockSizePow2Shift) + ((itemsCount & (blockSize - 1)) != 0 ? 1 : 0)) - 1; - - var destinationIndex = destinationArrayIndex; - ReadOnlySpan sourceMemoryBlocksSpan = new(sourceMemoryBlocks, startingBlockIndex, lastBlockIndex + 1); - for (int memoryBlockIndex = 0; memoryBlockIndex < lastBlockIndex; memoryBlockIndex++) - { - Array.ConstrainedCopy(sourceMemoryBlocksSpan[memoryBlockIndex], 0, destinationArray, destinationIndex, blockSize); - destinationIndex += blockSize; - } - - if (itemsCount - destinationIndex > 0) - { - Array.ConstrainedCopy(sourceMemoryBlocksSpan[lastBlockIndex], 0, destinationArray, destinationIndex, (int)(itemsCount - destinationIndex)); - } - } - - /// - /// Creates a set of new memory buffers, if needed, to allow storing at minimum no. of items. - /// - /// that needs to be resized. - /// Minimal requested block size. It MUST be rounded to the power of 2, see remarks. - /// Pre-calculated bit shifting value for left & right shift operations against. - /// The minimum no. of items MUST be able to store after . - /// - /// For performance reasons, MUST a power of 2. This simplifies a lot block & item - /// index calculations, i.e. makes them logical operations on bits. - /// - /// This method checks for integral overflow. - /// - /// - /// This method doesn't support downsizing the memory block. As such it doesn't release excessive blocks. This is to for additional performance - /// gain - 1+ operation less for each call. If you need this functionality, you need to implement it on a higher level. - /// - /// The maximum no. of items can store. - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static long Resize(RecyclableLongList list, int minBlockSize, byte minBlockSizePow2Shift, long newCapacity) - { - int sourceBlockCount = list._memoryBlocks?.Length ?? 0; - int requiredBlockCount = checked((int)(newCapacity >> minBlockSizePow2Shift) + ((newCapacity & (minBlockSize - 1)) != 0 ? 1 : 0)); - int blockIndex; - - T[][] newMemoryBlocks; - if (requiredBlockCount > sourceBlockCount) - { - // Allocate new memory block for all arrays - newMemoryBlocks = requiredBlockCount >= RecyclableDefaults.MinPooledArrayLength ? RecyclableArrayPool.RentShared(requiredBlockCount) : new T[requiredBlockCount][]; - - // Copy arrays from the old memory block for all arrays - if (sourceBlockCount > 0) - { - Array.Copy(list._memoryBlocks!, newMemoryBlocks, sourceBlockCount); - // We can now return the old memory block for all arrays itself - if (sourceBlockCount >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(list._memoryBlocks!, true); - } - } - - list._memoryBlocks = newMemoryBlocks; - } - else - { - newMemoryBlocks = list._memoryBlocks!; - } - - // Allocate arrays for any new blocks - if (requiredBlockCount > 0) - { - if (minBlockSize >= RecyclableDefaults.MinPooledArrayLength) - { - blockIndex = requiredBlockCount - 1; - ref OneSizeArrayPool blockArrayPool = ref RecyclableArrayPool.Shared(minBlockSize); - while (blockIndex >= 0 && newMemoryBlocks[blockIndex] == null) - { - newMemoryBlocks[blockIndex--] = blockArrayPool.Rent(); - } - } - else - { - blockIndex = requiredBlockCount - 1; - while (blockIndex >= 0 && newMemoryBlocks[blockIndex] == null) - { - newMemoryBlocks[blockIndex--] = new T[minBlockSize]; - } - } - } - - return requiredBlockCount << minBlockSizePow2Shift; - } - -#pragma warning disable CA2208 - public static void ThrowIndexOutOfRangeException(in string message) => throw new ArgumentOutOfRangeException("index", message); -#pragma warning restore CA2208 - public static void ThrowArgumentOutOfRangeException(in string argumentName, in string message) => throw new ArgumentOutOfRangeException(argumentName, message); - } - } -} +using Recyclable.Collections.Pools; +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections +{ + public partial class RecyclableLongList + { + internal static class Helpers + { + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static void CopyFollowingItems(RecyclableLongList list, long destinationItemIndex) + { + int blockSizeMinus1 = list._blockSizeMinus1, + targetItemIndex = (int)(destinationItemIndex & blockSizeMinus1), + targetBlockIndex = (int)(destinationItemIndex >> list._blockSizePow2BitShift) + (targetItemIndex + 1 == 0 ? 1 : 0), + lastTakenBlockIndex = list._lastBlockWithData - 1; + + // Each iteration should + // 1. copy the remaining items in the current block (those after the deleted item) + // 2. copy the 1st item from the next block. We deleted 1 item which leaves 1 item gap in the block. + // We need to fill it. + + T[][] memoryBlocks = list._memoryBlocks; + T[] currentBlock = memoryBlocks[targetBlockIndex]; + new ReadOnlySpan(currentBlock, targetItemIndex + 1, blockSizeMinus1 - targetItemIndex) + .CopyTo(new Span(currentBlock, targetItemIndex, blockSizeMinus1 - targetItemIndex)); + + while (targetBlockIndex < lastTakenBlockIndex) + { + new Span(currentBlock)[blockSizeMinus1] = (currentBlock = memoryBlocks[++targetBlockIndex])[0]; + new ReadOnlySpan(currentBlock, 1, blockSizeMinus1) + .CopyTo(currentBlock); + } + + if (targetBlockIndex == lastTakenBlockIndex) + { + new Span(currentBlock)[blockSizeMinus1] = (currentBlock = memoryBlocks[targetBlockIndex + 1])[0]; + new ReadOnlySpan(currentBlock, 1, list._nextItemIndex != 0 ? list._nextItemIndex - 1 : blockSizeMinus1) + .CopyTo(currentBlock); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public static void MakeRoomAndSet(RecyclableLongList list, long startingItemIndex, T item) + { + T[] currentBlock; + T[][] memoryBlocks = list._memoryBlocks; + int blockSizeMinus1 = list._blockSizeMinus1, + targetItemIndex = (int)(startingItemIndex & blockSizeMinus1), + targetBlockIndex = (int)(startingItemIndex >> list._blockSizePow2BitShift) + (targetItemIndex + 1 == 0 ? 1 : 0), + lastTakenBlockIndex = list._lastBlockWithData; + + if (list._nextItemIndex == 0) + { + new Span(memoryBlocks[lastTakenBlockIndex + 1])[0] = memoryBlocks[lastTakenBlockIndex][blockSizeMinus1]; + } + + int currentBlockIndex = lastTakenBlockIndex; + while (currentBlockIndex > targetBlockIndex) + { + new ReadOnlySpan(currentBlock = memoryBlocks[currentBlockIndex--], 0, blockSizeMinus1) + .CopyTo(new Span(currentBlock, 1, blockSizeMinus1)); + new Span(currentBlock)[0] = memoryBlocks[currentBlockIndex][blockSizeMinus1]; + } + + new ReadOnlySpan(currentBlock = memoryBlocks[targetBlockIndex], targetItemIndex, blockSizeMinus1 - targetItemIndex) + .CopyTo(new Span(currentBlock, targetItemIndex + 1, blockSizeMinus1 - targetItemIndex)); + + new Span(memoryBlocks[targetBlockIndex])[targetItemIndex] = item; + } + + public static void CopyTo(T[][] sourceMemoryBlocks, long startingIndex, int blockSize, long itemsCount, T[] destinationArray, int destinationArrayIndex) + { + if (itemsCount <= 0) + { + return; + } + + ReadOnlySpan sourceBlockMemory; + Span destinationArrayMemory; + int blockSizePow2Shift = BitOperations.TrailingZeroCount((uint)blockSize); + int startingBlockIndex = (int)(startingIndex >> blockSizePow2Shift); + int lastBlockIndex = (int)((itemsCount >> blockSizePow2Shift) + ((itemsCount & (blockSize - 1)) != 0 ? 1 : 0)) - 1; + ReadOnlySpan sourceMemoryBlocksSpan = new(sourceMemoryBlocks, startingBlockIndex, lastBlockIndex + 1); + destinationArrayMemory = new Span(destinationArray, destinationArrayIndex, (int)Math.Min(destinationArray.Length - destinationArrayIndex, itemsCount)); + int memoryBlockIndex; + for (memoryBlockIndex = 0; memoryBlockIndex < lastBlockIndex; memoryBlockIndex++) + { + sourceBlockMemory = new(sourceMemoryBlocksSpan[memoryBlockIndex], 0, blockSize); + sourceBlockMemory.CopyTo(destinationArrayMemory); + destinationArrayMemory = destinationArrayMemory[blockSize..]; + } + + if (itemsCount - (lastBlockIndex * blockSize) != 0) + { + sourceBlockMemory = new(sourceMemoryBlocksSpan[lastBlockIndex], 0, (int)(itemsCount - (lastBlockIndex * blockSize))); + sourceBlockMemory.CopyTo(destinationArrayMemory); + } + } + + public static void CopyTo(T[][] sourceMemoryBlocks, long startingIndex, int blockSize, long itemsCount, Array destinationArray, int destinationArrayIndex) + { + if (itemsCount <= 0) + { + return; + } + + int blockSizePow2Shift = BitOperations.TrailingZeroCount((uint)blockSize); + int startingBlockIndex = (int)(startingIndex >> blockSizePow2Shift); + int lastBlockIndex = (int)((itemsCount >> blockSizePow2Shift) + ((itemsCount & (blockSize - 1)) != 0 ? 1 : 0)) - 1; + + var destinationIndex = destinationArrayIndex; + ReadOnlySpan sourceMemoryBlocksSpan = new(sourceMemoryBlocks, startingBlockIndex, lastBlockIndex + 1); + for (int memoryBlockIndex = 0; memoryBlockIndex < lastBlockIndex; memoryBlockIndex++) + { + Array.ConstrainedCopy(sourceMemoryBlocksSpan[memoryBlockIndex], 0, destinationArray, destinationIndex, blockSize); + destinationIndex += blockSize; + } + + if (itemsCount - destinationIndex > 0) + { + Array.ConstrainedCopy(sourceMemoryBlocksSpan[lastBlockIndex], 0, destinationArray, destinationIndex, (int)(itemsCount - destinationIndex)); + } + } + + /// + /// Creates a set of new memory buffers, if needed, to allow storing at minimum no. of items. + /// + /// that needs to be resized. + /// Minimal requested block size. It MUST be rounded to the power of 2, see remarks. + /// Pre-calculated bit shifting value for left & right shift operations against. + /// The minimum no. of items MUST be able to store after . + /// + /// For performance reasons, MUST a power of 2. This simplifies a lot block & item + /// index calculations, i.e. makes them logical operations on bits. + /// + /// This method checks for integral overflow. + /// + /// + /// This method doesn't support downsizing the memory block. As such it doesn't release excessive blocks. This is to for additional performance + /// gain - 1+ operation less for each call. If you need this functionality, you need to implement it on a higher level. + /// + /// The maximum no. of items can store. + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static long Resize(RecyclableLongList list, int minBlockSize, byte minBlockSizePow2Shift, long newCapacity) + { + int sourceBlockCount = list._memoryBlocks?.Length ?? 0; + int requiredBlockCount = checked((int)(newCapacity >> minBlockSizePow2Shift) + ((newCapacity & (minBlockSize - 1)) != 0 ? 1 : 0)); + int blockIndex; + + T[][] newMemoryBlocks; + if (requiredBlockCount > sourceBlockCount) + { + // Allocate new memory block for all arrays + newMemoryBlocks = requiredBlockCount >= RecyclableDefaults.MinPooledArrayLength ? RecyclableArrayPool.RentShared(requiredBlockCount) : new T[requiredBlockCount][]; + + // Copy arrays from the old memory block for all arrays + if (sourceBlockCount > 0) + { + Array.Copy(list._memoryBlocks!, newMemoryBlocks, sourceBlockCount); + // We can now return the old memory block for all arrays itself + if (sourceBlockCount >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(list._memoryBlocks!, true); + } + } + + list._memoryBlocks = newMemoryBlocks; + } + else + { + newMemoryBlocks = list._memoryBlocks!; + } + + // Allocate arrays for any new blocks + if (requiredBlockCount > 0) + { + if (minBlockSize >= RecyclableDefaults.MinPooledArrayLength) + { + blockIndex = requiredBlockCount - 1; + ref OneSizeArrayPool blockArrayPool = ref RecyclableArrayPool.Shared(minBlockSize); + while (blockIndex >= 0 && newMemoryBlocks[blockIndex] == null) + { + newMemoryBlocks[blockIndex--] = blockArrayPool.Rent(); + } + } + else + { + blockIndex = requiredBlockCount - 1; + while (blockIndex >= 0 && newMemoryBlocks[blockIndex] == null) + { + newMemoryBlocks[blockIndex--] = new T[minBlockSize]; + } + } + } + + return requiredBlockCount << minBlockSizePow2Shift; + } + +#pragma warning disable CA2208 + public static void ThrowIndexOutOfRangeException(in string message) => throw new ArgumentOutOfRangeException("index", message); +#pragma warning restore CA2208 + public static void ThrowArgumentOutOfRangeException(in string argumentName, in string message) => throw new ArgumentOutOfRangeException(argumentName, message); + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.IList.cs b/Recyclable.Collections/RecyclableLongList.IList.cs index 5349c05..82abda9 100644 --- a/Recyclable.Collections/RecyclableLongList.IList.cs +++ b/Recyclable.Collections/RecyclableLongList.IList.cs @@ -1,118 +1,118 @@ -using System.Collections; - -namespace Recyclable.Collections -{ - public partial class RecyclableLongList : IList - { - public bool IsFixedSize => false; - public bool IsSynchronized => false; - - private object? _syncRoot; - public object SyncRoot - { - get - { - if (_syncRoot == null) - { - _ = Interlocked.CompareExchange(ref _syncRoot, new object(), null); - } - - return _syncRoot; - } - } - - object? IList.this[int index] - { - get => _memoryBlocks[index >> _blockSizePow2BitShift][index & _blockSizeMinus1]; - - set - { - if (value is T typedValue) - { - new Span(_memoryBlocks[index >> _blockSizePow2BitShift])[index & _blockSizeMinus1] = typedValue; - } - else if (value == null && _defaultIsNull) - { -#nullable disable - new Span(_memoryBlocks[index >> _blockSizePow2BitShift])[index & _blockSizeMinus1] = default; -#nullable restore - } - else - { - Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - } - } - } - - public int Add(object? value) - { - if (value is T typeValue) - { - Add(typeValue); - return checked((int)(_longCount - 1)); - } - else if (value == null && _defaultIsNull) - { - Add(null); - return checked((int)(_longCount - 1)); - } - else - { - Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - return RecyclableDefaults.ItemNotFoundIndex; - } - } - - public bool Contains(object? value) => value is T typeValue - ? Contains(typeValue) -#nullable disable - : value == null && _defaultIsNull && Contains(default); -#nullable restore - - public int IndexOf(object? value) => value is T typeValue - ? IndexOf(typeValue) - : value == null && _defaultIsNull -#nullable disable - ? IndexOf(default) -#nullable restore - : RecyclableDefaults.ItemNotFoundIndex; - - public void Insert(int index, object? value) - { - if (value is T typeValue) - { - Insert(index, typeValue); - } - else if (value == null && _defaultIsNull) - { -#nullable disable - Insert(index, default); -#nullable restore - } - else - { - Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - } - } - - public void Remove(object? value) - { - if (value is T typeValue) - { - _ = Remove(typeValue); - } - else if (value == null && _defaultIsNull) - { -#nullable disable - _ = Remove(default); -#nullable restore - } - else - { - Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); - } - } - - public void CopyTo(Array array, int index) => RecyclableLongList.Helpers.CopyTo(_memoryBlocks, 0, _blockSize, _longCount, array, index); - } -} +using System.Collections; + +namespace Recyclable.Collections +{ + public partial class RecyclableLongList : IList + { + public bool IsFixedSize => false; + public bool IsSynchronized => false; + + private object? _syncRoot; + public object SyncRoot + { + get + { + if (_syncRoot == null) + { + _ = Interlocked.CompareExchange(ref _syncRoot, new object(), null); + } + + return _syncRoot; + } + } + + object? IList.this[int index] + { + get => _memoryBlocks[index >> _blockSizePow2BitShift][index & _blockSizeMinus1]; + + set + { + if (value is T typedValue) + { + new Span(_memoryBlocks[index >> _blockSizePow2BitShift])[index & _blockSizeMinus1] = typedValue; + } + else if (value == null && _defaultIsNull) + { +#nullable disable + new Span(_memoryBlocks[index >> _blockSizePow2BitShift])[index & _blockSizeMinus1] = default; +#nullable restore + } + else + { + Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + } + } + } + + public int Add(object? value) + { + if (value is T typeValue) + { + Add(typeValue); + return checked((int)(_longCount - 1)); + } + else if (value == null && _defaultIsNull) + { + Add(null); + return checked((int)(_longCount - 1)); + } + else + { + Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + return RecyclableDefaults.ItemNotFoundIndex; + } + } + + public bool Contains(object? value) => value is T typeValue + ? Contains(typeValue) +#nullable disable + : value == null && _defaultIsNull && Contains(default); +#nullable restore + + public int IndexOf(object? value) => value is T typeValue + ? IndexOf(typeValue) + : value == null && _defaultIsNull +#nullable disable + ? IndexOf(default) +#nullable restore + : RecyclableDefaults.ItemNotFoundIndex; + + public void Insert(int index, object? value) + { + if (value is T typeValue) + { + Insert(index, typeValue); + } + else if (value == null && _defaultIsNull) + { +#nullable disable + Insert(index, default); +#nullable restore + } + else + { + Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + } + } + + public void Remove(object? value) + { + if (value is T typeValue) + { + _ = Remove(typeValue); + } + else if (value == null && _defaultIsNull) + { +#nullable disable + _ = Remove(default); +#nullable restore + } + else + { + Helpers.ThrowArgumentOutOfRangeException(nameof(value), $"Argument is invalid. {(value != null ? "List element type is incompatible with the given value" : "Element is null and the list doesn't allow null values.")}"); + } + } + + public void CopyTo(Array array, int index) => RecyclableLongList.Helpers.CopyTo(_memoryBlocks, 0, _blockSize, _longCount, array, index); + } +} diff --git a/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs b/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs index 1ee976c..aea52fb 100644 --- a/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs +++ b/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs @@ -1,349 +1,349 @@ -// #define MAX_BLOCKS_FOR_TASK_2 -// #define MAX_BLOCKS_FOR_TASK_3 -#define MAX_BLOCKS_FOR_TASK_4 -// #define MAX_BLOCKS_FOR_TASK_5 -// #define MAX_BLOCKS_FOR_TASK_6 -// #define MAX_BLOCKS_FOR_TASK_7 -// #define MAX_BLOCKS_FOR_TASK_8 - -using System.Runtime.CompilerServices; -using Recyclable.Collections.Parallel; - -namespace Recyclable.Collections -{ - public partial class RecyclableLongList - { - public static class IndexOfHelpers - { - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - private static void IndexOfInConsecutiveBlocks(IndexOfSynchronizationContext context, RecyclableLongList list, int blockIndex, T itemToFind) - { - try - { - if (context._isItemFound && blockIndex >= context.FoundBlockIndex) - { - return; - } - - long index = Array.IndexOf(list._memoryBlocks[blockIndex], itemToFind, 0, list._blockSize); - if (index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) - { - ExchangeFoundItemIndexIfLower(context, blockIndex, ((long)blockIndex << list._blockSizePow2BitShift) + index); - return; - } - else if (context._isItemFound) - { - return; - } - -#if MAX_BLOCKS_FOR_TASK_2 || MAX_BLOCKS_FOR_TASK_3 || MAX_BLOCKS_FOR_TASK_4 || MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 1], itemToFind, 0, list._blockSize); - if (index >= 0) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 1, ((long)(blockIndex + 1) << list._blockSizePow2BitShift) + index); - return; - } - else if (context._isItemFound) - { - return; - } - -#endif - -#if MAX_BLOCKS_FOR_TASK_3 || MAX_BLOCKS_FOR_TASK_4 || MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 2], itemToFind, 0, list._blockSize); - if (index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 2, ((long)(blockIndex + 2) << list._blockSizePow2BitShift) + index); - return; - } - else if (context._isItemFound) - { - return; - } - -#endif - -#if MAX_BLOCKS_FOR_TASK_4 || MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 3], itemToFind, 0, list._blockSize); - if (!context._isItemFound && index >= 0) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 3, ((long)(blockIndex + 3) << list._blockSizePow2BitShift) + index); - } - -#endif - -#if MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 4], itemToFind, 0, list._blockSize); - if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 4, ((long)(blockIndex + 4) << list._blockSizePow2BitShift) + index); - } - -#endif - -#if MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 5], itemToFind, 0, list._blockSize); - if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 5, ((long)(blockIndex + 5) << list._blockSizePow2BitShift) + index); - } - -#endif - -#if MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 6], itemToFind, 0, list._blockSize); - if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 6, ((long)(blockIndex + 6) << list._blockSizePow2BitShift) + index); - } - -#endif - -#if MAX_BLOCKS_FOR_TASK_8 - - index = Array.IndexOf(list._memoryBlocks[blockIndex + 7], itemToFind, 0, list._blockSize); - if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) - { - ExchangeFoundItemIndexIfLower(context, blockIndex + 7, ((long)(blockIndex + 7) << list._blockSizePow2BitShift) + index); - } - -#endif - } - catch (Exception e) - { - e.Data.Add("list", list); - e.Data.Add("itemToFind", itemToFind); - e.Data.Add("blockIndex", blockIndex); - _ = Interlocked.Exchange(ref context.Exception, e); - } - finally - { - context.RemoveParticipant(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void ExchangeFoundItemIndexIfLower(IndexOfSynchronizationContext context, int blockIndex, long newItemIndex) - { - context.Lock(); - - if (newItemIndex < context.FoundItemIndex || context.FoundItemIndex == RecyclableDefaults.ItemNotFoundIndexLong) - { - context.FoundBlockIndex = blockIndex; - context.FoundItemIndex = newItemIndex; - } - - context._isItemFound = true; - context.Unlock(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - private static void IndexOfIn1Block(IndexOfSynchronizationContext context, RecyclableLongList list, int blockIndex, T itemToFind) - { - try - { - if (context._isItemFound) - { - return; - } - - long index = Array.IndexOf(list._memoryBlocks[blockIndex], itemToFind, 0, list._blockSize); - if (!context._isItemFound && index >= 0) - { - ExchangeFoundItemIndexIfLower(context, blockIndex, ((long)blockIndex << list._blockSizePow2BitShift) + index); - } - } - catch (Exception e) - { - _ = Interlocked.Exchange(ref context.Exception, e); - } - finally - { - context.RemoveParticipant(); - } - } - -#if MAX_BLOCKS_FOR_TASK_2 - private const int BlocksForEachTask = 2; -#endif -#if MAX_BLOCKS_FOR_TASK_3 - private const int BlocksForEachTask = 3; -#endif -#if MAX_BLOCKS_FOR_TASK_4 - private const int BlocksForEachTask = 4; -#endif -#if MAX_BLOCKS_FOR_TASK_5 - private const int BlocksForEachTask = 5; -#endif -#if MAX_BLOCKS_FOR_TASK_6 - private const int BlocksForEachTask = 6; -#endif -#if MAX_BLOCKS_FOR_TASK_7 - private const int BlocksForEachTask = 7; -#endif -#if MAX_BLOCKS_FOR_TASK_8 - private const int BlocksForEachTask = 8; -#endif - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static long IndexOfParallel(RecyclableLongList list, T item) - { - // & WAS SLOWER - //long itemsCount = Array.IndexOf(list._memoryBlocks[0], item, 0, (int)Math.Min(list._blockSize, list._longCount)); - //if (itemsCount >= 0) - //{ - // return itemsCount; - //} - - //using var context = new ParallelSynchronizationContext(1); - IndexOfSynchronizationContext context = IndexOfSynchronizationContextPool.GetWithOneParticipant(); - // (long)(_longCount * 0.329) => most efficient step, based on benchmarks - //Iterate(this, context, item); - - // & WAS SLOWER without - int blockIndex = 2; - // & WAS SLOWER - //long itemsCount = list._longCount - list._blockSize; - // & WAS SLOWER - // int blockSize = _blockSize; - // & WAS SLOWER - // while (((long)blockIndex << list._blockSizePow2BitShift) + itemIndex > step) - //long blockSize = checked((long)list._blockSize << 1); - int lastBlockWithData = list._lastBlockWithData - BlocksForEachTask; - while (blockIndex < lastBlockWithData) - { - // At this point itemIndex is limited to blockSize range - int. - - // & WAS SLOWER - // _ = ThreadPool.QueueUserWorkItem((_) => - // Task.Factory.StartNew(() => - context.AddParticipant(); - var startingBlock = blockIndex; - _ = Task.Run(() => IndexOfInConsecutiveBlocks(context, list, startingBlock, item)); - - // & WAS SLOWER - // ScheduleIndexOfTask(context, list, blockIndex, item); - if (context._isItemFound) - { - break; - } - - blockIndex += BlocksForEachTask; - } - - if (!context._isItemFound) - { - while (blockIndex < list._lastBlockWithData) - { - // & WAS SLOWER - // _ = ThreadPool.QueueUserWorkItem((_) => - // Task.Factory.StartNew(() => - var startingBlock = blockIndex; - context.AddParticipant(); - _ = Task.Run(() => IndexOfIn1Block(context, list, startingBlock, item)); - - // & WAS SLOWER - // ScheduleIndexOfTaskSingle(context, list, blockIndex, item); - if (context._isItemFound) - { - break; - } - - blockIndex++; - } - } - - if (!context._isItemFound) - { - int itemIndex = Array.IndexOf(list._memoryBlocks[list._lastBlockWithData], item, 0, list._nextItemIndex > 0 ? list._nextItemIndex : list._blockSize); - if (!context._isItemFound && itemIndex >= 0) - { - ExchangeFoundItemIndexIfLower(context, blockIndex, ((long)blockIndex << list._blockSizePow2BitShift) + itemIndex); - } - } - - context.SignalAndWait(); - if (context.Exception == null) - { - try - { - return context.FoundItemIndex; - } - finally - { - context.Dispose(); - } - } - - try - { - context.Exception.CaptureAndRethrow(); - } - finally - { - context.Dispose(); - } - - return RecyclableDefaults.ItemNotFoundIndexLong; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - public static long IndexOfSequential(RecyclableLongList list, in T item) //, in T[][] memoryBlocks, int lastBlockIndex, int blockSize, int nextItemIndex) - { - int itemIndex; - // & WAS SLOWER - //int lastBlockWithData = list._lastBlockWithData; - ReadOnlySpan memoryBlocksSpan = new(list._memoryBlocks, 0, list._lastBlockWithData + 1); - int blockIndex; - for (blockIndex = 1; blockIndex < list._lastBlockWithData; blockIndex += 4) - { - itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex], item, 0, list._blockSize); - if (itemIndex >= 0) - { - return itemIndex + ((long)blockIndex << list._blockSizePow2BitShift); - } - - if (blockIndex + 1 < list._lastBlockWithData) - { - itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 1], item, 0, list._blockSize); - if (itemIndex >= 0) - { - return itemIndex + ((long)(blockIndex + 1) << list._blockSizePow2BitShift); - } - - if (blockIndex + 2 < list._lastBlockWithData) - { - itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 2], item, 0, list._blockSize); - if (itemIndex >= 0) - { - return itemIndex + ((long)(blockIndex + 2) << list._blockSizePow2BitShift); - } - - if (blockIndex + 3 < list._lastBlockWithData) - { - itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 3], item, 0, list._blockSize); - if (itemIndex >= 0) - { - return itemIndex + ((long)(blockIndex + 3) << list._blockSizePow2BitShift); - } - } - } - } - } - - itemIndex = list._nextItemIndex != 0 - ? Array.IndexOf(memoryBlocksSpan[list._lastBlockWithData], item, 0, list._nextItemIndex) - : Array.IndexOf(memoryBlocksSpan[list._lastBlockWithData], item, 0, list._blockSize); - - return itemIndex >= 0 ? itemIndex + ((long)list._lastBlockWithData << list._blockSizePow2BitShift) : RecyclableDefaults.ItemNotFoundIndexLong; - } - } - } -} +// #define MAX_BLOCKS_FOR_TASK_2 +// #define MAX_BLOCKS_FOR_TASK_3 +#define MAX_BLOCKS_FOR_TASK_4 +// #define MAX_BLOCKS_FOR_TASK_5 +// #define MAX_BLOCKS_FOR_TASK_6 +// #define MAX_BLOCKS_FOR_TASK_7 +// #define MAX_BLOCKS_FOR_TASK_8 + +using System.Runtime.CompilerServices; +using Recyclable.Collections.Parallel; + +namespace Recyclable.Collections +{ + public partial class RecyclableLongList + { + public static class IndexOfHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + private static void IndexOfInConsecutiveBlocks(IndexOfSynchronizationContext context, RecyclableLongList list, int blockIndex, T itemToFind) + { + try + { + if (context._isItemFound && blockIndex >= context.FoundBlockIndex) + { + return; + } + + long index = Array.IndexOf(list._memoryBlocks[blockIndex], itemToFind, 0, list._blockSize); + if (index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) + { + ExchangeFoundItemIndexIfLower(context, blockIndex, ((long)blockIndex << list._blockSizePow2BitShift) + index); + return; + } + else if (context._isItemFound) + { + return; + } + +#if MAX_BLOCKS_FOR_TASK_2 || MAX_BLOCKS_FOR_TASK_3 || MAX_BLOCKS_FOR_TASK_4 || MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 1], itemToFind, 0, list._blockSize); + if (index >= 0) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 1, ((long)(blockIndex + 1) << list._blockSizePow2BitShift) + index); + return; + } + else if (context._isItemFound) + { + return; + } + +#endif + +#if MAX_BLOCKS_FOR_TASK_3 || MAX_BLOCKS_FOR_TASK_4 || MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 2], itemToFind, 0, list._blockSize); + if (index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 2, ((long)(blockIndex + 2) << list._blockSizePow2BitShift) + index); + return; + } + else if (context._isItemFound) + { + return; + } + +#endif + +#if MAX_BLOCKS_FOR_TASK_4 || MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 3], itemToFind, 0, list._blockSize); + if (!context._isItemFound && index >= 0) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 3, ((long)(blockIndex + 3) << list._blockSizePow2BitShift) + index); + } + +#endif + +#if MAX_BLOCKS_FOR_TASK_5 || MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 4], itemToFind, 0, list._blockSize); + if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 4, ((long)(blockIndex + 4) << list._blockSizePow2BitShift) + index); + } + +#endif + +#if MAX_BLOCKS_FOR_TASK_6 || MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 5], itemToFind, 0, list._blockSize); + if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 5, ((long)(blockIndex + 5) << list._blockSizePow2BitShift) + index); + } + +#endif + +#if MAX_BLOCKS_FOR_TASK_7 || MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 6], itemToFind, 0, list._blockSize); + if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 6, ((long)(blockIndex + 6) << list._blockSizePow2BitShift) + index); + } + +#endif + +#if MAX_BLOCKS_FOR_TASK_8 + + index = Array.IndexOf(list._memoryBlocks[blockIndex + 7], itemToFind, 0, list._blockSize); + if (!context._isItemFound && index >= 0 && (!context._isItemFound || index < context.FoundItemIndex)) + { + ExchangeFoundItemIndexIfLower(context, blockIndex + 7, ((long)(blockIndex + 7) << list._blockSizePow2BitShift) + index); + } + +#endif + } + catch (Exception e) + { + e.Data.Add("list", list); + e.Data.Add("itemToFind", itemToFind); + e.Data.Add("blockIndex", blockIndex); + _ = Interlocked.Exchange(ref context.Exception, e); + } + finally + { + context.RemoveParticipant(); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void ExchangeFoundItemIndexIfLower(IndexOfSynchronizationContext context, int blockIndex, long newItemIndex) + { + context.Lock(); + + if (newItemIndex < context.FoundItemIndex || context.FoundItemIndex == RecyclableDefaults.ItemNotFoundIndexLong) + { + context.FoundBlockIndex = blockIndex; + context.FoundItemIndex = newItemIndex; + } + + context._isItemFound = true; + context.Unlock(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + private static void IndexOfIn1Block(IndexOfSynchronizationContext context, RecyclableLongList list, int blockIndex, T itemToFind) + { + try + { + if (context._isItemFound) + { + return; + } + + long index = Array.IndexOf(list._memoryBlocks[blockIndex], itemToFind, 0, list._blockSize); + if (!context._isItemFound && index >= 0) + { + ExchangeFoundItemIndexIfLower(context, blockIndex, ((long)blockIndex << list._blockSizePow2BitShift) + index); + } + } + catch (Exception e) + { + _ = Interlocked.Exchange(ref context.Exception, e); + } + finally + { + context.RemoveParticipant(); + } + } + +#if MAX_BLOCKS_FOR_TASK_2 + private const int BlocksForEachTask = 2; +#endif +#if MAX_BLOCKS_FOR_TASK_3 + private const int BlocksForEachTask = 3; +#endif +#if MAX_BLOCKS_FOR_TASK_4 + private const int BlocksForEachTask = 4; +#endif +#if MAX_BLOCKS_FOR_TASK_5 + private const int BlocksForEachTask = 5; +#endif +#if MAX_BLOCKS_FOR_TASK_6 + private const int BlocksForEachTask = 6; +#endif +#if MAX_BLOCKS_FOR_TASK_7 + private const int BlocksForEachTask = 7; +#endif +#if MAX_BLOCKS_FOR_TASK_8 + private const int BlocksForEachTask = 8; +#endif + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static long IndexOfParallel(RecyclableLongList list, T item) + { + // & WAS SLOWER + //long itemsCount = Array.IndexOf(list._memoryBlocks[0], item, 0, (int)Math.Min(list._blockSize, list._longCount)); + //if (itemsCount >= 0) + //{ + // return itemsCount; + //} + + //using var context = new ParallelSynchronizationContext(1); + IndexOfSynchronizationContext context = IndexOfSynchronizationContextPool.GetWithOneParticipant(); + // (long)(_longCount * 0.329) => most efficient step, based on benchmarks + //Iterate(this, context, item); + + // & WAS SLOWER without + int blockIndex = 2; + // & WAS SLOWER + //long itemsCount = list._longCount - list._blockSize; + // & WAS SLOWER + // int blockSize = _blockSize; + // & WAS SLOWER + // while (((long)blockIndex << list._blockSizePow2BitShift) + itemIndex > step) + //long blockSize = checked((long)list._blockSize << 1); + int lastBlockWithData = list._lastBlockWithData - BlocksForEachTask; + while (blockIndex < lastBlockWithData) + { + // At this point itemIndex is limited to blockSize range - int. + + // & WAS SLOWER + // _ = ThreadPool.QueueUserWorkItem((_) => + // Task.Factory.StartNew(() => + context.AddParticipant(); + var startingBlock = blockIndex; + _ = Task.Run(() => IndexOfInConsecutiveBlocks(context, list, startingBlock, item)); + + // & WAS SLOWER + // ScheduleIndexOfTask(context, list, blockIndex, item); + if (context._isItemFound) + { + break; + } + + blockIndex += BlocksForEachTask; + } + + if (!context._isItemFound) + { + while (blockIndex < list._lastBlockWithData) + { + // & WAS SLOWER + // _ = ThreadPool.QueueUserWorkItem((_) => + // Task.Factory.StartNew(() => + var startingBlock = blockIndex; + context.AddParticipant(); + _ = Task.Run(() => IndexOfIn1Block(context, list, startingBlock, item)); + + // & WAS SLOWER + // ScheduleIndexOfTaskSingle(context, list, blockIndex, item); + if (context._isItemFound) + { + break; + } + + blockIndex++; + } + } + + if (!context._isItemFound) + { + int itemIndex = Array.IndexOf(list._memoryBlocks[list._lastBlockWithData], item, 0, list._nextItemIndex > 0 ? list._nextItemIndex : list._blockSize); + if (!context._isItemFound && itemIndex >= 0) + { + ExchangeFoundItemIndexIfLower(context, blockIndex, ((long)blockIndex << list._blockSizePow2BitShift) + itemIndex); + } + } + + context.SignalAndWait(); + if (context.Exception == null) + { + try + { + return context.FoundItemIndex; + } + finally + { + context.Dispose(); + } + } + + try + { + context.Exception.CaptureAndRethrow(); + } + finally + { + context.Dispose(); + } + + return RecyclableDefaults.ItemNotFoundIndexLong; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + public static long IndexOfSequential(RecyclableLongList list, in T item) //, in T[][] memoryBlocks, int lastBlockIndex, int blockSize, int nextItemIndex) + { + int itemIndex; + // & WAS SLOWER + //int lastBlockWithData = list._lastBlockWithData; + ReadOnlySpan memoryBlocksSpan = new(list._memoryBlocks, 0, list._lastBlockWithData + 1); + int blockIndex; + for (blockIndex = 1; blockIndex < list._lastBlockWithData; blockIndex += 4) + { + itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex], item, 0, list._blockSize); + if (itemIndex >= 0) + { + return itemIndex + ((long)blockIndex << list._blockSizePow2BitShift); + } + + if (blockIndex + 1 < list._lastBlockWithData) + { + itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 1], item, 0, list._blockSize); + if (itemIndex >= 0) + { + return itemIndex + ((long)(blockIndex + 1) << list._blockSizePow2BitShift); + } + + if (blockIndex + 2 < list._lastBlockWithData) + { + itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 2], item, 0, list._blockSize); + if (itemIndex >= 0) + { + return itemIndex + ((long)(blockIndex + 2) << list._blockSizePow2BitShift); + } + + if (blockIndex + 3 < list._lastBlockWithData) + { + itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 3], item, 0, list._blockSize); + if (itemIndex >= 0) + { + return itemIndex + ((long)(blockIndex + 3) << list._blockSizePow2BitShift); + } + } + } + } + } + + itemIndex = list._nextItemIndex != 0 + ? Array.IndexOf(memoryBlocksSpan[list._lastBlockWithData], item, 0, list._nextItemIndex) + : Array.IndexOf(memoryBlocksSpan[list._lastBlockWithData], item, 0, list._blockSize); + + return itemIndex >= 0 ? itemIndex + ((long)list._lastBlockWithData << list._blockSizePow2BitShift) : RecyclableDefaults.ItemNotFoundIndexLong; + } + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.VersionedEnumerator.cs b/Recyclable.Collections/RecyclableLongList.VersionedEnumerator.cs index cbb3e92..5774919 100644 --- a/Recyclable.Collections/RecyclableLongList.VersionedEnumerator.cs +++ b/Recyclable.Collections/RecyclableLongList.VersionedEnumerator.cs @@ -1,110 +1,110 @@ -using System.Collections; -using System.Diagnostics.Contracts; - -namespace Recyclable.Collections -{ - public partial class RecyclableLongList : IRecyclableVersionedLongList - { - [VersionedCollectionsGenerator.CloneForVersioned] - public VersionedEnumerator GetVersionedEnumerator() => new(this); - [VersionedCollectionsGenerator.CloneForVersioned] - VersionedEnumerator IRecyclableVersionedLongList.GetEnumerator() => new(this); - - [VersionedCollectionsGenerator.CloneForVersioned] - public struct VersionedEnumerator : IEnumerator - { -#nullable disable - private static readonly T _default = default; -#nullable restore - - private int _currentBlockIndex; - private int _currentItemIndex; - private readonly RecyclableLongList _list; - -#nullable disable - private T _current; -#nullable restore - - [Pure] - public readonly T Current => _enumeratorVersion == _list._version ? _current : throw new InvalidOperationException(); - - private readonly ulong _enumeratorVersion; - - public bool MoveNext() - { - var list = _list; - if (_enumeratorVersion != list._version) - { - throw new InvalidOperationException(); - } - - Contract.EndContractBlock(); - - if (_currentBlockIndex < list._lastBlockWithData) - { - _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; - if (_currentItemIndex + 1 < list._blockSize) - { - _currentItemIndex++; - } - else - { - _currentBlockIndex++; - _currentItemIndex = 0; - } - - return true; - } - // Move to the next item if we're within block boundaries, otherwise report end of collection. - else if (list._longCount > 0 && _currentItemIndex < (list._nextItemIndex > 0 ? list._nextItemIndex : list._blockSize)) - { - _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; - _currentItemIndex++; - return true; - } - - // We never clear .Current here, because it will be always cleared in .Dispose(), if needed. - - return false; - } - -#nullable disable - [Pure] - readonly object IEnumerator.Current => _enumeratorVersion == _list._version ? _current : throw new InvalidOperationException(); -#nullable restore - - public VersionedEnumerator(RecyclableLongList list) - { - _current = _default; - _currentBlockIndex = 0; - _currentItemIndex = 0; - _enumeratorVersion = list._version; - _list = list; - } - - public void Reset() - { - if (_enumeratorVersion != _list._version) - { - throw new InvalidOperationException(); - } - - if (_needsClearing) - { - _current = _default; - } - - _currentBlockIndex = 0; - _currentItemIndex = 0; - } - - public void Dispose() - { - if (_needsClearing) - { - _current = _default; - } - } - } - } -} +using System.Collections; +using System.Diagnostics.Contracts; + +namespace Recyclable.Collections +{ + public partial class RecyclableLongList : IRecyclableVersionedLongList + { + [VersionedCollectionsGenerator.CloneForVersioned] + public VersionedEnumerator GetVersionedEnumerator() => new(this); + [VersionedCollectionsGenerator.CloneForVersioned] + VersionedEnumerator IRecyclableVersionedLongList.GetEnumerator() => new(this); + + [VersionedCollectionsGenerator.CloneForVersioned] + public struct VersionedEnumerator : IEnumerator + { +#nullable disable + private static readonly T _default = default; +#nullable restore + + private int _currentBlockIndex; + private int _currentItemIndex; + private readonly RecyclableLongList _list; + +#nullable disable + private T _current; +#nullable restore + + [Pure] + public readonly T Current => _enumeratorVersion == _list._version ? _current : throw new InvalidOperationException(); + + private readonly ulong _enumeratorVersion; + + public bool MoveNext() + { + var list = _list; + if (_enumeratorVersion != list._version) + { + throw new InvalidOperationException(); + } + + Contract.EndContractBlock(); + + if (_currentBlockIndex < list._lastBlockWithData) + { + _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; + if (_currentItemIndex + 1 < list._blockSize) + { + _currentItemIndex++; + } + else + { + _currentBlockIndex++; + _currentItemIndex = 0; + } + + return true; + } + // Move to the next item if we're within block boundaries, otherwise report end of collection. + else if (list._longCount > 0 && _currentItemIndex < (list._nextItemIndex > 0 ? list._nextItemIndex : list._blockSize)) + { + _current = list._memoryBlocks[_currentBlockIndex][_currentItemIndex]; + _currentItemIndex++; + return true; + } + + // We never clear .Current here, because it will be always cleared in .Dispose(), if needed. + + return false; + } + +#nullable disable + [Pure] + readonly object IEnumerator.Current => _enumeratorVersion == _list._version ? _current : throw new InvalidOperationException(); +#nullable restore + + public VersionedEnumerator(RecyclableLongList list) + { + _current = _default; + _currentBlockIndex = 0; + _currentItemIndex = 0; + _enumeratorVersion = list._version; + _list = list; + } + + public void Reset() + { + if (_enumeratorVersion != _list._version) + { + throw new InvalidOperationException(); + } + + if (_needsClearing) + { + _current = _default; + } + + _currentBlockIndex = 0; + _currentItemIndex = 0; + } + + public void Dispose() + { + if (_needsClearing) + { + _current = _default; + } + } + } + } +} diff --git a/Recyclable.Collections/RecyclableLongList.cs b/Recyclable.Collections/RecyclableLongList.cs index a0ebb71..15cbb5d 100644 --- a/Recyclable.Collections/RecyclableLongList.cs +++ b/Recyclable.Collections/RecyclableLongList.cs @@ -1,710 +1,710 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -[assembly: InternalsVisibleTo("Recyclable.Collections.Benchmarks")] -[assembly: InternalsVisibleTo("Recyclable.CollectionsTests")] -[assembly: InternalsVisibleTo("Recyclable.Collections.Compatibility.List")] - -namespace Recyclable.Collections -{ - [VersionedCollectionsGenerator.GenerateVersioned] - public partial class RecyclableLongList : IList, IReadOnlyList, IDisposable - { - private static readonly bool _defaultIsNull = default(T) == null; - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - internal int _blockSize; - internal byte _blockSizePow2BitShift; - internal int _blockSizeMinus1; - internal long _capacity; - internal int _lastBlockWithData = RecyclableDefaults.ItemNotFoundIndex; - internal long _longCount; -#nullable disable - internal T[][] _memoryBlocks; -#nullable restore - internal int _nextItemBlockIndex; - internal int _nextItemIndex; - internal ulong _version; - - public int BlockSize => _blockSize; - public int BlockSizeMinus1 => _blockSizeMinus1; - public byte BlockSizePow2BitShift => _blockSizePow2BitShift; - public long Capacity - { - get => _capacity; - private set - { - _capacity = value; -#if WITH_VERSIONING - _version++; -#endif - if (_capacity != value) - { - _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)value))); -#if WITH_VERSIONING - _version++; -#endif - } - } - } - - public int Count => checked((int)_longCount); - public bool IsReadOnly => false; - public int LastBlockWithData => _lastBlockWithData; - public long LongCount => _longCount; - public int NextItemBlockIndex => _nextItemBlockIndex; - public int NextItemIndex => _nextItemIndex; - [VersionedCollectionsGenerator.CloneForVersioned] - public ulong Version => _version; - - public RecyclableLongList(int minBlockSize = RecyclableDefaults.BlockSize, long initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)initialCapacity))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - } - - public RecyclableLongList(in T[] source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.LongLength))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(in Array source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.LongLength))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(IReadOnlyList source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(ReadOnlySpan source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Length))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(RecyclableList source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(RecyclableLongList source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(Span source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Length))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(List source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(ICollection source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(ICollection source, int minBlockSize = RecyclableDefaults.BlockSize) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(IEnumerable source, int minBlockSize = RecyclableDefaults.BlockSize, long initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)initialCapacity))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public RecyclableLongList(IEnumerable source, int minBlockSize = RecyclableDefaults.BlockSize, long initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (!BitOperations.IsPow2(minBlockSize)) - { - minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); - } - - _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); - _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)initialCapacity))); - _blockSize = minBlockSize; - _blockSizeMinus1 = minBlockSize - 1; - - zRecyclableLongListAddRange.AddRange(this, source); - } - - public T this[long index] - { - get => _memoryBlocks[index >> _blockSizePow2BitShift][index & _blockSizeMinus1]; - set - { - new Span(_memoryBlocks[(int)(index >> _blockSizePow2BitShift)])[(int)(index & _blockSizeMinus1)] = value; -#if WITH_VERSIONING - _version++; -#endif - } - } - - public T this[int index] - { - get => _memoryBlocks[index >> _blockSizePow2BitShift][index & _blockSizeMinus1]; - set - { - new Span(_memoryBlocks[index >> _blockSizePow2BitShift])[index & _blockSizeMinus1] = value; -#if WITH_VERSIONING - _version++; -#endif - } - } - - public T[][] AsArray => _memoryBlocks; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(T item) - { - if (_capacity < _longCount + 1) - { - _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)(_longCount + 1)))); - } - - _memoryBlocks[_nextItemBlockIndex][_nextItemIndex++] = item; - if (_nextItemIndex == _blockSize) - { - if (_nextItemBlockIndex > _lastBlockWithData) - { - _lastBlockWithData++; - } - - _nextItemBlockIndex++; - _nextItemIndex = 0; - } - else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData) - { - _lastBlockWithData++; - } - - _longCount++; -#if WITH_VERSIONING - _version++; -#endif - } - - public void Clear() - { - if (_longCount == 0) - { - return; - } - - T[][] memoryBlocks = _memoryBlocks; - int toRemoveIdx = 0; - - if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) - { - while (toRemoveIdx < memoryBlocks.Length && memoryBlocks[toRemoveIdx] != null) - { - RecyclableArrayPool.ReturnShared(memoryBlocks[toRemoveIdx++], _needsClearing); - } - } - else if (_needsClearing) - { - while (toRemoveIdx < memoryBlocks.Length && memoryBlocks[toRemoveIdx] != null) - { - Array.Clear(memoryBlocks[toRemoveIdx++]); - } - } - - Array.Fill(_memoryBlocks, null); - _capacity = 0; - _nextItemBlockIndex = 0; - _nextItemIndex = 0; - _lastBlockWithData = RecyclableDefaults.ItemNotFoundIndex; - _longCount = 0; -#if WITH_VERSIONING - _version++; -#endif - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Contains(T item) - { - if (_longCount == 0) - { - return false; - } - - if (_nextItemBlockIndex == 0 || (_nextItemIndex == 0 && _nextItemBlockIndex == 1)) - { - return Array.IndexOf(_memoryBlocks[0], item, 0, (int)_longCount) >= 0; - } - - ReadOnlySpan memoryBlocksSpan = _memoryBlocks; - int lastBlockIndex = _lastBlockWithData; - for (int blockIndex = 0; blockIndex < lastBlockIndex; blockIndex++) - { - if (Array.IndexOf(memoryBlocksSpan[blockIndex], item, 0, _blockSize) >= 0) - { - return true; - } - } - - return Array.IndexOf(memoryBlocksSpan[lastBlockIndex], item, 0, _nextItemIndex > 0 ? _nextItemIndex : _blockSize) >= 0; - } - - public void CopyTo(T[] array, int arrayIndex) => Helpers.CopyTo(_memoryBlocks, 0, _blockSize, _longCount, array, arrayIndex); - - [VersionedCollectionsGenerator.CloneForVersioned] -#if WITH_VERSIONING - public VersionedEnumerator GetEnumerator() => new(this); -#else - public Enumerator GetEnumerator() => new(this); -#endif - [VersionedCollectionsGenerator.CloneForVersioned] -#if WITH_VERSIONING - IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); -#else - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); -#endif - [VersionedCollectionsGenerator.CloneForVersioned] -#if WITH_VERSIONING - IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); -#else - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); -#endif - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public int IndexOf(T item) - { - if (_lastBlockWithData == 0) - { - return Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); - } - else if (_longCount == 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - int itemIndex = Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); - if (itemIndex >= 0) - { - return itemIndex; - } - else if (_longCount < RecyclableDefaults.MinItemsCountForParallelization) - { - return (int)IndexOfHelpers.IndexOfSequential(this, item); - } - else - { - if (_longCount > _blockSize) - { - itemIndex = Array.IndexOf(_memoryBlocks[1], item, 0, (int)Math.Min(_blockSize, _longCount - _blockSize)); - return itemIndex >= 0 ? _blockSize + itemIndex : checked((int)IndexOfHelpers.IndexOfParallel(this, item)); - } - else - { - return RecyclableDefaults.ItemNotFoundIndex; - } - } - } - - public void Insert(int index, T item) - { - if (index > _longCount || index < 0) - { - Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount}"); - } - - if (_capacity < ++_longCount) - { - _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)_longCount))); - } - - if (index + 1 < _longCount) - { - Helpers.MakeRoomAndSet(this, index, item); - } - else - { - new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = item; - } - - if (++_nextItemIndex == _blockSize) - { - if (_nextItemBlockIndex > _lastBlockWithData) - { - _lastBlockWithData++; - } - - _nextItemBlockIndex++; - _nextItemIndex = 0; - } - else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData) - { - _lastBlockWithData++; - } - -#if WITH_VERSIONING - _version++; -#endif - } - - public void Insert(long index, T item) - { - if (index > _longCount || index < 0) - { - Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount}"); - } - - if (_capacity < ++_longCount) - { - _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)_longCount))); - } - - if (index + 1 < _longCount) - { - Helpers.MakeRoomAndSet(this, index, item); - } - else - { - new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = item; - } - - if (++_nextItemIndex == _blockSize) - { - if (_nextItemBlockIndex > _lastBlockWithData) - { - _lastBlockWithData++; - } - - _nextItemBlockIndex++; - _nextItemIndex = 0; - } - else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData) - { - _lastBlockWithData++; - } - -#if WITH_VERSIONING - _version++; -#endif - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public long LongIndexOf(T item) - { - if (_lastBlockWithData == 0) - { - return Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); - } - else if (_longCount == 0) - { - return RecyclableDefaults.ItemNotFoundIndex; - } - - int itemIndex = Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); - if (itemIndex >= 0) - { - return itemIndex; - } - else if (_longCount < RecyclableDefaults.MinItemsCountForParallelization) - { - return IndexOfHelpers.IndexOfSequential(this, item); - } - else - { - if (_longCount > _blockSize) - { - itemIndex = Array.IndexOf(_memoryBlocks[1], item, 0, (int)Math.Min(_blockSize, _longCount - _blockSize)); - return itemIndex >= 0 ? _blockSize + itemIndex : IndexOfHelpers.IndexOfParallel(this, item); - } - else - { - return RecyclableDefaults.ItemNotFoundIndex; - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public bool Remove(T item) - { - long index; - if ((index = LongIndexOf(item)) >= 0) - { - if (index < --_longCount) - { - Helpers.CopyFollowingItems(this, index); - } - - if (_nextItemIndex > 0) - { - _nextItemIndex--; - } - else - { - _nextItemIndex = _blockSizeMinus1; - _nextItemBlockIndex--; - } - - if (_nextItemIndex == 0) - { - _lastBlockWithData--; - } - - if (_needsClearing) - { -#nullable disable - new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default; -#nullable restore - } - -#if WITH_VERSIONING - _version++; -#endif - return true; - } - - return false; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public void RemoveAt(int index) - { - if (index >= _longCount || index < 0) - { - Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount - 1}"); - } - - if (index < --_longCount) - { - Helpers.CopyFollowingItems(this, index); - } - - if (_nextItemIndex > 0) - { - _nextItemIndex--; - } - else - { - _nextItemIndex = _blockSizeMinus1; - _nextItemBlockIndex--; - } - - if (_nextItemIndex == 0) - { - _lastBlockWithData--; - } - - if (_needsClearing) - { -#nullable disable - new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default; -#nullable restore - } - -#if WITH_VERSIONING - _version++; -#endif - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - public void RemoveAt(long index) - { - if (index >= _longCount || index < 0) - { - Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount - 1}"); - } - - if (index < --_longCount) - { - Helpers.CopyFollowingItems(this, index); - } - - if (_nextItemIndex > 0) - { - _nextItemIndex--; - } - else - { - _nextItemIndex = _blockSizeMinus1; - _nextItemBlockIndex--; - } - - if (_nextItemIndex == 0) - { - _lastBlockWithData--; - } - - if (_needsClearing) - { -#nullable disable - new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default; -#nullable restore - } - -#if WITH_VERSIONING - _version++; -#endif - } - - public void RemoveBlock(int index) - { - if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_memoryBlocks[index], _needsClearing); - } - - _memoryBlocks[index] = null; - _capacity -= _blockSize; - if (_nextItemBlockIndex == index) - { - _nextItemIndex = 0; - } - else if (_nextItemBlockIndex > index) - { - _nextItemBlockIndex--; - } - - _lastBlockWithData--; -#if WITH_VERSIONING - _version++; -#endif - } - - public void Dispose() - { -#if WITH_VERSIONING - _version++; -#endif - if (_capacity > 0) - { - Clear(); - if (_memoryBlocks.Length >= RecyclableDefaults.MinPooledArrayLength) - { - // If anything, it has been already cleared by .Clear(), Remove() or RemoveAt() methods, as the list was modified / disposed. - RecyclableArrayPool.ReturnShared(_memoryBlocks, false); - } - } - - GC.SuppressFinalize(this); - } - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +[assembly: InternalsVisibleTo("Recyclable.Collections.Benchmarks")] +[assembly: InternalsVisibleTo("Recyclable.CollectionsTests")] +[assembly: InternalsVisibleTo("Recyclable.Collections.Compatibility.List")] + +namespace Recyclable.Collections +{ + [VersionedCollectionsGenerator.GenerateVersioned] + public partial class RecyclableLongList : IList, IReadOnlyList, IDisposable + { + private static readonly bool _defaultIsNull = default(T) == null; + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + internal int _blockSize; + internal byte _blockSizePow2BitShift; + internal int _blockSizeMinus1; + internal long _capacity; + internal int _lastBlockWithData = RecyclableDefaults.ItemNotFoundIndex; + internal long _longCount; +#nullable disable + internal T[][] _memoryBlocks; +#nullable restore + internal int _nextItemBlockIndex; + internal int _nextItemIndex; + internal ulong _version; + + public int BlockSize => _blockSize; + public int BlockSizeMinus1 => _blockSizeMinus1; + public byte BlockSizePow2BitShift => _blockSizePow2BitShift; + public long Capacity + { + get => _capacity; + private set + { + _capacity = value; +#if WITH_VERSIONING + _version++; +#endif + if (_capacity != value) + { + _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)value))); +#if WITH_VERSIONING + _version++; +#endif + } + } + } + + public int Count => checked((int)_longCount); + public bool IsReadOnly => false; + public int LastBlockWithData => _lastBlockWithData; + public long LongCount => _longCount; + public int NextItemBlockIndex => _nextItemBlockIndex; + public int NextItemIndex => _nextItemIndex; + [VersionedCollectionsGenerator.CloneForVersioned] + public ulong Version => _version; + + public RecyclableLongList(int minBlockSize = RecyclableDefaults.BlockSize, long initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)initialCapacity))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + } + + public RecyclableLongList(in T[] source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.LongLength))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(in Array source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.LongLength))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(IReadOnlyList source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(ReadOnlySpan source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Length))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(RecyclableList source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(RecyclableLongList source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(Span source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Length))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(List source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(ICollection source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(ICollection source, int minBlockSize = RecyclableDefaults.BlockSize) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)source.Count))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(IEnumerable source, int minBlockSize = RecyclableDefaults.BlockSize, long initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)initialCapacity))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public RecyclableLongList(IEnumerable source, int minBlockSize = RecyclableDefaults.BlockSize, long initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (!BitOperations.IsPow2(minBlockSize)) + { + minBlockSize = checked((int)BitOperations.RoundUpToPowerOf2((uint)minBlockSize)); + } + + _blockSizePow2BitShift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize)); + _capacity = Helpers.Resize(this, minBlockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)initialCapacity))); + _blockSize = minBlockSize; + _blockSizeMinus1 = minBlockSize - 1; + + zRecyclableLongListAddRange.AddRange(this, source); + } + + public T this[long index] + { + get => _memoryBlocks[index >> _blockSizePow2BitShift][index & _blockSizeMinus1]; + set + { + new Span(_memoryBlocks[(int)(index >> _blockSizePow2BitShift)])[(int)(index & _blockSizeMinus1)] = value; +#if WITH_VERSIONING + _version++; +#endif + } + } + + public T this[int index] + { + get => _memoryBlocks[index >> _blockSizePow2BitShift][index & _blockSizeMinus1]; + set + { + new Span(_memoryBlocks[index >> _blockSizePow2BitShift])[index & _blockSizeMinus1] = value; +#if WITH_VERSIONING + _version++; +#endif + } + } + + public T[][] AsArray => _memoryBlocks; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(T item) + { + if (_capacity < _longCount + 1) + { + _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)(_longCount + 1)))); + } + + _memoryBlocks[_nextItemBlockIndex][_nextItemIndex++] = item; + if (_nextItemIndex == _blockSize) + { + if (_nextItemBlockIndex > _lastBlockWithData) + { + _lastBlockWithData++; + } + + _nextItemBlockIndex++; + _nextItemIndex = 0; + } + else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData) + { + _lastBlockWithData++; + } + + _longCount++; +#if WITH_VERSIONING + _version++; +#endif + } + + public void Clear() + { + if (_longCount == 0) + { + return; + } + + T[][] memoryBlocks = _memoryBlocks; + int toRemoveIdx = 0; + + if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) + { + while (toRemoveIdx < memoryBlocks.Length && memoryBlocks[toRemoveIdx] != null) + { + RecyclableArrayPool.ReturnShared(memoryBlocks[toRemoveIdx++], _needsClearing); + } + } + else if (_needsClearing) + { + while (toRemoveIdx < memoryBlocks.Length && memoryBlocks[toRemoveIdx] != null) + { + Array.Clear(memoryBlocks[toRemoveIdx++]); + } + } + + Array.Fill(_memoryBlocks, null); + _capacity = 0; + _nextItemBlockIndex = 0; + _nextItemIndex = 0; + _lastBlockWithData = RecyclableDefaults.ItemNotFoundIndex; + _longCount = 0; +#if WITH_VERSIONING + _version++; +#endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(T item) + { + if (_longCount == 0) + { + return false; + } + + if (_nextItemBlockIndex == 0 || (_nextItemIndex == 0 && _nextItemBlockIndex == 1)) + { + return Array.IndexOf(_memoryBlocks[0], item, 0, (int)_longCount) >= 0; + } + + ReadOnlySpan memoryBlocksSpan = _memoryBlocks; + int lastBlockIndex = _lastBlockWithData; + for (int blockIndex = 0; blockIndex < lastBlockIndex; blockIndex++) + { + if (Array.IndexOf(memoryBlocksSpan[blockIndex], item, 0, _blockSize) >= 0) + { + return true; + } + } + + return Array.IndexOf(memoryBlocksSpan[lastBlockIndex], item, 0, _nextItemIndex > 0 ? _nextItemIndex : _blockSize) >= 0; + } + + public void CopyTo(T[] array, int arrayIndex) => Helpers.CopyTo(_memoryBlocks, 0, _blockSize, _longCount, array, arrayIndex); + + [VersionedCollectionsGenerator.CloneForVersioned] +#if WITH_VERSIONING + public VersionedEnumerator GetEnumerator() => new(this); +#else + public Enumerator GetEnumerator() => new(this); +#endif + [VersionedCollectionsGenerator.CloneForVersioned] +#if WITH_VERSIONING + IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); +#else + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); +#endif + [VersionedCollectionsGenerator.CloneForVersioned] +#if WITH_VERSIONING + IEnumerator IEnumerable.GetEnumerator() => new VersionedEnumerator(this); +#else + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); +#endif + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public int IndexOf(T item) + { + if (_lastBlockWithData == 0) + { + return Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); + } + else if (_longCount == 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + int itemIndex = Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); + if (itemIndex >= 0) + { + return itemIndex; + } + else if (_longCount < RecyclableDefaults.MinItemsCountForParallelization) + { + return (int)IndexOfHelpers.IndexOfSequential(this, item); + } + else + { + if (_longCount > _blockSize) + { + itemIndex = Array.IndexOf(_memoryBlocks[1], item, 0, (int)Math.Min(_blockSize, _longCount - _blockSize)); + return itemIndex >= 0 ? _blockSize + itemIndex : checked((int)IndexOfHelpers.IndexOfParallel(this, item)); + } + else + { + return RecyclableDefaults.ItemNotFoundIndex; + } + } + } + + public void Insert(int index, T item) + { + if (index > _longCount || index < 0) + { + Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount}"); + } + + if (_capacity < ++_longCount) + { + _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)_longCount))); + } + + if (index + 1 < _longCount) + { + Helpers.MakeRoomAndSet(this, index, item); + } + else + { + new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = item; + } + + if (++_nextItemIndex == _blockSize) + { + if (_nextItemBlockIndex > _lastBlockWithData) + { + _lastBlockWithData++; + } + + _nextItemBlockIndex++; + _nextItemIndex = 0; + } + else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData) + { + _lastBlockWithData++; + } + +#if WITH_VERSIONING + _version++; +#endif + } + + public void Insert(long index, T item) + { + if (index > _longCount || index < 0) + { + Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount}"); + } + + if (_capacity < ++_longCount) + { + _capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)_longCount))); + } + + if (index + 1 < _longCount) + { + Helpers.MakeRoomAndSet(this, index, item); + } + else + { + new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = item; + } + + if (++_nextItemIndex == _blockSize) + { + if (_nextItemBlockIndex > _lastBlockWithData) + { + _lastBlockWithData++; + } + + _nextItemBlockIndex++; + _nextItemIndex = 0; + } + else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData) + { + _lastBlockWithData++; + } + +#if WITH_VERSIONING + _version++; +#endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public long LongIndexOf(T item) + { + if (_lastBlockWithData == 0) + { + return Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); + } + else if (_longCount == 0) + { + return RecyclableDefaults.ItemNotFoundIndex; + } + + int itemIndex = Array.IndexOf(_memoryBlocks[0], item, 0, _longCount < _blockSize ? _nextItemIndex : _blockSize); + if (itemIndex >= 0) + { + return itemIndex; + } + else if (_longCount < RecyclableDefaults.MinItemsCountForParallelization) + { + return IndexOfHelpers.IndexOfSequential(this, item); + } + else + { + if (_longCount > _blockSize) + { + itemIndex = Array.IndexOf(_memoryBlocks[1], item, 0, (int)Math.Min(_blockSize, _longCount - _blockSize)); + return itemIndex >= 0 ? _blockSize + itemIndex : IndexOfHelpers.IndexOfParallel(this, item); + } + else + { + return RecyclableDefaults.ItemNotFoundIndex; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public bool Remove(T item) + { + long index; + if ((index = LongIndexOf(item)) >= 0) + { + if (index < --_longCount) + { + Helpers.CopyFollowingItems(this, index); + } + + if (_nextItemIndex > 0) + { + _nextItemIndex--; + } + else + { + _nextItemIndex = _blockSizeMinus1; + _nextItemBlockIndex--; + } + + if (_nextItemIndex == 0) + { + _lastBlockWithData--; + } + + if (_needsClearing) + { +#nullable disable + new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default; +#nullable restore + } + +#if WITH_VERSIONING + _version++; +#endif + return true; + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public void RemoveAt(int index) + { + if (index >= _longCount || index < 0) + { + Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount - 1}"); + } + + if (index < --_longCount) + { + Helpers.CopyFollowingItems(this, index); + } + + if (_nextItemIndex > 0) + { + _nextItemIndex--; + } + else + { + _nextItemIndex = _blockSizeMinus1; + _nextItemBlockIndex--; + } + + if (_nextItemIndex == 0) + { + _lastBlockWithData--; + } + + if (_needsClearing) + { +#nullable disable + new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default; +#nullable restore + } + +#if WITH_VERSIONING + _version++; +#endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public void RemoveAt(long index) + { + if (index >= _longCount || index < 0) + { + Helpers.ThrowIndexOutOfRangeException($"Argument \"{nameof(index)}\" = {index} is out of range. Expected value between 0 and {_longCount - 1}"); + } + + if (index < --_longCount) + { + Helpers.CopyFollowingItems(this, index); + } + + if (_nextItemIndex > 0) + { + _nextItemIndex--; + } + else + { + _nextItemIndex = _blockSizeMinus1; + _nextItemBlockIndex--; + } + + if (_nextItemIndex == 0) + { + _lastBlockWithData--; + } + + if (_needsClearing) + { +#nullable disable + new Span(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default; +#nullable restore + } + +#if WITH_VERSIONING + _version++; +#endif + } + + public void RemoveBlock(int index) + { + if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_memoryBlocks[index], _needsClearing); + } + + _memoryBlocks[index] = null; + _capacity -= _blockSize; + if (_nextItemBlockIndex == index) + { + _nextItemIndex = 0; + } + else if (_nextItemBlockIndex > index) + { + _nextItemBlockIndex--; + } + + _lastBlockWithData--; +#if WITH_VERSIONING + _version++; +#endif + } + + public void Dispose() + { +#if WITH_VERSIONING + _version++; +#endif + if (_capacity > 0) + { + Clear(); + if (_memoryBlocks.Length >= RecyclableDefaults.MinPooledArrayLength) + { + // If anything, it has been already cleared by .Clear(), Remove() or RemoveAt() methods, as the list was modified / disposed. + RecyclableArrayPool.ReturnShared(_memoryBlocks, false); + } + } + + GC.SuppressFinalize(this); + } + } +} diff --git a/Recyclable.Collections/RecyclablePriorityQueue.AddRange.cs b/Recyclable.Collections/RecyclablePriorityQueue.AddRange.cs index 1fd4b36..dffa760 100644 --- a/Recyclable.Collections/RecyclablePriorityQueue.AddRange.cs +++ b/Recyclable.Collections/RecyclablePriorityQueue.AddRange.cs @@ -1,1335 +1,1335 @@ -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Collections; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class zRecyclablePriorityQueueAddRange - { - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Action, object>? _sortedDictionaryAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - private static readonly Type? _sortedDictionaryType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); - - MethodInfo? method = typeof(zRecyclablePriorityQueueAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclablePriorityQueue<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var queueParam = Expression.Parameter(typeof(RecyclablePriorityQueue)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); - } - - method = typeof(zRecyclablePriorityQueueAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclablePriorityQueue<>).MakeGenericType(elementType), _sortedDictionaryType }, - modifiers: null); - if (method != null) - { - var queueParam = Expression.Parameter(typeof(RecyclablePriorityQueue)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _sortedDictionaryType)); - _sortedDictionaryAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclablePriorityQueueAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclablePriorityQueue<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var queueParam = Expression.Parameter(typeof(RecyclablePriorityQueue)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclablePriorityQueue queue, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(queue, items); - return true; - } - - if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) - { - _sortedDictionaryAdder(queue, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(queue, items); - return true; - } - - return false; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void EnsureCapacity(RecyclablePriorityQueue queue, int min) - { - if (queue._heap.Length >= min) - { - return; - } - - int newSize = queue._heap.Length; - do - { - if (newSize >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - break; - } - - newSize <<= 1; - } - while (newSize < min); - - if (newSize < min) - { - newSize = min; - } - - T[] newHeap = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - System.Array.Copy(queue._heap, newHeap, queue._size); - - if (queue._heap.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(queue._heap, RecyclablePriorityQueue._needsClearing); - } - - queue._heap = newHeap; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, ReadOnlySpan items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = items[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, Span items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = items[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, ReadOnlyMemory items) - { - ReadOnlySpan span = items.Span; - int count = span.Length; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = span[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, Memory items) - { - Span span = items.Span; - int count = span.Length; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = span[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, T[] items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = items[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, in Array items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - Array.Copy(items, items.GetLowerBound(0), queue._heap, startIndex, count); - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, List items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = items[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - Array.Copy(buffer, 0, queue._heap, startIndex, count); - queue._size = newCount; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclablePriorityQueue._needsClearing); - } - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - Array.Copy(buffer, 0, queue._heap, startIndex, count); - queue._size = newCount; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclablePriorityQueue._needsClearing); - } - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableList items) - { - int count = items._count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - T[] source = items._memoryBlock; - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = source[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclablePriorityQueue items) - { - int count = items._size; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - T[] source = items._heap; - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = source[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableQueue items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - int count = checked((int)longCount); - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - var sourceChunk = items._head; - int destIndex = startIndex; - while (sourceChunk != null) - { - int sourceIndex = sourceChunk.Bottom; - int sourceTop = sourceChunk.Top; - T[] source = sourceChunk.Value; - - while (sourceIndex < sourceTop) - { - queue._heap[destIndex++] = source[sourceIndex++]; - } - - sourceChunk = sourceChunk.Next; - } - - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableStack items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - int count = checked((int)longCount); - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - var sourceChunk = items._current; - while (sourceChunk.Previous != null) - { - sourceChunk = sourceChunk.Previous; - } - - int destIndex = startIndex; - while (sourceChunk != null) - { - T[] source = sourceChunk.Value; - int sourceCount = sourceChunk.Index; - int sourceIndex = 0; - - while (sourceIndex < sourceCount) - { - queue._heap[destIndex++] = source[sourceIndex++]; - } - - sourceChunk = sourceChunk.Next; - } - - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableLinkedList items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - int count = checked((int)longCount); - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - var sourceChunk = items._head; - int destIndex = startIndex; - while (sourceChunk != null) - { - int sourceIndex = sourceChunk.Bottom; - int sourceTop = sourceChunk.Top; - T[] source = sourceChunk.Value; - - while (sourceIndex < sourceTop) - { - queue._heap[destIndex++] = source[sourceIndex++]; - } - - sourceChunk = sourceChunk.Next; - } - - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableSortedSet items) - { - int count = items._count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - T[] source = items._items; - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = source[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableHashSet items) - { - int count = items._count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = entries[i >> shift][i & mask].Value; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableLongList items) - { - long longCount = items._longCount; - if (longCount == 0) - { - return; - } - - int blockSize = items._blockSize; - int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); - int lastBlockLength = (int)(longCount & items._blockSizeMinus1); - - int startIndex = queue._size; - int newCount = startIndex + checked((int)longCount); - EnsureCapacity(queue, newCount); - - int destIndex = startIndex; - for (int blockIndex = 0; blockIndex < fullBlocks; blockIndex++) - { - T[] block = items._memoryBlocks[blockIndex]; - int sourceIndex = 0; - while (sourceIndex < blockSize) - { - queue._heap[destIndex++] = block[sourceIndex++]; - } - } - - if (lastBlockLength > 0) - { - T[] block = items._memoryBlocks[fullBlocks]; - int sourceIndex = 0; - while (sourceIndex < lastBlockLength) - { - queue._heap[destIndex++] = block[sourceIndex++]; - } - } - - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue> queue, RecyclableDictionary items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - for (int i = 0; i < count; i++) - { - ref var src = ref entries[i >> shift][i & mask]; - queue._heap[startIndex + i] = new KeyValuePair(src.Key, src.Value); - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - var item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue> queue, RecyclableSortedDictionary items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = new KeyValuePair(items.GetKey(i), items.GetValue(i)); - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - var item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue<(TKey Key, TValue Value)> queue, RecyclableSortedList items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - TKey[] keys = items._keys; - TValue[] values = items._values; - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = (keys[i], values[i]); - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - var item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, IReadOnlyList items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - for (int i = 0; i < count; i++) - { - queue._heap[startIndex + i] = items[i]; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int index = i; - T item = queue._heap[index]; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], item) >= 0) - { - break; - } - - queue._heap[index] = queue._heap[child]; - index = child; - } - - queue._heap[index] = item; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, IReadOnlyCollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - int startIndex = queue._size; - int newCount = startIndex + count; - EnsureCapacity(queue, newCount); - - int index = startIndex; - foreach (T item in items) - { - queue._heap[index++] = item; - } - queue._size = newCount; - - int half = newCount >> 1; - for (int i = half - 1; i >= 0; i--) - { - int idx = i; - T current = queue._heap[idx]; - while (idx < half) - { - int child = (idx << 1) + 1; - int right = child + 1; - if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) - { - child = right; - } - - if (queue._comparer.Compare(queue._heap[child], current) >= 0) - { - break; - } - - queue._heap[idx] = queue._heap[child]; - idx = child; - } - - queue._heap[idx] = current; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static IEnumerator AddRange(this RecyclablePriorityQueue queue, IEnumerable source) - { - IEnumerator enumerator = source.GetEnumerator(); - while (enumerator.MoveNext()) - { - queue.Enqueue((T)enumerator.Current!); - } - - return enumerator; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclablePriorityQueue queue, IEnumerable items) - { - if (items is RecyclableList recyclableList) - { - AddRange(queue, recyclableList); - } - else if (items is RecyclablePriorityQueue priorityQueue) - { - AddRange(queue, priorityQueue); - } - else if (items is RecyclableQueue recyclableQueue) - { - AddRange(queue, recyclableQueue); - } - else if (items is RecyclableStack recyclableStack) - { - AddRange(queue, recyclableStack); - } - else if (items is RecyclableLinkedList linkedList) - { - AddRange(queue, linkedList); - } - else if (items is RecyclableSortedSet sortedSet) - { - AddRange(queue, sortedSet); - } - else if (items is RecyclableHashSet hashSet) - { - AddRange(queue, hashSet); - } - else if (items is RecyclableLongList longList) - { - AddRange(queue, longList); - } - else if (items is T[] array) - { - AddRange(queue, array); - } - else if (items is List list) - { - AddRange(queue, list); - } - else if (items is ICollection genericCollection) - { - AddRange(queue, genericCollection); - } - else if (items is ICollection collection) - { - AddRange(queue, collection); - } - else if (AddRangeHelper.TryAddRange(queue, items)) - { - } - else if (items is IReadOnlyList readOnlyList) - { - AddRange(queue, readOnlyList); - } - else if (items is IReadOnlyCollection readOnlyCollection) - { - AddRange(queue, readOnlyCollection); - } - else - { - foreach (T item in items) - { - queue.Enqueue(item); - } - } - } - } -} +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Collections; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class zRecyclablePriorityQueueAddRange + { + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Action, object>? _sortedDictionaryAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + private static readonly Type? _sortedDictionaryType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); + + MethodInfo? method = typeof(zRecyclablePriorityQueueAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclablePriorityQueue<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var queueParam = Expression.Parameter(typeof(RecyclablePriorityQueue)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); + } + + method = typeof(zRecyclablePriorityQueueAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclablePriorityQueue<>).MakeGenericType(elementType), _sortedDictionaryType }, + modifiers: null); + if (method != null) + { + var queueParam = Expression.Parameter(typeof(RecyclablePriorityQueue)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _sortedDictionaryType)); + _sortedDictionaryAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclablePriorityQueueAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclablePriorityQueue<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var queueParam = Expression.Parameter(typeof(RecyclablePriorityQueue)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclablePriorityQueue queue, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(queue, items); + return true; + } + + if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) + { + _sortedDictionaryAdder(queue, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(queue, items); + return true; + } + + return false; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnsureCapacity(RecyclablePriorityQueue queue, int min) + { + if (queue._heap.Length >= min) + { + return; + } + + int newSize = queue._heap.Length; + do + { + if (newSize >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + break; + } + + newSize <<= 1; + } + while (newSize < min); + + if (newSize < min) + { + newSize = min; + } + + T[] newHeap = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + System.Array.Copy(queue._heap, newHeap, queue._size); + + if (queue._heap.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(queue._heap, RecyclablePriorityQueue._needsClearing); + } + + queue._heap = newHeap; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, ReadOnlySpan items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = items[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, Span items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = items[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, ReadOnlyMemory items) + { + ReadOnlySpan span = items.Span; + int count = span.Length; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = span[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, Memory items) + { + Span span = items.Span; + int count = span.Length; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = span[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, T[] items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = items[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, in Array items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + Array.Copy(items, items.GetLowerBound(0), queue._heap, startIndex, count); + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, List items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = items[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + Array.Copy(buffer, 0, queue._heap, startIndex, count); + queue._size = newCount; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclablePriorityQueue._needsClearing); + } + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + Array.Copy(buffer, 0, queue._heap, startIndex, count); + queue._size = newCount; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclablePriorityQueue._needsClearing); + } + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableList items) + { + int count = items._count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + T[] source = items._memoryBlock; + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = source[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclablePriorityQueue items) + { + int count = items._size; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + T[] source = items._heap; + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = source[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableQueue items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + int count = checked((int)longCount); + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + var sourceChunk = items._head; + int destIndex = startIndex; + while (sourceChunk != null) + { + int sourceIndex = sourceChunk.Bottom; + int sourceTop = sourceChunk.Top; + T[] source = sourceChunk.Value; + + while (sourceIndex < sourceTop) + { + queue._heap[destIndex++] = source[sourceIndex++]; + } + + sourceChunk = sourceChunk.Next; + } + + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableStack items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + int count = checked((int)longCount); + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + var sourceChunk = items._current; + while (sourceChunk.Previous != null) + { + sourceChunk = sourceChunk.Previous; + } + + int destIndex = startIndex; + while (sourceChunk != null) + { + T[] source = sourceChunk.Value; + int sourceCount = sourceChunk.Index; + int sourceIndex = 0; + + while (sourceIndex < sourceCount) + { + queue._heap[destIndex++] = source[sourceIndex++]; + } + + sourceChunk = sourceChunk.Next; + } + + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableLinkedList items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + int count = checked((int)longCount); + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + var sourceChunk = items._head; + int destIndex = startIndex; + while (sourceChunk != null) + { + int sourceIndex = sourceChunk.Bottom; + int sourceTop = sourceChunk.Top; + T[] source = sourceChunk.Value; + + while (sourceIndex < sourceTop) + { + queue._heap[destIndex++] = source[sourceIndex++]; + } + + sourceChunk = sourceChunk.Next; + } + + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableSortedSet items) + { + int count = items._count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + T[] source = items._items; + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = source[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableHashSet items) + { + int count = items._count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = entries[i >> shift][i & mask].Value; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, RecyclableLongList items) + { + long longCount = items._longCount; + if (longCount == 0) + { + return; + } + + int blockSize = items._blockSize; + int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); + int lastBlockLength = (int)(longCount & items._blockSizeMinus1); + + int startIndex = queue._size; + int newCount = startIndex + checked((int)longCount); + EnsureCapacity(queue, newCount); + + int destIndex = startIndex; + for (int blockIndex = 0; blockIndex < fullBlocks; blockIndex++) + { + T[] block = items._memoryBlocks[blockIndex]; + int sourceIndex = 0; + while (sourceIndex < blockSize) + { + queue._heap[destIndex++] = block[sourceIndex++]; + } + } + + if (lastBlockLength > 0) + { + T[] block = items._memoryBlocks[fullBlocks]; + int sourceIndex = 0; + while (sourceIndex < lastBlockLength) + { + queue._heap[destIndex++] = block[sourceIndex++]; + } + } + + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue> queue, RecyclableDictionary items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + for (int i = 0; i < count; i++) + { + ref var src = ref entries[i >> shift][i & mask]; + queue._heap[startIndex + i] = new KeyValuePair(src.Key, src.Value); + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + var item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue> queue, RecyclableSortedDictionary items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = new KeyValuePair(items.GetKey(i), items.GetValue(i)); + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + var item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue<(TKey Key, TValue Value)> queue, RecyclableSortedList items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + TKey[] keys = items._keys; + TValue[] values = items._values; + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = (keys[i], values[i]); + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + var item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, IReadOnlyList items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + for (int i = 0; i < count; i++) + { + queue._heap[startIndex + i] = items[i]; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int index = i; + T item = queue._heap[index]; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], item) >= 0) + { + break; + } + + queue._heap[index] = queue._heap[child]; + index = child; + } + + queue._heap[index] = item; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, IReadOnlyCollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + int startIndex = queue._size; + int newCount = startIndex + count; + EnsureCapacity(queue, newCount); + + int index = startIndex; + foreach (T item in items) + { + queue._heap[index++] = item; + } + queue._size = newCount; + + int half = newCount >> 1; + for (int i = half - 1; i >= 0; i--) + { + int idx = i; + T current = queue._heap[idx]; + while (idx < half) + { + int child = (idx << 1) + 1; + int right = child + 1; + if (right < newCount && queue._comparer.Compare(queue._heap[right], queue._heap[child]) < 0) + { + child = right; + } + + if (queue._comparer.Compare(queue._heap[child], current) >= 0) + { + break; + } + + queue._heap[idx] = queue._heap[child]; + idx = child; + } + + queue._heap[idx] = current; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static IEnumerator AddRange(this RecyclablePriorityQueue queue, IEnumerable source) + { + IEnumerator enumerator = source.GetEnumerator(); + while (enumerator.MoveNext()) + { + queue.Enqueue((T)enumerator.Current!); + } + + return enumerator; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclablePriorityQueue queue, IEnumerable items) + { + if (items is RecyclableList recyclableList) + { + AddRange(queue, recyclableList); + } + else if (items is RecyclablePriorityQueue priorityQueue) + { + AddRange(queue, priorityQueue); + } + else if (items is RecyclableQueue recyclableQueue) + { + AddRange(queue, recyclableQueue); + } + else if (items is RecyclableStack recyclableStack) + { + AddRange(queue, recyclableStack); + } + else if (items is RecyclableLinkedList linkedList) + { + AddRange(queue, linkedList); + } + else if (items is RecyclableSortedSet sortedSet) + { + AddRange(queue, sortedSet); + } + else if (items is RecyclableHashSet hashSet) + { + AddRange(queue, hashSet); + } + else if (items is RecyclableLongList longList) + { + AddRange(queue, longList); + } + else if (items is T[] array) + { + AddRange(queue, array); + } + else if (items is List list) + { + AddRange(queue, list); + } + else if (items is ICollection genericCollection) + { + AddRange(queue, genericCollection); + } + else if (items is ICollection collection) + { + AddRange(queue, collection); + } + else if (AddRangeHelper.TryAddRange(queue, items)) + { + } + else if (items is IReadOnlyList readOnlyList) + { + AddRange(queue, readOnlyList); + } + else if (items is IReadOnlyCollection readOnlyCollection) + { + AddRange(queue, readOnlyCollection); + } + else + { + foreach (T item in items) + { + queue.Enqueue(item); + } + } + } + } +} diff --git a/Recyclable.Collections/RecyclablePriorityQueue.cs b/Recyclable.Collections/RecyclablePriorityQueue.cs index ca80fab..d815a4c 100644 --- a/Recyclable.Collections/RecyclablePriorityQueue.cs +++ b/Recyclable.Collections/RecyclablePriorityQueue.cs @@ -1,244 +1,244 @@ -using System.Collections; -using System.Runtime.CompilerServices; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclablePriorityQueue : IEnumerable, IDisposable - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - internal readonly IComparer _comparer; - -#nullable disable - internal T[] _heap; -#nullable restore - internal int _size; - internal bool _disposed; - - public RecyclablePriorityQueue(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _heap = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(initialCapacity) - : new T[initialCapacity]; - _size = 0; - _comparer = comparer ?? Comparer.Default; - } - - public int Count => _size; - public long LongCount => _size; - - public void Enqueue(T item) - { - if (_size == _heap.Length) - { - Grow(); - } - - int index = _size++; - _heap[index] = item; - MoveUp(index); - } - - public T Dequeue() - { - if (_size == 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_size), "Queue is empty"); - } - - var root = _heap[0]; - if (_needsClearing) - { - _heap[0] = default!; - } - - _size--; - if (_size > 0) - { - _heap[0] = _heap[_size]; - if (_needsClearing) - { - _heap[_size] = default!; - } - - MoveDown(0); - } - - return root; - } - - public bool TryDequeue(out T? item) - { - if (_size > 0) - { - item = Dequeue(); - return true; - } - - item = default; - return false; - } - - public T Peek() - { - if (_size == 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_size), "Queue is empty"); - } - - return _heap[0]; - } - - public void Clear() - { - if (_needsClearing) - { - Array.Clear(_heap, 0, _size); - } - - _size = 0; - } - - public Enumerator GetEnumerator() => new(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - private void Grow() - { - int newSize; - if (_heap.Length >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - var doubled = _heap.Length << 1; - newSize = (int)Math.Min(doubled, RecyclableDefaults.MaxPooledBlockSize); - } - - var newHeap = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - Array.Copy(_heap, newHeap, _size); - - if (_heap.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_heap, _needsClearing); - } - - _heap = newHeap; - } - - private void MoveUp(int index) - { - var item = _heap[index]; - while (index > 0) - { - int parent = (index - 1) >> 1; - if (_comparer.Compare(item, _heap[parent]) >= 0) - { - break; - } - - _heap[index] = _heap[parent]; - index = parent; - } - - _heap[index] = item; - } - - private void MoveDown(int index) - { - var item = _heap[index]; - int half = _size >> 1; - while (index < half) - { - int child = (index << 1) + 1; - int right = child + 1; - if (right < _size && _comparer.Compare(_heap[right], _heap[child]) < 0) - { - child = right; - } - - if (_comparer.Compare(_heap[child], item) >= 0) - { - break; - } - - _heap[index] = _heap[child]; - index = child; - } - - _heap[index] = item; - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - if (_heap.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_heap, _needsClearing); - } - - _heap = Array.Empty(); - _size = 0; - _disposed = true; - GC.SuppressFinalize(this); - } - - public struct Enumerator : IEnumerator - { - private readonly RecyclablePriorityQueue _queue; - private int _index; - private T? _current; - - internal Enumerator(RecyclablePriorityQueue queue) - { - _queue = queue; - _index = 0; - _current = default; - } - - public T Current => _current!; - object IEnumerator.Current => _current!; - - public bool MoveNext() - { - if (_index >= _queue._size) - { - return false; - } - - _current = _queue._heap[_index++]; - return true; - } - - public void Reset() - { - _index = 0; - _current = default; - } - - public void Dispose() - { - _current = default; - } - } - } -} +using System.Collections; +using System.Runtime.CompilerServices; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclablePriorityQueue : IEnumerable, IDisposable + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + internal readonly IComparer _comparer; + +#nullable disable + internal T[] _heap; +#nullable restore + internal int _size; + internal bool _disposed; + + public RecyclablePriorityQueue(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _heap = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(initialCapacity) + : new T[initialCapacity]; + _size = 0; + _comparer = comparer ?? Comparer.Default; + } + + public int Count => _size; + public long LongCount => _size; + + public void Enqueue(T item) + { + if (_size == _heap.Length) + { + Grow(); + } + + int index = _size++; + _heap[index] = item; + MoveUp(index); + } + + public T Dequeue() + { + if (_size == 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_size), "Queue is empty"); + } + + var root = _heap[0]; + if (_needsClearing) + { + _heap[0] = default!; + } + + _size--; + if (_size > 0) + { + _heap[0] = _heap[_size]; + if (_needsClearing) + { + _heap[_size] = default!; + } + + MoveDown(0); + } + + return root; + } + + public bool TryDequeue(out T? item) + { + if (_size > 0) + { + item = Dequeue(); + return true; + } + + item = default; + return false; + } + + public T Peek() + { + if (_size == 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_size), "Queue is empty"); + } + + return _heap[0]; + } + + public void Clear() + { + if (_needsClearing) + { + Array.Clear(_heap, 0, _size); + } + + _size = 0; + } + + public Enumerator GetEnumerator() => new(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + private void Grow() + { + int newSize; + if (_heap.Length >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + var doubled = _heap.Length << 1; + newSize = (int)Math.Min(doubled, RecyclableDefaults.MaxPooledBlockSize); + } + + var newHeap = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + Array.Copy(_heap, newHeap, _size); + + if (_heap.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_heap, _needsClearing); + } + + _heap = newHeap; + } + + private void MoveUp(int index) + { + var item = _heap[index]; + while (index > 0) + { + int parent = (index - 1) >> 1; + if (_comparer.Compare(item, _heap[parent]) >= 0) + { + break; + } + + _heap[index] = _heap[parent]; + index = parent; + } + + _heap[index] = item; + } + + private void MoveDown(int index) + { + var item = _heap[index]; + int half = _size >> 1; + while (index < half) + { + int child = (index << 1) + 1; + int right = child + 1; + if (right < _size && _comparer.Compare(_heap[right], _heap[child]) < 0) + { + child = right; + } + + if (_comparer.Compare(_heap[child], item) >= 0) + { + break; + } + + _heap[index] = _heap[child]; + index = child; + } + + _heap[index] = item; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + if (_heap.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_heap, _needsClearing); + } + + _heap = Array.Empty(); + _size = 0; + _disposed = true; + GC.SuppressFinalize(this); + } + + public struct Enumerator : IEnumerator + { + private readonly RecyclablePriorityQueue _queue; + private int _index; + private T? _current; + + internal Enumerator(RecyclablePriorityQueue queue) + { + _queue = queue; + _index = 0; + _current = default; + } + + public T Current => _current!; + object IEnumerator.Current => _current!; + + public bool MoveNext() + { + if (_index >= _queue._size) + { + return false; + } + + _current = _queue._heap[_index++]; + return true; + } + + public void Reset() + { + _index = 0; + _current = default; + } + + public void Dispose() + { + _current = default; + } + } + } +} diff --git a/Recyclable.Collections/RecyclableQueue.AddRange.cs b/Recyclable.Collections/RecyclableQueue.AddRange.cs index de16f1b..7f10293 100644 --- a/Recyclable.Collections/RecyclableQueue.AddRange.cs +++ b/Recyclable.Collections/RecyclableQueue.AddRange.cs @@ -1,928 +1,928 @@ -using System.Collections; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class zRecyclableQueueAddRange - { - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableQueueAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableQueue<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var queueParam = Expression.Parameter(typeof(RecyclableQueue)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableQueueAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableQueue<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var queueParam = Expression.Parameter(typeof(RecyclableQueue)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclableQueue queue, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(queue, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(queue, items); - return true; - } - - return false; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, ReadOnlySpan items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(queue, queue._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, Span items) => AddRange(queue, (ReadOnlySpan)items); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, T[] items) => AddRange(queue, (ReadOnlySpan)items); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, in Array items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(queue, queue._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - int lower = items.GetLowerBound(0); - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(items, lower + copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, List items) => AddRange(queue, CollectionsMarshal.AsSpan(items)); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - EnsureCapacity(queue, queue._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(buffer, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableQueue._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - EnsureCapacity(queue, queue._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(buffer, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableQueue._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableList items) - { - int count = items._count; - if (count == 0) - { - return; - } - - EnsureCapacity(queue, queue._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - T[] source = items._memoryBlock; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(source, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Grow(RecyclableQueue queue) - { - int newSize; - if (queue._capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - long doubled = queue._capacity << 1; - newSize = (int)Math.Min(doubled - queue._capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < newSize) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableQueue._needsClearing); - } - - newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - } - - newChunk.Top = 0; - newChunk.Bottom = 0; - newChunk.Previous = queue._tail; - newChunk.Next = null; - queue._tail.Next = newChunk; - queue._tail = newChunk; - queue._capacity += newSize; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Grow(RecyclableQueue queue, long additionalCapacity) - { - int newSize = additionalCapacity >= RecyclableDefaults.MaxPooledBlockSize - ? RecyclableDefaults.MaxPooledBlockSize - : (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)additionalCapacity), RecyclableDefaults.MaxPooledBlockSize); - - var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < newSize) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableQueue._needsClearing); - } - - newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - } - - newChunk.Top = 0; - newChunk.Bottom = 0; - newChunk.Previous = queue._tail; - newChunk.Next = null; - queue._tail.Next = newChunk; - queue._tail = newChunk; - queue._capacity += newSize; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void EnsureCapacity(RecyclableQueue queue, long requiredCapacity) - { - while (queue._capacity < requiredCapacity) - { - Grow(queue, requiredCapacity - queue._capacity); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableLongList items) - { - long longCount = items._longCount; - if (longCount == 0) - { - return; - } - - int blockSize = items._blockSize; - int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); - int lastBlockLength = (int)(longCount & items._blockSizeMinus1); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - for (int blockIndex = 0; blockIndex < fullBlocks; blockIndex++) - { - T[] block = items._memoryBlocks[blockIndex]; - int sourceIndex = 0; - while (sourceIndex < blockSize) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, blockSize - sourceIndex); - Array.Copy(block, sourceIndex, chunk.Value, index, toCopy); - sourceIndex += toCopy; - index += toCopy; - } - } - - if (lastBlockLength > 0) - { - T[] block = items._memoryBlocks[fullBlocks]; - int sourceIndex = 0; - while (sourceIndex < lastBlockLength) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, lastBlockLength - sourceIndex); - Array.Copy(block, sourceIndex, chunk.Value, index, toCopy); - sourceIndex += toCopy; - index += toCopy; - } - } - - chunk.Top = index; - queue._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableHashSet items) - { - int count = items._count; - if (count == 0) - { - return; - } - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = entries[(copied + i) >> shift][(copied + i) & mask].Value; - } - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableStack items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk destChunk = queue._tail; - int destIndex = destChunk.Top; - int destLength = destChunk.Value.Length; - - RecyclableArrayPoolChunk sourceChunk = items._current; - while (sourceChunk.Previous != null) - { - sourceChunk = sourceChunk.Previous; - } - - while (sourceChunk != null) - { - T[] source = sourceChunk.Value; - int sourceCount = sourceChunk.Index; - int sourceIndex = 0; - - while (sourceIndex < sourceCount) - { - if (destIndex == destLength) - { - destChunk.Top = destIndex; - Grow(queue); - destChunk = queue._tail; - destIndex = destChunk.Top; - destLength = destChunk.Value.Length; - } - - int toCopy = Math.Min(destLength - destIndex, sourceCount - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - } - - sourceChunk = sourceChunk.Next!; - } - - destChunk.Top = destIndex; - queue._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableSortedSet items) - { - int count = items._count; - if (count == 0) - { - return; - } - - T[] source = items._items; - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(source, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableLinkedList items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk destChunk = queue._tail; - int destIndex = destChunk.Top; - int destLength = destChunk.Value.Length; - - var sourceChunk = items._head; - while (sourceChunk != null) - { - int sourceIndex = sourceChunk.Bottom; - int sourceTop = sourceChunk.Top; - T[] source = sourceChunk.Value; - - while (sourceIndex < sourceTop) - { - if (destIndex == destLength) - { - destChunk.Top = destIndex; - Grow(queue); - destChunk = queue._tail; - destIndex = destChunk.Top; - destLength = destChunk.Value.Length; - } - - int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - } - - sourceChunk = sourceChunk.Next; - } - - destChunk.Top = destIndex; - queue._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclablePriorityQueue items) - { - int count = items._size; - if (count == 0) - { - return; - } - - T[] source = items._heap; - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(source, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, RecyclableQueue items) - { - long longCount = items._count; - if (longCount == 0) - { - return; - } - - BiDirectionalRecyclableArrayPoolChunk destChunk = queue._tail; - int destIndex = destChunk.Top; - int destLength = destChunk.Value.Length; - - EnsureCapacity(queue, queue._count + longCount); - - var sourceChunk = items._head; - while (sourceChunk != null) - { - int sourceIndex = sourceChunk.Bottom; - int sourceTop = sourceChunk.Top; - T[] source = sourceChunk.Value; - - while (sourceIndex < sourceTop) - { - if (destIndex == destLength) - { - destChunk.Top = destIndex; - destChunk = destChunk.Next!; - destIndex = destChunk.Top; - destLength = destChunk.Value.Length; - } - - int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - } - - sourceChunk = sourceChunk.Next; - } - - destChunk.Top = destIndex; - queue._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue> queue, RecyclableDictionary items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - EnsureCapacity(queue, queue._count + count); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - BiDirectionalRecyclableArrayPoolChunk> chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - ref var entry = ref entries[(local + i) >> shift][(local + i) & mask]; - destination[index + i] = new KeyValuePair(entry.Key, entry.Value); - } - - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue<(TKey Key, TValue Value)> queue, RecyclableSortedList items) - where TKey : notnull - { - int count = items._count; - if (count == 0) - { - return; - } - - EnsureCapacity(queue, queue._count + count); - - TKey[] keys = items._keys; - TValue[] values = items._values; - - BiDirectionalRecyclableArrayPoolChunk<(TKey Key, TValue Value)> chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = (keys[copied + i], values[copied + i]); - } - - copied += toCopy; - index += toCopy; - } - - chunk.Top = index; - queue._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, IReadOnlyList items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(queue, queue._count + count); - - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - for (int i = 0; i < count; i++) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - chunk.Value[index++] = items[i]; - } - - chunk.Top = index; - queue._count += count; - } - - internal static IEnumerator AddRange(this RecyclableQueue queue, IEnumerable source) - { - IEnumerator enumerator = source.GetEnumerator(); - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - while (enumerator.MoveNext()) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - chunk.Value[index++] = (T)enumerator.Current!; - queue._count++; - } - - chunk.Top = index; - return enumerator; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableQueue queue, IEnumerable items) - { - if (items is RecyclableList recyclableList) - { - AddRange(queue, recyclableList); - } - else if (items is RecyclableLongList recyclableLongList) - { - AddRange(queue, recyclableLongList); - } - else if (items is T[] array) - { - AddRange(queue, array); - } - else if (items is List list) - { - AddRange(queue, list); - } - else if (items is ICollection iCollection) - { - AddRange(queue, iCollection); - } - else if (items is ICollection collection) - { - AddRange(queue, collection); - } - else if (items is RecyclableHashSet hashSet) - { - AddRange(queue, hashSet); - } - else if (items is RecyclableStack stack) - { - AddRange(queue, stack); - } - else if (items is RecyclableSortedSet sortedSet) - { - AddRange(queue, sortedSet); - } - else if (items is RecyclableLinkedList linkedList) - { - AddRange(queue, linkedList); - } - else if (items is RecyclablePriorityQueue priorityQueue) - { - AddRange(queue, priorityQueue); - } - else if (items is RecyclableQueue queueSource) - { - AddRange(queue, queueSource); - } - else if (AddRangeHelper.TryAddRange(queue, items)) - { - } - else if (items is IReadOnlyList readOnlyList) - { - AddRange(queue, readOnlyList); - } - else - { - using IEnumerator enumerator = items.GetEnumerator(); - BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; - int index = chunk.Top; - int chunkLength = chunk.Value.Length; - - while (enumerator.MoveNext()) - { - if (index == chunkLength) - { - chunk.Top = index; - Grow(queue); - chunk = queue._tail; - index = chunk.Top; - chunkLength = chunk.Value.Length; - } - - chunk.Value[index++] = enumerator.Current; - queue._count++; - } - - chunk.Top = index; - } - } - } -} +using System.Collections; +using System.Linq.Expressions; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class zRecyclableQueueAddRange + { + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableQueueAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableQueue<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var queueParam = Expression.Parameter(typeof(RecyclableQueue)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableQueueAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableQueue<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var queueParam = Expression.Parameter(typeof(RecyclableQueue)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, queueParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, queueParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclableQueue queue, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(queue, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(queue, items); + return true; + } + + return false; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, ReadOnlySpan items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(queue, queue._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, Span items) => AddRange(queue, (ReadOnlySpan)items); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, T[] items) => AddRange(queue, (ReadOnlySpan)items); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, in Array items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(queue, queue._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + int lower = items.GetLowerBound(0); + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(items, lower + copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, List items) => AddRange(queue, CollectionsMarshal.AsSpan(items)); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + EnsureCapacity(queue, queue._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(buffer, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableQueue._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + EnsureCapacity(queue, queue._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(buffer, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableQueue._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableList items) + { + int count = items._count; + if (count == 0) + { + return; + } + + EnsureCapacity(queue, queue._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + T[] source = items._memoryBlock; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(source, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Grow(RecyclableQueue queue) + { + int newSize; + if (queue._capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + long doubled = queue._capacity << 1; + newSize = (int)Math.Min(doubled - queue._capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < newSize) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableQueue._needsClearing); + } + + newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + } + + newChunk.Top = 0; + newChunk.Bottom = 0; + newChunk.Previous = queue._tail; + newChunk.Next = null; + queue._tail.Next = newChunk; + queue._tail = newChunk; + queue._capacity += newSize; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Grow(RecyclableQueue queue, long additionalCapacity) + { + int newSize = additionalCapacity >= RecyclableDefaults.MaxPooledBlockSize + ? RecyclableDefaults.MaxPooledBlockSize + : (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)additionalCapacity), RecyclableDefaults.MaxPooledBlockSize); + + var newChunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < newSize) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableQueue._needsClearing); + } + + newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + } + + newChunk.Top = 0; + newChunk.Bottom = 0; + newChunk.Previous = queue._tail; + newChunk.Next = null; + queue._tail.Next = newChunk; + queue._tail = newChunk; + queue._capacity += newSize; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnsureCapacity(RecyclableQueue queue, long requiredCapacity) + { + while (queue._capacity < requiredCapacity) + { + Grow(queue, requiredCapacity - queue._capacity); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableLongList items) + { + long longCount = items._longCount; + if (longCount == 0) + { + return; + } + + int blockSize = items._blockSize; + int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); + int lastBlockLength = (int)(longCount & items._blockSizeMinus1); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + for (int blockIndex = 0; blockIndex < fullBlocks; blockIndex++) + { + T[] block = items._memoryBlocks[blockIndex]; + int sourceIndex = 0; + while (sourceIndex < blockSize) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, blockSize - sourceIndex); + Array.Copy(block, sourceIndex, chunk.Value, index, toCopy); + sourceIndex += toCopy; + index += toCopy; + } + } + + if (lastBlockLength > 0) + { + T[] block = items._memoryBlocks[fullBlocks]; + int sourceIndex = 0; + while (sourceIndex < lastBlockLength) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, lastBlockLength - sourceIndex); + Array.Copy(block, sourceIndex, chunk.Value, index, toCopy); + sourceIndex += toCopy; + index += toCopy; + } + } + + chunk.Top = index; + queue._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableHashSet items) + { + int count = items._count; + if (count == 0) + { + return; + } + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = entries[(copied + i) >> shift][(copied + i) & mask].Value; + } + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableStack items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk destChunk = queue._tail; + int destIndex = destChunk.Top; + int destLength = destChunk.Value.Length; + + RecyclableArrayPoolChunk sourceChunk = items._current; + while (sourceChunk.Previous != null) + { + sourceChunk = sourceChunk.Previous; + } + + while (sourceChunk != null) + { + T[] source = sourceChunk.Value; + int sourceCount = sourceChunk.Index; + int sourceIndex = 0; + + while (sourceIndex < sourceCount) + { + if (destIndex == destLength) + { + destChunk.Top = destIndex; + Grow(queue); + destChunk = queue._tail; + destIndex = destChunk.Top; + destLength = destChunk.Value.Length; + } + + int toCopy = Math.Min(destLength - destIndex, sourceCount - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + } + + sourceChunk = sourceChunk.Next!; + } + + destChunk.Top = destIndex; + queue._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableSortedSet items) + { + int count = items._count; + if (count == 0) + { + return; + } + + T[] source = items._items; + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(source, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableLinkedList items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk destChunk = queue._tail; + int destIndex = destChunk.Top; + int destLength = destChunk.Value.Length; + + var sourceChunk = items._head; + while (sourceChunk != null) + { + int sourceIndex = sourceChunk.Bottom; + int sourceTop = sourceChunk.Top; + T[] source = sourceChunk.Value; + + while (sourceIndex < sourceTop) + { + if (destIndex == destLength) + { + destChunk.Top = destIndex; + Grow(queue); + destChunk = queue._tail; + destIndex = destChunk.Top; + destLength = destChunk.Value.Length; + } + + int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + } + + sourceChunk = sourceChunk.Next; + } + + destChunk.Top = destIndex; + queue._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclablePriorityQueue items) + { + int count = items._size; + if (count == 0) + { + return; + } + + T[] source = items._heap; + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(source, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, RecyclableQueue items) + { + long longCount = items._count; + if (longCount == 0) + { + return; + } + + BiDirectionalRecyclableArrayPoolChunk destChunk = queue._tail; + int destIndex = destChunk.Top; + int destLength = destChunk.Value.Length; + + EnsureCapacity(queue, queue._count + longCount); + + var sourceChunk = items._head; + while (sourceChunk != null) + { + int sourceIndex = sourceChunk.Bottom; + int sourceTop = sourceChunk.Top; + T[] source = sourceChunk.Value; + + while (sourceIndex < sourceTop) + { + if (destIndex == destLength) + { + destChunk.Top = destIndex; + destChunk = destChunk.Next!; + destIndex = destChunk.Top; + destLength = destChunk.Value.Length; + } + + int toCopy = Math.Min(destLength - destIndex, sourceTop - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + } + + sourceChunk = sourceChunk.Next; + } + + destChunk.Top = destIndex; + queue._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue> queue, RecyclableDictionary items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + EnsureCapacity(queue, queue._count + count); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + BiDirectionalRecyclableArrayPoolChunk> chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + ref var entry = ref entries[(local + i) >> shift][(local + i) & mask]; + destination[index + i] = new KeyValuePair(entry.Key, entry.Value); + } + + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue<(TKey Key, TValue Value)> queue, RecyclableSortedList items) + where TKey : notnull + { + int count = items._count; + if (count == 0) + { + return; + } + + EnsureCapacity(queue, queue._count + count); + + TKey[] keys = items._keys; + TValue[] values = items._values; + + BiDirectionalRecyclableArrayPoolChunk<(TKey Key, TValue Value)> chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = (keys[copied + i], values[copied + i]); + } + + copied += toCopy; + index += toCopy; + } + + chunk.Top = index; + queue._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, IReadOnlyList items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(queue, queue._count + count); + + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + for (int i = 0; i < count; i++) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + chunk.Value[index++] = items[i]; + } + + chunk.Top = index; + queue._count += count; + } + + internal static IEnumerator AddRange(this RecyclableQueue queue, IEnumerable source) + { + IEnumerator enumerator = source.GetEnumerator(); + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + while (enumerator.MoveNext()) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + chunk.Value[index++] = (T)enumerator.Current!; + queue._count++; + } + + chunk.Top = index; + return enumerator; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableQueue queue, IEnumerable items) + { + if (items is RecyclableList recyclableList) + { + AddRange(queue, recyclableList); + } + else if (items is RecyclableLongList recyclableLongList) + { + AddRange(queue, recyclableLongList); + } + else if (items is T[] array) + { + AddRange(queue, array); + } + else if (items is List list) + { + AddRange(queue, list); + } + else if (items is ICollection iCollection) + { + AddRange(queue, iCollection); + } + else if (items is ICollection collection) + { + AddRange(queue, collection); + } + else if (items is RecyclableHashSet hashSet) + { + AddRange(queue, hashSet); + } + else if (items is RecyclableStack stack) + { + AddRange(queue, stack); + } + else if (items is RecyclableSortedSet sortedSet) + { + AddRange(queue, sortedSet); + } + else if (items is RecyclableLinkedList linkedList) + { + AddRange(queue, linkedList); + } + else if (items is RecyclablePriorityQueue priorityQueue) + { + AddRange(queue, priorityQueue); + } + else if (items is RecyclableQueue queueSource) + { + AddRange(queue, queueSource); + } + else if (AddRangeHelper.TryAddRange(queue, items)) + { + } + else if (items is IReadOnlyList readOnlyList) + { + AddRange(queue, readOnlyList); + } + else + { + using IEnumerator enumerator = items.GetEnumerator(); + BiDirectionalRecyclableArrayPoolChunk chunk = queue._tail; + int index = chunk.Top; + int chunkLength = chunk.Value.Length; + + while (enumerator.MoveNext()) + { + if (index == chunkLength) + { + chunk.Top = index; + Grow(queue); + chunk = queue._tail; + index = chunk.Top; + chunkLength = chunk.Value.Length; + } + + chunk.Value[index++] = enumerator.Current; + queue._count++; + } + + chunk.Top = index; + } + } + } +} diff --git a/Recyclable.Collections/RecyclableQueue.Helpers.cs b/Recyclable.Collections/RecyclableQueue.Helpers.cs index bce03fc..411273c 100644 --- a/Recyclable.Collections/RecyclableQueue.Helpers.cs +++ b/Recyclable.Collections/RecyclableQueue.Helpers.cs @@ -1,110 +1,110 @@ -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - internal static class RecyclableQueueHelpers - { - [Obsolete("This method MAY be removed in the near future.")] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static bool Contains(RecyclableList arrays, T item) => arrays.Any(x => x.Contains(item)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int ToArrayIndex(long index, int blockSize) => (int)(index / blockSize); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static long ToItemIndex(long index, int blockSize) => index % blockSize; - - [Obsolete("This method MAY be removed in the near future.")] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void CopyTo(RecyclableList arrays, long startingIndex, int blockSize, int lastBlockSize, T[] destinationArray, int destinationArrayIndex) - { - Span arrayMemory = destinationArray; - arrayMemory = arrayMemory[destinationArrayIndex..]; - // TODO: Convert "/" & "%" to bit-shifting - int startingArrayIndex = (int)(startingIndex / blockSize); - startingIndex %= blockSize; - if (arrays._count > 0) - { - ReadOnlySpan sourceMemory = arrays[0]; - var maxToCopy = (int)Math.Min(blockSize - startingIndex, arrayMemory.Length); - if (arrays._count == 1) - { - maxToCopy = Math.Min(maxToCopy, lastBlockSize); - } - - sourceMemory = sourceMemory[checked((int)startingIndex)..maxToCopy]; - sourceMemory.CopyTo(arrayMemory); - arrayMemory = arrayMemory[maxToCopy..]; - } - - for (var arrayIdx = startingArrayIndex + 1; arrayIdx < arrays._count - 1 && arrayMemory.Length > 0; arrayIdx++) - { - ReadOnlySpan sourceMemory = arrays[arrayIdx]; - var maxToCopy = Math.Min(blockSize, arrayMemory.Length); - sourceMemory = sourceMemory[..maxToCopy]; - sourceMemory.CopyTo(arrayMemory); - arrayMemory = arrayMemory[maxToCopy..]; - } - - if (arrays._count > 1 && arrayMemory.Length > 0) - { - ReadOnlySpan sourceMemory = arrays[^1]; - var maxToCopy = Math.Min(lastBlockSize, arrayMemory.Length); - sourceMemory = sourceMemory[..maxToCopy]; - sourceMemory.CopyTo(arrayMemory); - } - } - - [Obsolete("This method WILL be removed in the near future. Please use the existing enumerators instead of it.")] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static IEnumerable Enumerate(RecyclableList arrays, int chunkSize, long totalCount) - { - long currentCount = 0; - for (var arrayIdx = 0; (arrayIdx < arrays._count) && (currentCount < totalCount); arrayIdx++) - { - var array = arrays[arrayIdx]; - currentCount += Math.Min(chunkSize, totalCount); - switch (currentCount < totalCount) - { - case true: - for (var valueIdx = 0; valueIdx < chunkSize; valueIdx++) - { - yield return array[valueIdx]; - } - - break; - - case false: - var partialCount = (int)(totalCount % chunkSize); - int maxCount = partialCount > 0 ? partialCount : chunkSize; - for (var valueIdx = 0; valueIdx < maxCount; valueIdx++) - { - yield return array[valueIdx]; - } - - break; - } - } - } - - [Obsolete] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static long LongIndexOf(RecyclableList arrays, int blockSize, T item, IEqualityComparer comparer) - { - for (var arrayIdx = 0; arrayIdx < arrays._count; arrayIdx++) - { - var array = arrays[arrayIdx]; - ReadOnlySpan arrayMemory = array; - for (int memoryIdx = 0; memoryIdx < arrayMemory.Length; memoryIdx++) - { - if (comparer.Equals(arrayMemory[memoryIdx], item)) - { - return (arrayIdx * (long)blockSize) + memoryIdx; - } - } - } - - return -1; - } - } -} +using System.Runtime.CompilerServices; + +namespace Recyclable.Collections +{ + internal static class RecyclableQueueHelpers + { + [Obsolete("This method MAY be removed in the near future.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool Contains(RecyclableList arrays, T item) => arrays.Any(x => x.Contains(item)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ToArrayIndex(long index, int blockSize) => (int)(index / blockSize); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long ToItemIndex(long index, int blockSize) => index % blockSize; + + [Obsolete("This method MAY be removed in the near future.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void CopyTo(RecyclableList arrays, long startingIndex, int blockSize, int lastBlockSize, T[] destinationArray, int destinationArrayIndex) + { + Span arrayMemory = destinationArray; + arrayMemory = arrayMemory[destinationArrayIndex..]; + // TODO: Convert "/" & "%" to bit-shifting + int startingArrayIndex = (int)(startingIndex / blockSize); + startingIndex %= blockSize; + if (arrays._count > 0) + { + ReadOnlySpan sourceMemory = arrays[0]; + var maxToCopy = (int)Math.Min(blockSize - startingIndex, arrayMemory.Length); + if (arrays._count == 1) + { + maxToCopy = Math.Min(maxToCopy, lastBlockSize); + } + + sourceMemory = sourceMemory[checked((int)startingIndex)..maxToCopy]; + sourceMemory.CopyTo(arrayMemory); + arrayMemory = arrayMemory[maxToCopy..]; + } + + for (var arrayIdx = startingArrayIndex + 1; arrayIdx < arrays._count - 1 && arrayMemory.Length > 0; arrayIdx++) + { + ReadOnlySpan sourceMemory = arrays[arrayIdx]; + var maxToCopy = Math.Min(blockSize, arrayMemory.Length); + sourceMemory = sourceMemory[..maxToCopy]; + sourceMemory.CopyTo(arrayMemory); + arrayMemory = arrayMemory[maxToCopy..]; + } + + if (arrays._count > 1 && arrayMemory.Length > 0) + { + ReadOnlySpan sourceMemory = arrays[^1]; + var maxToCopy = Math.Min(lastBlockSize, arrayMemory.Length); + sourceMemory = sourceMemory[..maxToCopy]; + sourceMemory.CopyTo(arrayMemory); + } + } + + [Obsolete("This method WILL be removed in the near future. Please use the existing enumerators instead of it.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static IEnumerable Enumerate(RecyclableList arrays, int chunkSize, long totalCount) + { + long currentCount = 0; + for (var arrayIdx = 0; (arrayIdx < arrays._count) && (currentCount < totalCount); arrayIdx++) + { + var array = arrays[arrayIdx]; + currentCount += Math.Min(chunkSize, totalCount); + switch (currentCount < totalCount) + { + case true: + for (var valueIdx = 0; valueIdx < chunkSize; valueIdx++) + { + yield return array[valueIdx]; + } + + break; + + case false: + var partialCount = (int)(totalCount % chunkSize); + int maxCount = partialCount > 0 ? partialCount : chunkSize; + for (var valueIdx = 0; valueIdx < maxCount; valueIdx++) + { + yield return array[valueIdx]; + } + + break; + } + } + } + + [Obsolete] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static long LongIndexOf(RecyclableList arrays, int blockSize, T item, IEqualityComparer comparer) + { + for (var arrayIdx = 0; arrayIdx < arrays._count; arrayIdx++) + { + var array = arrays[arrayIdx]; + ReadOnlySpan arrayMemory = array; + for (int memoryIdx = 0; memoryIdx < arrayMemory.Length; memoryIdx++) + { + if (comparer.Equals(arrayMemory[memoryIdx], item)) + { + return (arrayIdx * (long)blockSize) + memoryIdx; + } + } + } + + return -1; + } + } +} diff --git a/Recyclable.Collections/RecyclableQueue.cs b/Recyclable.Collections/RecyclableQueue.cs index 6f4c814..01c0bea 100644 --- a/Recyclable.Collections/RecyclableQueue.cs +++ b/Recyclable.Collections/RecyclableQueue.cs @@ -1,257 +1,257 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableQueue : IEnumerable, IDisposable - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static BiDirectionalRecyclableArrayPoolChunk RentChunk(int size, BiDirectionalRecyclableArrayPoolChunk? previous) - { - var chunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); - if (chunk.Value.Length < size) - { - if (chunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(chunk.Value, _needsClearing); - } - - chunk.Value = size >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(size) - : new T[size]; - } - - chunk.Top = 0; - chunk.Bottom = 0; - chunk.Previous = previous; - chunk.Next = null; - return chunk; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void ReturnChunk(BiDirectionalRecyclableArrayPoolChunk chunk) - { - BiDirectionalRecyclableArrayPoolChunkPool.Return(chunk); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void DisposeChunk(BiDirectionalRecyclableArrayPoolChunk chunk) - { - BiDirectionalRecyclableArrayPoolChunkPool.Dispose(chunk, _needsClearing); - } - - internal BiDirectionalRecyclableArrayPoolChunk _head; - internal BiDirectionalRecyclableArrayPoolChunk _tail; - internal bool _disposed; - internal long _capacity; - internal long _count; - - public RecyclableQueue(int initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _head = RentChunk(initialCapacity, null); - _tail = _head; - _capacity = initialCapacity; - _count = 0; - } - - public RecyclableQueue(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) : this(initialCapacity) - { - foreach (var item in source) - { - Enqueue(item); - } - } - - public int Count => checked((int)_count); - public long LongCount => _count; - - public void Enqueue(T item) - { - if (_tail.Top == _tail.Value.Length) - { - Grow(); - } - - _tail.Value[_tail.Top++] = item; - _count++; - } - - public void Add(T item) => Enqueue(item); - - public T Dequeue() - { - if (_count == 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "Queue is empty"); - } - - _count--; - var value = _head.Value[_head.Bottom]; - if (_needsClearing) - { - _head.Value[_head.Bottom] = default!; - } - - _head.Bottom++; - if (_head.Bottom == _head.Top && _head.Next != null) - { - ReleaseHeadChunk(); - } - else if (_head.Bottom == _head.Top) - { - _head.Bottom = 0; - _head.Top = 0; - } - - return value; - } - - public bool TryDequeue(out T? item) - { - if (_count > 0) - { - item = Dequeue(); - return true; - } - - item = default; - return false; - } - - public void Clear() - { - while (_head.Next != null) - { - ReleaseHeadChunk(); - } - - if (_needsClearing && _head.Top > _head.Bottom) - { - Array.Clear(_head.Value, _head.Bottom, _head.Top - _head.Bottom); - } - - _capacity = _head.Value.Length; - _head.Top = 0; - _head.Bottom = 0; - _tail = _head; - _count = 0; - } - - public Enumerator GetEnumerator() => new(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - private void Grow() - { - int newSize; - if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - var doubled = _capacity << 1; - newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = RentChunk(newSize, _tail); - _tail.Next = newChunk; - _tail = newChunk; - _capacity += newSize; - } - - private void ReleaseHeadChunk() - { - var toReturn = _head; - _head = toReturn.Next!; - _head.Previous = null; - _capacity -= toReturn.Value.Length; - ReturnChunk(toReturn); - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - var chunk = _head; - while (chunk != null) - { - var next = chunk.Next; - DisposeChunk(chunk); - chunk = next; - } - - _disposed = true; - GC.SuppressFinalize(this); - } - - public struct Enumerator : IEnumerator - { - private readonly BiDirectionalRecyclableArrayPoolChunk? _start; - private BiDirectionalRecyclableArrayPoolChunk? _chunk; - private int _index; - private T? _current; - - internal Enumerator(RecyclableQueue queue) - { - _start = queue._head; - _chunk = queue._head; - _index = _chunk != null ? _chunk.Bottom : 0; - _current = default; - } - - public T Current => _current!; - object IEnumerator.Current => _current!; - - public bool MoveNext() - { - if (_chunk == null) - { - return false; - } - - if (_index >= _chunk.Top) - { - _chunk = _chunk.Next; - if (_chunk == null) - { - return false; - } - _index = _chunk.Bottom; - } - - _current = _chunk.Value[_index++]; - return true; - } - - public void Reset() - { - _chunk = _start; - _index = _chunk != null ? _chunk.Bottom : 0; - } - - public void Dispose() - { - _chunk = null; - _current = default; - } - } - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableQueue : IEnumerable, IDisposable + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static BiDirectionalRecyclableArrayPoolChunk RentChunk(int size, BiDirectionalRecyclableArrayPoolChunk? previous) + { + var chunk = BiDirectionalRecyclableArrayPoolChunkPool.Rent(); + if (chunk.Value.Length < size) + { + if (chunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(chunk.Value, _needsClearing); + } + + chunk.Value = size >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(size) + : new T[size]; + } + + chunk.Top = 0; + chunk.Bottom = 0; + chunk.Previous = previous; + chunk.Next = null; + return chunk; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void ReturnChunk(BiDirectionalRecyclableArrayPoolChunk chunk) + { + BiDirectionalRecyclableArrayPoolChunkPool.Return(chunk); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void DisposeChunk(BiDirectionalRecyclableArrayPoolChunk chunk) + { + BiDirectionalRecyclableArrayPoolChunkPool.Dispose(chunk, _needsClearing); + } + + internal BiDirectionalRecyclableArrayPoolChunk _head; + internal BiDirectionalRecyclableArrayPoolChunk _tail; + internal bool _disposed; + internal long _capacity; + internal long _count; + + public RecyclableQueue(int initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _head = RentChunk(initialCapacity, null); + _tail = _head; + _capacity = initialCapacity; + _count = 0; + } + + public RecyclableQueue(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) : this(initialCapacity) + { + foreach (var item in source) + { + Enqueue(item); + } + } + + public int Count => checked((int)_count); + public long LongCount => _count; + + public void Enqueue(T item) + { + if (_tail.Top == _tail.Value.Length) + { + Grow(); + } + + _tail.Value[_tail.Top++] = item; + _count++; + } + + public void Add(T item) => Enqueue(item); + + public T Dequeue() + { + if (_count == 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "Queue is empty"); + } + + _count--; + var value = _head.Value[_head.Bottom]; + if (_needsClearing) + { + _head.Value[_head.Bottom] = default!; + } + + _head.Bottom++; + if (_head.Bottom == _head.Top && _head.Next != null) + { + ReleaseHeadChunk(); + } + else if (_head.Bottom == _head.Top) + { + _head.Bottom = 0; + _head.Top = 0; + } + + return value; + } + + public bool TryDequeue(out T? item) + { + if (_count > 0) + { + item = Dequeue(); + return true; + } + + item = default; + return false; + } + + public void Clear() + { + while (_head.Next != null) + { + ReleaseHeadChunk(); + } + + if (_needsClearing && _head.Top > _head.Bottom) + { + Array.Clear(_head.Value, _head.Bottom, _head.Top - _head.Bottom); + } + + _capacity = _head.Value.Length; + _head.Top = 0; + _head.Bottom = 0; + _tail = _head; + _count = 0; + } + + public Enumerator GetEnumerator() => new(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + private void Grow() + { + int newSize; + if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + var doubled = _capacity << 1; + newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = RentChunk(newSize, _tail); + _tail.Next = newChunk; + _tail = newChunk; + _capacity += newSize; + } + + private void ReleaseHeadChunk() + { + var toReturn = _head; + _head = toReturn.Next!; + _head.Previous = null; + _capacity -= toReturn.Value.Length; + ReturnChunk(toReturn); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + var chunk = _head; + while (chunk != null) + { + var next = chunk.Next; + DisposeChunk(chunk); + chunk = next; + } + + _disposed = true; + GC.SuppressFinalize(this); + } + + public struct Enumerator : IEnumerator + { + private readonly BiDirectionalRecyclableArrayPoolChunk? _start; + private BiDirectionalRecyclableArrayPoolChunk? _chunk; + private int _index; + private T? _current; + + internal Enumerator(RecyclableQueue queue) + { + _start = queue._head; + _chunk = queue._head; + _index = _chunk != null ? _chunk.Bottom : 0; + _current = default; + } + + public T Current => _current!; + object IEnumerator.Current => _current!; + + public bool MoveNext() + { + if (_chunk == null) + { + return false; + } + + if (_index >= _chunk.Top) + { + _chunk = _chunk.Next; + if (_chunk == null) + { + return false; + } + _index = _chunk.Bottom; + } + + _current = _chunk.Value[_index++]; + return true; + } + + public void Reset() + { + _chunk = _start; + _index = _chunk != null ? _chunk.Bottom : 0; + } + + public void Dispose() + { + _chunk = null; + _current = default; + } + } + } +} diff --git a/Recyclable.Collections/RecyclableSortedDictionary.cs b/Recyclable.Collections/RecyclableSortedDictionary.cs index 5b40d5d..983a725 100644 --- a/Recyclable.Collections/RecyclableSortedDictionary.cs +++ b/Recyclable.Collections/RecyclableSortedDictionary.cs @@ -1,287 +1,287 @@ -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableSortedDictionary : IEnumerable>, IDisposable - where TKey : notnull - { - private static readonly bool _needsClearing = !typeof(TKey).IsValueType || !typeof(TValue).IsValueType; - - private readonly IComparer _comparer; - private TKey[] _keys; - private TValue[] _values; - private int _count; - private bool _disposed; - - public RecyclableSortedDictionary(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _keys = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(initialCapacity) - : new TKey[initialCapacity]; - _values = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(initialCapacity) - : new TValue[initialCapacity]; - _count = 0; - _comparer = comparer ?? Comparer.Default; - } - - public int Count => _count; - - public TValue this[TKey key] - { - get - { - int index = BinarySearch(key); - if (index < _count && _comparer.Compare(_keys[index], key) == 0) - { - return _values[index]; - } - - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "Key not found"); - return default!; - } - set - { - int index = BinarySearch(key); - if (index < _count && _comparer.Compare(_keys[index], key) == 0) - { - _values[index] = value; - return; - } - - InsertAt(index, key, value); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(TKey key, TValue value) - { - int index = BinarySearch(key); - if (index < _count && _comparer.Compare(_keys[index], key) == 0) - { - throw new ArgumentException("An element with the same key already exists.", nameof(key)); - } - - InsertAt(index, key, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool ContainsKey(TKey key) - { - int index = BinarySearch(key); - return index < _count && _comparer.Compare(_keys[index], key) == 0; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Remove(TKey key) - { - int index = BinarySearch(key); - if (index >= _count || _comparer.Compare(_keys[index], key) != 0) - { - return false; - } - - if (index < _count - 1) - { - Array.Copy(_keys, index + 1, _keys, index, _count - index - 1); - Array.Copy(_values, index + 1, _values, index, _count - index - 1); - } - - _count--; - if (_needsClearing) - { - _keys[_count] = default!; - _values[_count] = default!; - } - - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryGetValue(TKey key, out TValue value) - { - int index = BinarySearch(key); - if (index < _count && _comparer.Compare(_keys[index], key) == 0) - { - value = _values[index]; - return true; - } - - value = default!; - return false; - } - - public void Clear() - { - if (_needsClearing) - { - Array.Clear(_keys, 0, _count); - Array.Clear(_values, 0, _count); - } - - _count = 0; - } - - public TKey GetKey(int index) => _keys[index]; - public TValue GetValue(int index) => _values[index]; - - public Enumerator GetEnumerator() => new(this); - IEnumerator> IEnumerable>.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - private void InsertAt(int index, TKey key, TValue value) - { - if (_count == _keys.Length) - { - Grow(); - } - - if (index < _count) - { - Array.Copy(_keys, index, _keys, index + 1, _count - index); - Array.Copy(_values, index, _values, index + 1, _count - index); - } - - _keys[index] = key; - _values[index] = value; - _count++; - } - - private void Grow() - { - int newSize; - if (_keys.Length >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - int doubled = _keys.Length << 1; - newSize = (int)Math.Min(doubled, RecyclableDefaults.MaxPooledBlockSize); - } - - var newKeys = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new TKey[newSize]; - var newValues = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new TValue[newSize]; - Array.Copy(_keys, newKeys, _count); - Array.Copy(_values, newValues, _count); - - if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_keys, _needsClearing); - } - if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_values, _needsClearing); - } - - _keys = newKeys; - _values = newValues; - } - - private int BinarySearch(TKey key) - { - int low = 0; - int high = _count - 1; - while (low <= high) - { - int mid = (low + high) >> 1; - int cmp = _comparer.Compare(_keys[mid], key); - if (cmp == 0) - { - return mid; - } - - if (cmp < 0) - { - low = mid + 1; - } - else - { - high = mid - 1; - } - } - - return low; - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - Clear(); - if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_keys, _needsClearing); - } - if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_values, _needsClearing); - } - - _keys = Array.Empty(); - _values = Array.Empty(); - _disposed = true; - GC.SuppressFinalize(this); - } - - public struct Enumerator : IEnumerator> - { - private readonly RecyclableSortedDictionary _dictionary; - private int _index; - private KeyValuePair _current; - - internal Enumerator(RecyclableSortedDictionary dictionary) - { - _dictionary = dictionary; - _index = 0; - _current = default; - } - - public KeyValuePair Current => _current; - object IEnumerator.Current => _current; - - public bool MoveNext() - { - if (_index >= _dictionary._count) - { - return false; - } - - _current = new KeyValuePair(_dictionary._keys[_index], _dictionary._values[_index]); - _index++; - return true; - } - - public void Reset() - { - _index = 0; - _current = default; - } - - public void Dispose() - { - } - } - } -} +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableSortedDictionary : IEnumerable>, IDisposable + where TKey : notnull + { + private static readonly bool _needsClearing = !typeof(TKey).IsValueType || !typeof(TValue).IsValueType; + + private readonly IComparer _comparer; + private TKey[] _keys; + private TValue[] _values; + private int _count; + private bool _disposed; + + public RecyclableSortedDictionary(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _keys = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(initialCapacity) + : new TKey[initialCapacity]; + _values = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(initialCapacity) + : new TValue[initialCapacity]; + _count = 0; + _comparer = comparer ?? Comparer.Default; + } + + public int Count => _count; + + public TValue this[TKey key] + { + get + { + int index = BinarySearch(key); + if (index < _count && _comparer.Compare(_keys[index], key) == 0) + { + return _values[index]; + } + + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "Key not found"); + return default!; + } + set + { + int index = BinarySearch(key); + if (index < _count && _comparer.Compare(_keys[index], key) == 0) + { + _values[index] = value; + return; + } + + InsertAt(index, key, value); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(TKey key, TValue value) + { + int index = BinarySearch(key); + if (index < _count && _comparer.Compare(_keys[index], key) == 0) + { + throw new ArgumentException("An element with the same key already exists.", nameof(key)); + } + + InsertAt(index, key, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool ContainsKey(TKey key) + { + int index = BinarySearch(key); + return index < _count && _comparer.Compare(_keys[index], key) == 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Remove(TKey key) + { + int index = BinarySearch(key); + if (index >= _count || _comparer.Compare(_keys[index], key) != 0) + { + return false; + } + + if (index < _count - 1) + { + Array.Copy(_keys, index + 1, _keys, index, _count - index - 1); + Array.Copy(_values, index + 1, _values, index, _count - index - 1); + } + + _count--; + if (_needsClearing) + { + _keys[_count] = default!; + _values[_count] = default!; + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool TryGetValue(TKey key, out TValue value) + { + int index = BinarySearch(key); + if (index < _count && _comparer.Compare(_keys[index], key) == 0) + { + value = _values[index]; + return true; + } + + value = default!; + return false; + } + + public void Clear() + { + if (_needsClearing) + { + Array.Clear(_keys, 0, _count); + Array.Clear(_values, 0, _count); + } + + _count = 0; + } + + public TKey GetKey(int index) => _keys[index]; + public TValue GetValue(int index) => _values[index]; + + public Enumerator GetEnumerator() => new(this); + IEnumerator> IEnumerable>.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + private void InsertAt(int index, TKey key, TValue value) + { + if (_count == _keys.Length) + { + Grow(); + } + + if (index < _count) + { + Array.Copy(_keys, index, _keys, index + 1, _count - index); + Array.Copy(_values, index, _values, index + 1, _count - index); + } + + _keys[index] = key; + _values[index] = value; + _count++; + } + + private void Grow() + { + int newSize; + if (_keys.Length >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + int doubled = _keys.Length << 1; + newSize = (int)Math.Min(doubled, RecyclableDefaults.MaxPooledBlockSize); + } + + var newKeys = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new TKey[newSize]; + var newValues = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new TValue[newSize]; + Array.Copy(_keys, newKeys, _count); + Array.Copy(_values, newValues, _count); + + if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_keys, _needsClearing); + } + if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_values, _needsClearing); + } + + _keys = newKeys; + _values = newValues; + } + + private int BinarySearch(TKey key) + { + int low = 0; + int high = _count - 1; + while (low <= high) + { + int mid = (low + high) >> 1; + int cmp = _comparer.Compare(_keys[mid], key); + if (cmp == 0) + { + return mid; + } + + if (cmp < 0) + { + low = mid + 1; + } + else + { + high = mid - 1; + } + } + + return low; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + Clear(); + if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_keys, _needsClearing); + } + if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_values, _needsClearing); + } + + _keys = Array.Empty(); + _values = Array.Empty(); + _disposed = true; + GC.SuppressFinalize(this); + } + + public struct Enumerator : IEnumerator> + { + private readonly RecyclableSortedDictionary _dictionary; + private int _index; + private KeyValuePair _current; + + internal Enumerator(RecyclableSortedDictionary dictionary) + { + _dictionary = dictionary; + _index = 0; + _current = default; + } + + public KeyValuePair Current => _current; + object IEnumerator.Current => _current; + + public bool MoveNext() + { + if (_index >= _dictionary._count) + { + return false; + } + + _current = new KeyValuePair(_dictionary._keys[_index], _dictionary._values[_index]); + _index++; + return true; + } + + public void Reset() + { + _index = 0; + _current = default; + } + + public void Dispose() + { + } + } + } +} diff --git a/Recyclable.Collections/RecyclableSortedList.cs b/Recyclable.Collections/RecyclableSortedList.cs index 283b643..3905c37 100644 --- a/Recyclable.Collections/RecyclableSortedList.cs +++ b/Recyclable.Collections/RecyclableSortedList.cs @@ -1,281 +1,281 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableSortedList : IEnumerable<(TKey Key, TValue Value)>, IDisposable - where TKey : notnull - { - internal static readonly bool _needsClearing = !typeof(TKey).IsValueType || !typeof(TValue).IsValueType; - - internal TKey[] _keys; - internal TValue[] _values; - internal int _count; - internal readonly IComparer _comparer; - internal bool _disposed; - - public RecyclableSortedList(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _keys = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(initialCapacity) - : new TKey[initialCapacity]; - _values = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(initialCapacity) - : new TValue[initialCapacity]; - _count = 0; - _comparer = comparer ?? Comparer.Default; - } - - public int Count => _count; - - public TValue this[TKey key] - { - get - { - int index = BinarySearch(key); - if (index >= 0) - { - return _values[index]; - } - - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "Key not found"); - return default!; - } - set - { - int index = BinarySearch(key); - if (index >= 0) - { - _values[index] = value; - return; - } - - Insert(~index, key, value); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(TKey key, TValue value) - { - int index = BinarySearch(key); - if (index >= 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "An element with the same key already exists."); - } - - Insert(~index, key, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool ContainsKey(TKey key) => BinarySearch(key) >= 0; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryGetValue(TKey key, out TValue value) - { - int index = BinarySearch(key); - if (index >= 0) - { - value = _values[index]; - return true; - } - - value = default!; - return false; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Remove(TKey key) - { - int index = BinarySearch(key); - if (index < 0) - { - return false; - } - - if (index < _count - 1) - { - Array.Copy(_keys, index + 1, _keys, index, _count - index - 1); - Array.Copy(_values, index + 1, _values, index, _count - index - 1); - } - - _count--; - if (_needsClearing) - { - _keys[_count] = default!; - _values[_count] = default!; - } - - return true; - } - - public void Clear() - { - if (_needsClearing && _count > 0) - { - Array.Clear(_keys, 0, _count); - Array.Clear(_values, 0, _count); - } - - _count = 0; - } - - public TKey GetKey(int index) => _keys[index]; - public TValue GetValue(int index) => _values[index]; - - public Enumerator GetEnumerator() => new(this); - IEnumerator<(TKey Key, TValue Value)> IEnumerable<(TKey Key, TValue Value)>.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - public void Dispose() - { - if (_disposed) - { - return; - } - - if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_keys, _needsClearing); - } - - if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_values, _needsClearing); - } - - _keys = Array.Empty(); - _values = Array.Empty(); - _count = 0; - _disposed = true; - GC.SuppressFinalize(this); - } - - private void Insert(int index, TKey key, TValue value) - { - if (_count == _keys.Length) - { - Grow(_count + 1); - } - - if (index < _count) - { - Array.Copy(_keys, index, _keys, index + 1, _count - index); - Array.Copy(_values, index, _values, index + 1, _count - index); - } - - _keys[index] = key; - _values[index] = value; - _count++; - } - - private void Grow(int min) - { - int newSize = _keys.Length << 1; - if (newSize < min) - { - newSize = min; - } - - var newKeys = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new TKey[newSize]; - var newValues = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new TValue[newSize]; - - Array.Copy(_keys, newKeys, _count); - Array.Copy(_values, newValues, _count); - - if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_keys, _needsClearing); - } - - if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_values, _needsClearing); - } - - _keys = newKeys; - _values = newValues; - } - - private int BinarySearch(TKey key) - { - int low = 0; - int high = _count - 1; - while (low <= high) - { - int mid = (low + high) >> 1; - int cmp = _comparer.Compare(_keys[mid], key); - if (cmp == 0) - { - return mid; - } - - if (cmp < 0) - { - low = mid + 1; - } - else - { - high = mid - 1; - } - } - - return ~low; - } - - public struct Enumerator : IEnumerator<(TKey Key, TValue Value)> - { - private readonly RecyclableSortedList _list; - private int _index; - private (TKey, TValue) _current; - - internal Enumerator(RecyclableSortedList list) - { - _list = list; - _index = 0; - _current = default!; - } - - public (TKey Key, TValue Value) Current => _current; - object IEnumerator.Current => _current; - - public bool MoveNext() - { - if (_index >= _list._count) - { - return false; - } - - _current = (_list._keys[_index], _list._values[_index]); - _index++; - return true; - } - - public void Reset() - { - _index = 0; - _current = default!; - } - - public void Dispose() - { - } - } - - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableSortedList : IEnumerable<(TKey Key, TValue Value)>, IDisposable + where TKey : notnull + { + internal static readonly bool _needsClearing = !typeof(TKey).IsValueType || !typeof(TValue).IsValueType; + + internal TKey[] _keys; + internal TValue[] _values; + internal int _count; + internal readonly IComparer _comparer; + internal bool _disposed; + + public RecyclableSortedList(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _keys = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(initialCapacity) + : new TKey[initialCapacity]; + _values = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(initialCapacity) + : new TValue[initialCapacity]; + _count = 0; + _comparer = comparer ?? Comparer.Default; + } + + public int Count => _count; + + public TValue this[TKey key] + { + get + { + int index = BinarySearch(key); + if (index >= 0) + { + return _values[index]; + } + + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "Key not found"); + return default!; + } + set + { + int index = BinarySearch(key); + if (index >= 0) + { + _values[index] = value; + return; + } + + Insert(~index, key, value); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(TKey key, TValue value) + { + int index = BinarySearch(key); + if (index >= 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(key), "An element with the same key already exists."); + } + + Insert(~index, key, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool ContainsKey(TKey key) => BinarySearch(key) >= 0; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool TryGetValue(TKey key, out TValue value) + { + int index = BinarySearch(key); + if (index >= 0) + { + value = _values[index]; + return true; + } + + value = default!; + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Remove(TKey key) + { + int index = BinarySearch(key); + if (index < 0) + { + return false; + } + + if (index < _count - 1) + { + Array.Copy(_keys, index + 1, _keys, index, _count - index - 1); + Array.Copy(_values, index + 1, _values, index, _count - index - 1); + } + + _count--; + if (_needsClearing) + { + _keys[_count] = default!; + _values[_count] = default!; + } + + return true; + } + + public void Clear() + { + if (_needsClearing && _count > 0) + { + Array.Clear(_keys, 0, _count); + Array.Clear(_values, 0, _count); + } + + _count = 0; + } + + public TKey GetKey(int index) => _keys[index]; + public TValue GetValue(int index) => _values[index]; + + public Enumerator GetEnumerator() => new(this); + IEnumerator<(TKey Key, TValue Value)> IEnumerable<(TKey Key, TValue Value)>.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + public void Dispose() + { + if (_disposed) + { + return; + } + + if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_keys, _needsClearing); + } + + if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_values, _needsClearing); + } + + _keys = Array.Empty(); + _values = Array.Empty(); + _count = 0; + _disposed = true; + GC.SuppressFinalize(this); + } + + private void Insert(int index, TKey key, TValue value) + { + if (_count == _keys.Length) + { + Grow(_count + 1); + } + + if (index < _count) + { + Array.Copy(_keys, index, _keys, index + 1, _count - index); + Array.Copy(_values, index, _values, index + 1, _count - index); + } + + _keys[index] = key; + _values[index] = value; + _count++; + } + + private void Grow(int min) + { + int newSize = _keys.Length << 1; + if (newSize < min) + { + newSize = min; + } + + var newKeys = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new TKey[newSize]; + var newValues = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new TValue[newSize]; + + Array.Copy(_keys, newKeys, _count); + Array.Copy(_values, newValues, _count); + + if (_keys.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_keys, _needsClearing); + } + + if (_values.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_values, _needsClearing); + } + + _keys = newKeys; + _values = newValues; + } + + private int BinarySearch(TKey key) + { + int low = 0; + int high = _count - 1; + while (low <= high) + { + int mid = (low + high) >> 1; + int cmp = _comparer.Compare(_keys[mid], key); + if (cmp == 0) + { + return mid; + } + + if (cmp < 0) + { + low = mid + 1; + } + else + { + high = mid - 1; + } + } + + return ~low; + } + + public struct Enumerator : IEnumerator<(TKey Key, TValue Value)> + { + private readonly RecyclableSortedList _list; + private int _index; + private (TKey, TValue) _current; + + internal Enumerator(RecyclableSortedList list) + { + _list = list; + _index = 0; + _current = default!; + } + + public (TKey Key, TValue Value) Current => _current; + object IEnumerator.Current => _current; + + public bool MoveNext() + { + if (_index >= _list._count) + { + return false; + } + + _current = (_list._keys[_index], _list._values[_index]); + _index++; + return true; + } + + public void Reset() + { + _index = 0; + _current = default!; + } + + public void Dispose() + { + } + } + + } +} diff --git a/Recyclable.Collections/RecyclableSortedSet.cs b/Recyclable.Collections/RecyclableSortedSet.cs index 6c7db74..8bc3928 100644 --- a/Recyclable.Collections/RecyclableSortedSet.cs +++ b/Recyclable.Collections/RecyclableSortedSet.cs @@ -1,215 +1,215 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableSortedSet : IEnumerable, IDisposable where T : notnull - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - internal readonly IComparer _comparer; - - internal T[] _items; - internal int _count; - internal bool _disposed; - - public RecyclableSortedSet(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _items = initialCapacity >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(initialCapacity) - : new T[initialCapacity]; - _count = 0; - _comparer = comparer ?? Comparer.Default; - } - - public int Count => _count; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Add(T item) - { - int index = BinarySearch(item); - if (index < _count && _comparer.Compare(_items[index], item) == 0) - { - return false; - } - - if (_count == _items.Length) - { - Grow(); - } - - if (index < _count) - { - Array.Copy(_items, index, _items, index + 1, _count - index); - } - - _items[index] = item; - _count++; - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Contains(T item) - { - int index = BinarySearch(item); - return index < _count && _comparer.Compare(_items[index], item) == 0; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Remove(T item) - { - int index = BinarySearch(item); - if (index >= _count || _comparer.Compare(_items[index], item) != 0) - { - return false; - } - - if (index < _count - 1) - { - Array.Copy(_items, index + 1, _items, index, _count - index - 1); - } - - _count--; - if (_needsClearing) - { - _items[_count] = default!; - } - - return true; - } - - public void Clear() - { - if (_needsClearing) - { - Array.Clear(_items, 0, _count); - } - - _count = 0; - } - - public Enumerator GetEnumerator() => new(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - private void Grow() - { - int newSize; - if (_items.Length >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - var doubled = _items.Length << 1; - newSize = (int)Math.Min(doubled, RecyclableDefaults.MaxPooledBlockSize); - } - - var newItems = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - Array.Copy(_items, newItems, _count); - - if (_items.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_items, _needsClearing); - } - - _items = newItems; - } - - private int BinarySearch(T item) - { - int low = 0; - int high = _count - 1; - while (low <= high) - { - int mid = (low + high) >> 1; - int cmp = _comparer.Compare(_items[mid], item); - if (cmp == 0) - { - return mid; - } - - if (cmp < 0) - { - low = mid + 1; - } - else - { - high = mid - 1; - } - } - - return low; - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - Clear(); - if (_items.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_items, _needsClearing); - } - - _items = Array.Empty(); - _disposed = true; - GC.SuppressFinalize(this); - } - - public struct Enumerator : IEnumerator - { - private readonly RecyclableSortedSet _set; - private int _index; - private T? _current; - - internal Enumerator(RecyclableSortedSet set) - { - _set = set; - _index = 0; - _current = default; - } - - public T Current => _current!; - object IEnumerator.Current => _current!; - - public bool MoveNext() - { - if (_index >= _set._count) - { - return false; - } - - _current = _set._items[_index++]; - return true; - } - - public void Reset() - { - _index = 0; - _current = default; - } - - public void Dispose() - { - } - } - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableSortedSet : IEnumerable, IDisposable where T : notnull + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + internal readonly IComparer _comparer; + + internal T[] _items; + internal int _count; + internal bool _disposed; + + public RecyclableSortedSet(int initialCapacity = RecyclableDefaults.InitialCapacity, IComparer? comparer = null) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _items = initialCapacity >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(initialCapacity) + : new T[initialCapacity]; + _count = 0; + _comparer = comparer ?? Comparer.Default; + } + + public int Count => _count; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Add(T item) + { + int index = BinarySearch(item); + if (index < _count && _comparer.Compare(_items[index], item) == 0) + { + return false; + } + + if (_count == _items.Length) + { + Grow(); + } + + if (index < _count) + { + Array.Copy(_items, index, _items, index + 1, _count - index); + } + + _items[index] = item; + _count++; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(T item) + { + int index = BinarySearch(item); + return index < _count && _comparer.Compare(_items[index], item) == 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Remove(T item) + { + int index = BinarySearch(item); + if (index >= _count || _comparer.Compare(_items[index], item) != 0) + { + return false; + } + + if (index < _count - 1) + { + Array.Copy(_items, index + 1, _items, index, _count - index - 1); + } + + _count--; + if (_needsClearing) + { + _items[_count] = default!; + } + + return true; + } + + public void Clear() + { + if (_needsClearing) + { + Array.Clear(_items, 0, _count); + } + + _count = 0; + } + + public Enumerator GetEnumerator() => new(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + private void Grow() + { + int newSize; + if (_items.Length >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + var doubled = _items.Length << 1; + newSize = (int)Math.Min(doubled, RecyclableDefaults.MaxPooledBlockSize); + } + + var newItems = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + Array.Copy(_items, newItems, _count); + + if (_items.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_items, _needsClearing); + } + + _items = newItems; + } + + private int BinarySearch(T item) + { + int low = 0; + int high = _count - 1; + while (low <= high) + { + int mid = (low + high) >> 1; + int cmp = _comparer.Compare(_items[mid], item); + if (cmp == 0) + { + return mid; + } + + if (cmp < 0) + { + low = mid + 1; + } + else + { + high = mid - 1; + } + } + + return low; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + Clear(); + if (_items.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_items, _needsClearing); + } + + _items = Array.Empty(); + _disposed = true; + GC.SuppressFinalize(this); + } + + public struct Enumerator : IEnumerator + { + private readonly RecyclableSortedSet _set; + private int _index; + private T? _current; + + internal Enumerator(RecyclableSortedSet set) + { + _set = set; + _index = 0; + _current = default; + } + + public T Current => _current!; + object IEnumerator.Current => _current!; + + public bool MoveNext() + { + if (_index >= _set._count) + { + return false; + } + + _current = _set._items[_index++]; + return true; + } + + public void Reset() + { + _index = 0; + _current = default; + } + + public void Dispose() + { + } + } + } +} diff --git a/Recyclable.Collections/RecyclableStack.AddRange.cs b/Recyclable.Collections/RecyclableStack.AddRange.cs index 88ae72f..63c4653 100644 --- a/Recyclable.Collections/RecyclableStack.AddRange.cs +++ b/Recyclable.Collections/RecyclableStack.AddRange.cs @@ -1,1046 +1,1046 @@ -using System.Collections; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Numerics; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal static class zRecyclableStackAddRange - { - private static class AddRangeHelper - { - private static readonly Action, object>? _dictionaryAdder; - private static readonly Action, object>? _sortedListAdder; - private static readonly Action, object>? _sortedDictionaryAdder; - private static readonly Type? _dictionaryType; - private static readonly Type? _sortedListType; - private static readonly Type? _sortedDictionaryType; - - static AddRangeHelper() - { - Type elementType = typeof(T); - if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); - _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableStackAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableStack<>).MakeGenericType(elementType), _dictionaryType }, - modifiers: null); - if (method != null) - { - var stackParam = Expression.Parameter(typeof(RecyclableStack)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, stackParam, Expression.Convert(objParam, _dictionaryType)); - _dictionaryAdder = Expression.Lambda, object>>(call, stackParam, objParam).Compile(); - } - - method = typeof(zRecyclableStackAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableStack<>).MakeGenericType(elementType), _sortedDictionaryType }, - modifiers: null); - if (method != null) - { - var stackParam = Expression.Parameter(typeof(RecyclableStack)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, stackParam, Expression.Convert(objParam, _sortedDictionaryType)); - _sortedDictionaryAdder = Expression.Lambda, object>>(call, stackParam, objParam).Compile(); - } - } - else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) - { - Type[] args = elementType.GetGenericArguments(); - _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); - MethodInfo? method = typeof(zRecyclableStackAddRange).GetMethod( - nameof(AddRange), - BindingFlags.NonPublic | BindingFlags.Static, - binder: null, - types: new[] { typeof(RecyclableStack<>).MakeGenericType(elementType), _sortedListType }, - modifiers: null); - if (method != null) - { - var stackParam = Expression.Parameter(typeof(RecyclableStack)); - var objParam = Expression.Parameter(typeof(object)); - var call = Expression.Call(method, stackParam, Expression.Convert(objParam, _sortedListType)); - _sortedListAdder = Expression.Lambda, object>>(call, stackParam, objParam).Compile(); - } - } - } - - internal static bool TryAddRange(RecyclableStack stack, IEnumerable items) - { - if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) - { - _dictionaryAdder(stack, items); - return true; - } - - if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) - { - _sortedDictionaryAdder(stack, items); - return true; - } - - if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) - { - _sortedListAdder(stack, items); - return true; - } - - return false; - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, ReadOnlySpan items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, Span items) => AddRange(stack, (ReadOnlySpan)items); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, T[] items) => AddRange(stack, (ReadOnlySpan)items); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, in Array items) - { - int count = items.Length; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - int lower = items.GetLowerBound(0); - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(items, lower + copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, List items) => AddRange(stack, CollectionsMarshal.AsSpan(items)); - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(buffer, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableStack._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, ICollection items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) - : new T[count]; - - items.CopyTo(buffer, 0); - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(buffer, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - - if (count >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(buffer, RecyclableStack._needsClearing); - } - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableList items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(items._memoryBlock, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Grow(RecyclableStack stack) - { - int newSize; - if (stack._capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - long doubled = stack._capacity << 1; - newSize = (int)Math.Min(doubled - stack._capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = RecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < newSize) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableStack._needsClearing); - } - - newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - } - - newChunk.Index = 0; - newChunk.Previous = stack._current; - newChunk.Next = null; - stack._current.Next = newChunk; - stack._current = newChunk; - stack._capacity += newSize; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Grow(RecyclableStack stack, long additionalCapacity) - { - int newSize = additionalCapacity >= RecyclableDefaults.MaxPooledBlockSize - ? RecyclableDefaults.MaxPooledBlockSize - : (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)additionalCapacity), RecyclableDefaults.MaxPooledBlockSize); - - var newChunk = RecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < newSize) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableStack._needsClearing); - } - - newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(newSize) - : new T[newSize]; - } - - newChunk.Index = 0; - newChunk.Previous = stack._current; - newChunk.Next = null; - stack._current.Next = newChunk; - stack._current = newChunk; - stack._capacity += newSize; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void EnsureCapacity(RecyclableStack stack, long requiredCapacity) - { - if (requiredCapacity <= stack._capacity) - { - return; - } - - long needed = requiredCapacity - stack._capacity; - - do - { - int size = needed >= RecyclableDefaults.MaxPooledBlockSize - ? RecyclableDefaults.MaxPooledBlockSize - : (int)BitOperations.RoundUpToPowerOf2((uint)needed); - - var newChunk = RecyclableArrayPoolChunkPool.Rent(); - if (newChunk.Value.Length < size) - { - if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableStack._needsClearing); - } - - newChunk.Value = size >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(size) - : new T[size]; - } - - newChunk.Index = 0; - newChunk.Previous = stack._current; - newChunk.Next = null; - stack._current.Next = newChunk; - stack._current = newChunk; - stack._capacity += size; - - needed -= size; - } - while (needed > 0); - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableLongList items) - { - long longCount = items._longCount; - if (longCount == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + longCount); - - int blockSize = items._blockSize; - int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); - int lastBlockLength = (int)(longCount & items._blockSizeMinus1); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - - for (int blockIndex = 0; blockIndex < fullBlocks; blockIndex++) - { - T[] block = items._memoryBlocks[blockIndex]; - int srcIndex = 0; - - while (srcIndex < blockSize) - { - int toCopy = Math.Min(chunkLength - index, blockSize - srcIndex); - Array.Copy(block, srcIndex, chunk.Value, index, toCopy); - srcIndex += toCopy; - index += toCopy; - - if (index == chunkLength && (srcIndex < blockSize || blockIndex < fullBlocks - 1 || lastBlockLength > 0)) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - } - - if (lastBlockLength > 0) - { - T[] block = items._memoryBlocks[fullBlocks]; - int srcIndex = 0; - - while (srcIndex < lastBlockLength) - { - int toCopy = Math.Min(chunkLength - index, lastBlockLength - srcIndex); - Array.Copy(block, srcIndex, chunk.Value, index, toCopy); - srcIndex += toCopy; - index += toCopy; - - if (index == chunkLength && srcIndex < lastBlockLength) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - } - - chunk.Index = index; - stack._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableHashSet items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = entries[(copied + i) >> shift][(copied + i) & mask].Value; - } - - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableStack items) - { - long longCount = items.Count; - if (longCount == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + longCount); - - RecyclableArrayPoolChunk destChunk = stack._current; - while (destChunk.Previous != null && destChunk.Previous.Index < destChunk.Previous.Value.Length) - { - destChunk = destChunk.Previous; - } - - int destIndex = destChunk.Index; - int destLength = destChunk.Value.Length; - - RecyclableArrayPoolChunk sourceChunk = items._current; - while (sourceChunk.Previous != null) - { - sourceChunk = sourceChunk.Previous; - } - - while (sourceChunk != null) - { - T[] source = sourceChunk.Value; - int sourceCount = sourceChunk.Index; - int sourceIndex = 0; - - while (sourceIndex < sourceCount) - { - int toCopy = Math.Min(destLength - destIndex, sourceCount - sourceIndex); - Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); - sourceIndex += toCopy; - destIndex += toCopy; - - if (destIndex == destLength && (sourceIndex < sourceCount || sourceChunk.Next != null)) - { - destChunk.Index = destIndex; - destChunk = destChunk.Next!; - destIndex = 0; - destLength = destChunk.Value.Length; - } - } - - sourceChunk = sourceChunk.Next!; - } - - destChunk.Index = destIndex; - stack._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableSortedSet items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - Array.Copy(items._items, copied, chunk.Value, index, toCopy); - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableLinkedList items) - { - long longCount = items.Count; - if (longCount == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + longCount); - - RecyclableArrayPoolChunk destChunk = stack._current; - while (destChunk.Previous != null && destChunk.Previous.Index < destChunk.Previous.Value.Length) - { - destChunk = destChunk.Previous; - } - - int destIndex = destChunk.Index; - int destLength = destChunk.Value.Length; - - var sourceChunk = items._head; - while (sourceChunk != null) - { - int sourceCount = sourceChunk.Top - sourceChunk.Bottom; - int sourceIndex = sourceChunk.Bottom; - - while (sourceCount > 0) - { - int toCopy = Math.Min(destLength - destIndex, sourceCount); - Array.Copy(sourceChunk.Value, sourceIndex, destChunk.Value, destIndex, toCopy); - destIndex += toCopy; - sourceIndex += toCopy; - sourceCount -= toCopy; - - if (destIndex == destLength && (sourceCount > 0 || sourceChunk.Next != null)) - { - destChunk.Index = destIndex; - destChunk = destChunk.Next!; - destIndex = 0; - destLength = destChunk.Value.Length; - } - } - - sourceChunk = sourceChunk.Next; - } - - destChunk.Index = destIndex; - stack._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclablePriorityQueue items) - { - AddRange(stack, new ReadOnlySpan(items._heap, 0, items._size)); - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, RecyclableQueue items) - { - long longCount = items.Count; - if (longCount == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + longCount); - - RecyclableArrayPoolChunk destChunk = stack._current; - while (destChunk.Previous != null && destChunk.Previous.Index < destChunk.Previous.Value.Length) - { - destChunk = destChunk.Previous; - } - - int destIndex = destChunk.Index; - int destLength = destChunk.Value.Length; - - var sourceChunk = items._head; - while (sourceChunk != null) - { - int sourceCount = sourceChunk.Top - sourceChunk.Bottom; - int sourceIndex = sourceChunk.Bottom; - - while (sourceCount > 0) - { - int toCopy = Math.Min(destLength - destIndex, sourceCount); - Array.Copy(sourceChunk.Value, sourceIndex, destChunk.Value, destIndex, toCopy); - destIndex += toCopy; - sourceIndex += toCopy; - sourceCount -= toCopy; - - if (destIndex == destLength && (sourceCount > 0 || sourceChunk.Next != null)) - { - destChunk.Index = destIndex; - destChunk = destChunk.Next!; - destIndex = 0; - destLength = destChunk.Value.Length; - } - } - - sourceChunk = sourceChunk.Next; - } - - destChunk.Index = destIndex; - stack._count += longCount; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack> stack, RecyclableDictionary items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - var entries = items._entries; - int shift = items._blockShift, - mask = items._blockSizeMinus1; - - RecyclableArrayPoolChunk> chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - ref var entry = ref entries[(local + i) >> shift][(local + i) & mask]; - destination[index + i] = new KeyValuePair(entry.Key, entry.Value); - } - - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack> stack, RecyclableSortedDictionary items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - - RecyclableArrayPoolChunk> chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = new KeyValuePair(items.GetKey(local + i), items.GetValue(local + i)); - } - - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack<(TKey Key, TValue Value)> stack, RecyclableSortedList items) - where TKey : notnull - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - TKey[] keys = items._keys; - TValue[] values = items._values; - - RecyclableArrayPoolChunk<(TKey Key, TValue Value)> chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = (keys[local + i], values[local + i]); - } - - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, IReadOnlyList items) - { - int count = items.Count; - if (count == 0) - { - return; - } - - EnsureCapacity(stack, stack._count + count); - - RecyclableArrayPoolChunk chunk = stack._current; - while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) - { - chunk = chunk.Previous; - } - - int index = chunk.Index; - int chunkLength = chunk.Value.Length; - int copied = 0; - - while (copied < count) - { - int toCopy = Math.Min(chunkLength - index, count - copied); - var destination = chunk.Value; - int local = copied; - for (int i = 0; i < toCopy; i++) - { - destination[index + i] = items[local + i]; - } - - copied += toCopy; - index += toCopy; - - if (index == chunkLength && copied < count) - { - chunk.Index = index; - chunk = chunk.Next!; - index = 0; - chunkLength = chunk.Value.Length; - } - } - - chunk.Index = index; - stack._count += count; - } - - internal static IEnumerator AddRange(this RecyclableStack stack, IEnumerable source) - { - var enumerator = source.GetEnumerator(); - while (enumerator.MoveNext()) - { - stack.Push((T)enumerator.Current!); - } - return enumerator; - } - - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] - internal static void AddRange(this RecyclableStack stack, IEnumerable items) - { - if (items is RecyclableList recyclableList) - { - AddRange(stack, recyclableList); - } - else if (items is RecyclableLongList recyclableLongList) - { - AddRange(stack, recyclableLongList); - } - else if (items is T[] array) - { - AddRange(stack, array); - } - else if (items is List list) - { - AddRange(stack, list); - } - else if (items is ICollection iCollection) - { - AddRange(stack, iCollection); - } - else if (items is ICollection collection) - { - AddRange(stack, collection); - } - else if (items is RecyclableHashSet hashSet) - { - AddRange(stack, hashSet); - } - else if (items is RecyclableStack stackSource) - { - AddRange(stack, stackSource); - } - else if (items is RecyclableSortedSet sortedSet) - { - AddRange(stack, sortedSet); - } - else if (items is RecyclableLinkedList linkedList) - { - AddRange(stack, linkedList); - } - else if (items is RecyclablePriorityQueue priorityQueue) - { - AddRange(stack, priorityQueue); - } - else if (items is RecyclableQueue queue) - { - AddRange(stack, queue); - } - else if (AddRangeHelper.TryAddRange(stack, items)) - { - } - else if (items is IReadOnlyList readOnlyList) - { - AddRange(stack, readOnlyList); - } - else - { - using IEnumerator enumerator = items.GetEnumerator(); - while (enumerator.MoveNext()) - { - stack.Push(enumerator.Current); - } - } - } - } -} - +using System.Collections; +using System.Linq.Expressions; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Numerics; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal static class zRecyclableStackAddRange + { + private static class AddRangeHelper + { + private static readonly Action, object>? _dictionaryAdder; + private static readonly Action, object>? _sortedListAdder; + private static readonly Action, object>? _sortedDictionaryAdder; + private static readonly Type? _dictionaryType; + private static readonly Type? _sortedListType; + private static readonly Type? _sortedDictionaryType; + + static AddRangeHelper() + { + Type elementType = typeof(T); + if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _dictionaryType = typeof(RecyclableDictionary<,>).MakeGenericType(args); + _sortedDictionaryType = typeof(RecyclableSortedDictionary<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableStackAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableStack<>).MakeGenericType(elementType), _dictionaryType }, + modifiers: null); + if (method != null) + { + var stackParam = Expression.Parameter(typeof(RecyclableStack)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, stackParam, Expression.Convert(objParam, _dictionaryType)); + _dictionaryAdder = Expression.Lambda, object>>(call, stackParam, objParam).Compile(); + } + + method = typeof(zRecyclableStackAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableStack<>).MakeGenericType(elementType), _sortedDictionaryType }, + modifiers: null); + if (method != null) + { + var stackParam = Expression.Parameter(typeof(RecyclableStack)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, stackParam, Expression.Convert(objParam, _sortedDictionaryType)); + _sortedDictionaryAdder = Expression.Lambda, object>>(call, stackParam, objParam).Compile(); + } + } + else if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(ValueTuple<,>)) + { + Type[] args = elementType.GetGenericArguments(); + _sortedListType = typeof(RecyclableSortedList<,>).MakeGenericType(args); + MethodInfo? method = typeof(zRecyclableStackAddRange).GetMethod( + nameof(AddRange), + BindingFlags.NonPublic | BindingFlags.Static, + binder: null, + types: new[] { typeof(RecyclableStack<>).MakeGenericType(elementType), _sortedListType }, + modifiers: null); + if (method != null) + { + var stackParam = Expression.Parameter(typeof(RecyclableStack)); + var objParam = Expression.Parameter(typeof(object)); + var call = Expression.Call(method, stackParam, Expression.Convert(objParam, _sortedListType)); + _sortedListAdder = Expression.Lambda, object>>(call, stackParam, objParam).Compile(); + } + } + } + + internal static bool TryAddRange(RecyclableStack stack, IEnumerable items) + { + if (_dictionaryAdder != null && _dictionaryType!.IsInstanceOfType(items)) + { + _dictionaryAdder(stack, items); + return true; + } + + if (_sortedDictionaryAdder != null && _sortedDictionaryType!.IsInstanceOfType(items)) + { + _sortedDictionaryAdder(stack, items); + return true; + } + + if (_sortedListAdder != null && _sortedListType!.IsInstanceOfType(items)) + { + _sortedListAdder(stack, items); + return true; + } + + return false; + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, ReadOnlySpan items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + items.Slice(copied, toCopy).CopyTo(new Span(chunk.Value, index, toCopy)); + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, Span items) => AddRange(stack, (ReadOnlySpan)items); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, T[] items) => AddRange(stack, (ReadOnlySpan)items); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, in Array items) + { + int count = items.Length; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + int lower = items.GetLowerBound(0); + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(items, lower + copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, List items) => AddRange(stack, CollectionsMarshal.AsSpan(items)); + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(buffer, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableStack._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, ICollection items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + T[] buffer = count >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(checked((int)BitOperations.RoundUpToPowerOf2((uint)count))) + : new T[count]; + + items.CopyTo(buffer, 0); + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(buffer, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + + if (count >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(buffer, RecyclableStack._needsClearing); + } + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableList items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(items._memoryBlock, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Grow(RecyclableStack stack) + { + int newSize; + if (stack._capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + long doubled = stack._capacity << 1; + newSize = (int)Math.Min(doubled - stack._capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = RecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < newSize) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableStack._needsClearing); + } + + newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + } + + newChunk.Index = 0; + newChunk.Previous = stack._current; + newChunk.Next = null; + stack._current.Next = newChunk; + stack._current = newChunk; + stack._capacity += newSize; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Grow(RecyclableStack stack, long additionalCapacity) + { + int newSize = additionalCapacity >= RecyclableDefaults.MaxPooledBlockSize + ? RecyclableDefaults.MaxPooledBlockSize + : (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)additionalCapacity), RecyclableDefaults.MaxPooledBlockSize); + + var newChunk = RecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < newSize) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableStack._needsClearing); + } + + newChunk.Value = newSize >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(newSize) + : new T[newSize]; + } + + newChunk.Index = 0; + newChunk.Previous = stack._current; + newChunk.Next = null; + stack._current.Next = newChunk; + stack._current = newChunk; + stack._capacity += newSize; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void EnsureCapacity(RecyclableStack stack, long requiredCapacity) + { + if (requiredCapacity <= stack._capacity) + { + return; + } + + long needed = requiredCapacity - stack._capacity; + + do + { + int size = needed >= RecyclableDefaults.MaxPooledBlockSize + ? RecyclableDefaults.MaxPooledBlockSize + : (int)BitOperations.RoundUpToPowerOf2((uint)needed); + + var newChunk = RecyclableArrayPoolChunkPool.Rent(); + if (newChunk.Value.Length < size) + { + if (newChunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(newChunk.Value, RecyclableStack._needsClearing); + } + + newChunk.Value = size >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(size) + : new T[size]; + } + + newChunk.Index = 0; + newChunk.Previous = stack._current; + newChunk.Next = null; + stack._current.Next = newChunk; + stack._current = newChunk; + stack._capacity += size; + + needed -= size; + } + while (needed > 0); + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableLongList items) + { + long longCount = items._longCount; + if (longCount == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + longCount); + + int blockSize = items._blockSize; + int fullBlocks = (int)(longCount >> items._blockSizePow2BitShift); + int lastBlockLength = (int)(longCount & items._blockSizeMinus1); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + + for (int blockIndex = 0; blockIndex < fullBlocks; blockIndex++) + { + T[] block = items._memoryBlocks[blockIndex]; + int srcIndex = 0; + + while (srcIndex < blockSize) + { + int toCopy = Math.Min(chunkLength - index, blockSize - srcIndex); + Array.Copy(block, srcIndex, chunk.Value, index, toCopy); + srcIndex += toCopy; + index += toCopy; + + if (index == chunkLength && (srcIndex < blockSize || blockIndex < fullBlocks - 1 || lastBlockLength > 0)) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + } + + if (lastBlockLength > 0) + { + T[] block = items._memoryBlocks[fullBlocks]; + int srcIndex = 0; + + while (srcIndex < lastBlockLength) + { + int toCopy = Math.Min(chunkLength - index, lastBlockLength - srcIndex); + Array.Copy(block, srcIndex, chunk.Value, index, toCopy); + srcIndex += toCopy; + index += toCopy; + + if (index == chunkLength && srcIndex < lastBlockLength) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + } + + chunk.Index = index; + stack._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableHashSet items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = entries[(copied + i) >> shift][(copied + i) & mask].Value; + } + + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableStack items) + { + long longCount = items.Count; + if (longCount == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + longCount); + + RecyclableArrayPoolChunk destChunk = stack._current; + while (destChunk.Previous != null && destChunk.Previous.Index < destChunk.Previous.Value.Length) + { + destChunk = destChunk.Previous; + } + + int destIndex = destChunk.Index; + int destLength = destChunk.Value.Length; + + RecyclableArrayPoolChunk sourceChunk = items._current; + while (sourceChunk.Previous != null) + { + sourceChunk = sourceChunk.Previous; + } + + while (sourceChunk != null) + { + T[] source = sourceChunk.Value; + int sourceCount = sourceChunk.Index; + int sourceIndex = 0; + + while (sourceIndex < sourceCount) + { + int toCopy = Math.Min(destLength - destIndex, sourceCount - sourceIndex); + Array.Copy(source, sourceIndex, destChunk.Value, destIndex, toCopy); + sourceIndex += toCopy; + destIndex += toCopy; + + if (destIndex == destLength && (sourceIndex < sourceCount || sourceChunk.Next != null)) + { + destChunk.Index = destIndex; + destChunk = destChunk.Next!; + destIndex = 0; + destLength = destChunk.Value.Length; + } + } + + sourceChunk = sourceChunk.Next!; + } + + destChunk.Index = destIndex; + stack._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableSortedSet items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + Array.Copy(items._items, copied, chunk.Value, index, toCopy); + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableLinkedList items) + { + long longCount = items.Count; + if (longCount == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + longCount); + + RecyclableArrayPoolChunk destChunk = stack._current; + while (destChunk.Previous != null && destChunk.Previous.Index < destChunk.Previous.Value.Length) + { + destChunk = destChunk.Previous; + } + + int destIndex = destChunk.Index; + int destLength = destChunk.Value.Length; + + var sourceChunk = items._head; + while (sourceChunk != null) + { + int sourceCount = sourceChunk.Top - sourceChunk.Bottom; + int sourceIndex = sourceChunk.Bottom; + + while (sourceCount > 0) + { + int toCopy = Math.Min(destLength - destIndex, sourceCount); + Array.Copy(sourceChunk.Value, sourceIndex, destChunk.Value, destIndex, toCopy); + destIndex += toCopy; + sourceIndex += toCopy; + sourceCount -= toCopy; + + if (destIndex == destLength && (sourceCount > 0 || sourceChunk.Next != null)) + { + destChunk.Index = destIndex; + destChunk = destChunk.Next!; + destIndex = 0; + destLength = destChunk.Value.Length; + } + } + + sourceChunk = sourceChunk.Next; + } + + destChunk.Index = destIndex; + stack._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclablePriorityQueue items) + { + AddRange(stack, new ReadOnlySpan(items._heap, 0, items._size)); + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, RecyclableQueue items) + { + long longCount = items.Count; + if (longCount == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + longCount); + + RecyclableArrayPoolChunk destChunk = stack._current; + while (destChunk.Previous != null && destChunk.Previous.Index < destChunk.Previous.Value.Length) + { + destChunk = destChunk.Previous; + } + + int destIndex = destChunk.Index; + int destLength = destChunk.Value.Length; + + var sourceChunk = items._head; + while (sourceChunk != null) + { + int sourceCount = sourceChunk.Top - sourceChunk.Bottom; + int sourceIndex = sourceChunk.Bottom; + + while (sourceCount > 0) + { + int toCopy = Math.Min(destLength - destIndex, sourceCount); + Array.Copy(sourceChunk.Value, sourceIndex, destChunk.Value, destIndex, toCopy); + destIndex += toCopy; + sourceIndex += toCopy; + sourceCount -= toCopy; + + if (destIndex == destLength && (sourceCount > 0 || sourceChunk.Next != null)) + { + destChunk.Index = destIndex; + destChunk = destChunk.Next!; + destIndex = 0; + destLength = destChunk.Value.Length; + } + } + + sourceChunk = sourceChunk.Next; + } + + destChunk.Index = destIndex; + stack._count += longCount; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack> stack, RecyclableDictionary items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + var entries = items._entries; + int shift = items._blockShift, + mask = items._blockSizeMinus1; + + RecyclableArrayPoolChunk> chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + ref var entry = ref entries[(local + i) >> shift][(local + i) & mask]; + destination[index + i] = new KeyValuePair(entry.Key, entry.Value); + } + + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack> stack, RecyclableSortedDictionary items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + + RecyclableArrayPoolChunk> chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = new KeyValuePair(items.GetKey(local + i), items.GetValue(local + i)); + } + + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack<(TKey Key, TValue Value)> stack, RecyclableSortedList items) + where TKey : notnull + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + TKey[] keys = items._keys; + TValue[] values = items._values; + + RecyclableArrayPoolChunk<(TKey Key, TValue Value)> chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = (keys[local + i], values[local + i]); + } + + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, IReadOnlyList items) + { + int count = items.Count; + if (count == 0) + { + return; + } + + EnsureCapacity(stack, stack._count + count); + + RecyclableArrayPoolChunk chunk = stack._current; + while (chunk.Previous != null && chunk.Previous.Index < chunk.Previous.Value.Length) + { + chunk = chunk.Previous; + } + + int index = chunk.Index; + int chunkLength = chunk.Value.Length; + int copied = 0; + + while (copied < count) + { + int toCopy = Math.Min(chunkLength - index, count - copied); + var destination = chunk.Value; + int local = copied; + for (int i = 0; i < toCopy; i++) + { + destination[index + i] = items[local + i]; + } + + copied += toCopy; + index += toCopy; + + if (index == chunkLength && copied < count) + { + chunk.Index = index; + chunk = chunk.Next!; + index = 0; + chunkLength = chunk.Value.Length; + } + } + + chunk.Index = index; + stack._count += count; + } + + internal static IEnumerator AddRange(this RecyclableStack stack, IEnumerable source) + { + var enumerator = source.GetEnumerator(); + while (enumerator.MoveNext()) + { + stack.Push((T)enumerator.Current!); + } + return enumerator; + } + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] + internal static void AddRange(this RecyclableStack stack, IEnumerable items) + { + if (items is RecyclableList recyclableList) + { + AddRange(stack, recyclableList); + } + else if (items is RecyclableLongList recyclableLongList) + { + AddRange(stack, recyclableLongList); + } + else if (items is T[] array) + { + AddRange(stack, array); + } + else if (items is List list) + { + AddRange(stack, list); + } + else if (items is ICollection iCollection) + { + AddRange(stack, iCollection); + } + else if (items is ICollection collection) + { + AddRange(stack, collection); + } + else if (items is RecyclableHashSet hashSet) + { + AddRange(stack, hashSet); + } + else if (items is RecyclableStack stackSource) + { + AddRange(stack, stackSource); + } + else if (items is RecyclableSortedSet sortedSet) + { + AddRange(stack, sortedSet); + } + else if (items is RecyclableLinkedList linkedList) + { + AddRange(stack, linkedList); + } + else if (items is RecyclablePriorityQueue priorityQueue) + { + AddRange(stack, priorityQueue); + } + else if (items is RecyclableQueue queue) + { + AddRange(stack, queue); + } + else if (AddRangeHelper.TryAddRange(stack, items)) + { + } + else if (items is IReadOnlyList readOnlyList) + { + AddRange(stack, readOnlyList); + } + else + { + using IEnumerator enumerator = items.GetEnumerator(); + while (enumerator.MoveNext()) + { + stack.Push(enumerator.Current); + } + } + } + } +} + diff --git a/Recyclable.Collections/RecyclableStack.cs b/Recyclable.Collections/RecyclableStack.cs index f05f57f..a7ae7d8 100644 --- a/Recyclable.Collections/RecyclableStack.cs +++ b/Recyclable.Collections/RecyclableStack.cs @@ -1,238 +1,238 @@ -using System.Collections; -using System.Numerics; -using System.Runtime.CompilerServices; -using Recyclable.Collections.Pools; - -namespace Recyclable.Collections -{ - internal sealed class RecyclableStack : IEnumerable, IDisposable - { - internal static readonly bool _needsClearing = !typeof(T).IsValueType; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static RecyclableArrayPoolChunk RentChunk(int size, RecyclableArrayPoolChunk? previous) - { - var chunk = RecyclableArrayPoolChunkPool.Rent(); - if (chunk.Value.Length < size) - { - if (chunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(chunk.Value, _needsClearing); - } - - chunk.Value = size >= RecyclableDefaults.MinPooledArrayLength - ? RecyclableArrayPool.RentShared(size) - : new T[size]; - } - chunk.Index = 0; - chunk.Previous = previous; - chunk.Next = null; - return chunk; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void ReturnChunk(RecyclableArrayPoolChunk chunk) - { - RecyclableArrayPoolChunkPool.Return(chunk); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void DisposeChunk(RecyclableArrayPoolChunk chunk) - { - RecyclableArrayPoolChunkPool.Dispose(chunk, _needsClearing); - } - - internal RecyclableArrayPoolChunk _current; - internal bool _disposed; - internal long _capacity; - internal long _count; - - public RecyclableStack(int initialCapacity = RecyclableDefaults.InitialCapacity) - { - if (initialCapacity < 1) - { - initialCapacity = 1; - } - - if (!BitOperations.IsPow2((uint)initialCapacity)) - { - initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); - } - - _current = RentChunk(initialCapacity, null); - _capacity = initialCapacity; - _count = 0; - } - - public RecyclableStack(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) : this(initialCapacity) - { - foreach (var item in source) - { - Push(item); - } - } - - public int Count => checked((int)_count); - public long LongCount => _count; - - public void Push(T item) - { - if (_current.Index == _current.Value.Length) - { - Grow(); - } - - _current.Value[_current.Index++] = item; - _count++; - } - - public void Add(T item) => Push(item); - - public T Pop() - { - if (_count == 0) - { - ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "Stack is empty"); - } - - _count--; - _current.Index--; - var value = _current.Value[_current.Index]; - if (_needsClearing) - { - _current.Value[_current.Index] = default!; - } - - if (_current.Index == 0 && _current.Previous != null) - { - ReleaseCurrentChunk(); - } - - return value; - } - - public void Clear() - { - while (_current.Previous != null) - { - ReleaseCurrentChunk(); - } - - if (_needsClearing && _current.Index > 0) - { - Array.Clear(_current.Value, 0, _current.Index); - } - - _capacity = _current.Value.Length; - _current.Index = 0; - _count = 0; - } - - public Enumerator GetEnumerator() => new(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); - - private void Grow() - { - int newSize; - if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) - { - newSize = RecyclableDefaults.MaxPooledBlockSize; - } - else - { - var doubled = _capacity << 1; - newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); - } - - var newChunk = RentChunk(newSize, _current); - _current.Next = newChunk; - _current = newChunk; - _capacity += newSize; - } - - private void ReleaseCurrentChunk() - { - var toReturn = _current; - _current = toReturn.Previous!; - _current.Next = null; - _capacity -= toReturn.Value.Length; - ReturnChunk(toReturn); - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - var chunk = _current; - while (chunk != null) - { - var previous = chunk.Previous; - DisposeChunk(chunk); - chunk = previous; - } - - _disposed = true; - GC.SuppressFinalize(this); - } - - public struct Enumerator : IEnumerator - { - private readonly RecyclableArrayPoolChunk? _start; - private RecyclableArrayPoolChunk? _chunk; - private int _index; - private T? _current; - - internal Enumerator(RecyclableStack stack) - { - _start = stack._current; - _chunk = stack._current; - _index = _chunk != null ? _chunk.Index - 1 : -1; - _current = default; - } - - public T Current => _current!; - object IEnumerator.Current => _current!; - - public bool MoveNext() - { - while (true) - { - if (_chunk == null) - { - return false; - } - - if (_index < 0) - { - _chunk = _chunk.Previous; - if (_chunk == null) - { - return false; - } - _index = _chunk.Index - 1; - continue; - } - - _current = _chunk.Value[_index--]; - return true; - } - } - - public void Reset() - { - _chunk = _start; - _index = _chunk != null ? _chunk.Index - 1 : -1; - } - - public void Dispose() - { - _chunk = null; - _current = default; - } - } - } -} +using System.Collections; +using System.Numerics; +using System.Runtime.CompilerServices; +using Recyclable.Collections.Pools; + +namespace Recyclable.Collections +{ + internal sealed class RecyclableStack : IEnumerable, IDisposable + { + internal static readonly bool _needsClearing = !typeof(T).IsValueType; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static RecyclableArrayPoolChunk RentChunk(int size, RecyclableArrayPoolChunk? previous) + { + var chunk = RecyclableArrayPoolChunkPool.Rent(); + if (chunk.Value.Length < size) + { + if (chunk.Value.Length >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(chunk.Value, _needsClearing); + } + + chunk.Value = size >= RecyclableDefaults.MinPooledArrayLength + ? RecyclableArrayPool.RentShared(size) + : new T[size]; + } + chunk.Index = 0; + chunk.Previous = previous; + chunk.Next = null; + return chunk; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void ReturnChunk(RecyclableArrayPoolChunk chunk) + { + RecyclableArrayPoolChunkPool.Return(chunk); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void DisposeChunk(RecyclableArrayPoolChunk chunk) + { + RecyclableArrayPoolChunkPool.Dispose(chunk, _needsClearing); + } + + internal RecyclableArrayPoolChunk _current; + internal bool _disposed; + internal long _capacity; + internal long _count; + + public RecyclableStack(int initialCapacity = RecyclableDefaults.InitialCapacity) + { + if (initialCapacity < 1) + { + initialCapacity = 1; + } + + if (!BitOperations.IsPow2((uint)initialCapacity)) + { + initialCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)initialCapacity); + } + + _current = RentChunk(initialCapacity, null); + _capacity = initialCapacity; + _count = 0; + } + + public RecyclableStack(IEnumerable source, int initialCapacity = RecyclableDefaults.InitialCapacity) : this(initialCapacity) + { + foreach (var item in source) + { + Push(item); + } + } + + public int Count => checked((int)_count); + public long LongCount => _count; + + public void Push(T item) + { + if (_current.Index == _current.Value.Length) + { + Grow(); + } + + _current.Value[_current.Index++] = item; + _count++; + } + + public void Add(T item) => Push(item); + + public T Pop() + { + if (_count == 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(_count), "Stack is empty"); + } + + _count--; + _current.Index--; + var value = _current.Value[_current.Index]; + if (_needsClearing) + { + _current.Value[_current.Index] = default!; + } + + if (_current.Index == 0 && _current.Previous != null) + { + ReleaseCurrentChunk(); + } + + return value; + } + + public void Clear() + { + while (_current.Previous != null) + { + ReleaseCurrentChunk(); + } + + if (_needsClearing && _current.Index > 0) + { + Array.Clear(_current.Value, 0, _current.Index); + } + + _capacity = _current.Value.Length; + _current.Index = 0; + _count = 0; + } + + public Enumerator GetEnumerator() => new(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this); + + private void Grow() + { + int newSize; + if (_capacity >= RecyclableDefaults.MaxPooledBlockSize) + { + newSize = RecyclableDefaults.MaxPooledBlockSize; + } + else + { + var doubled = _capacity << 1; + newSize = (int)Math.Min(doubled - _capacity, RecyclableDefaults.MaxPooledBlockSize); + } + + var newChunk = RentChunk(newSize, _current); + _current.Next = newChunk; + _current = newChunk; + _capacity += newSize; + } + + private void ReleaseCurrentChunk() + { + var toReturn = _current; + _current = toReturn.Previous!; + _current.Next = null; + _capacity -= toReturn.Value.Length; + ReturnChunk(toReturn); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + var chunk = _current; + while (chunk != null) + { + var previous = chunk.Previous; + DisposeChunk(chunk); + chunk = previous; + } + + _disposed = true; + GC.SuppressFinalize(this); + } + + public struct Enumerator : IEnumerator + { + private readonly RecyclableArrayPoolChunk? _start; + private RecyclableArrayPoolChunk? _chunk; + private int _index; + private T? _current; + + internal Enumerator(RecyclableStack stack) + { + _start = stack._current; + _chunk = stack._current; + _index = _chunk != null ? _chunk.Index - 1 : -1; + _current = default; + } + + public T Current => _current!; + object IEnumerator.Current => _current!; + + public bool MoveNext() + { + while (true) + { + if (_chunk == null) + { + return false; + } + + if (_index < 0) + { + _chunk = _chunk.Previous; + if (_chunk == null) + { + return false; + } + _index = _chunk.Index - 1; + continue; + } + + _current = _chunk.Value[_index--]; + return true; + } + } + + public void Reset() + { + _chunk = _start; + _index = _chunk != null ? _chunk.Index - 1 : -1; + } + + public void Dispose() + { + _chunk = null; + _current = default; + } + } + } +} diff --git a/Recyclable.Collections/SearchConfiguration.cs b/Recyclable.Collections/SearchConfiguration.cs index 40cb7ca..526da25 100644 --- a/Recyclable.Collections/SearchConfiguration.cs +++ b/Recyclable.Collections/SearchConfiguration.cs @@ -1,29 +1,29 @@ -namespace Recyclable.Collections -{ - internal readonly struct SearchConfiguration - { - public TItem ItemToFind { get; init; } - public TList List { get; init; } - public int BlockSizeMinus1 { get; init; } - public byte BlockSizePow2BitShift { get; init; } - public long ItemsCount { get; init; } - public int StartingBlockIndex { get; init; } - public long BlockSize { get; init; } - - // public SearchConfiguration(TList list, in TItem itemToFind) - // { - // ItemToFind = itemToFind; - // List = list; - // } - - public static SearchConfiguration, TItem> CreateFrom(RecyclableLongList list, in TItem itemToFind) => new() - { - List = list, - ItemToFind = itemToFind, - BlockSizeMinus1 = list._blockSizeMinus1, - BlockSizePow2BitShift = list._blockSizePow2BitShift, - ItemsCount = list._longCount, - BlockSize = list._blockSize - }; - } +namespace Recyclable.Collections +{ + internal readonly struct SearchConfiguration + { + public TItem ItemToFind { get; init; } + public TList List { get; init; } + public int BlockSizeMinus1 { get; init; } + public byte BlockSizePow2BitShift { get; init; } + public long ItemsCount { get; init; } + public int StartingBlockIndex { get; init; } + public long BlockSize { get; init; } + + // public SearchConfiguration(TList list, in TItem itemToFind) + // { + // ItemToFind = itemToFind; + // List = list; + // } + + public static SearchConfiguration, TItem> CreateFrom(RecyclableLongList list, in TItem itemToFind) => new() + { + List = list, + ItemToFind = itemToFind, + BlockSizeMinus1 = list._blockSizeMinus1, + BlockSizePow2BitShift = list._blockSizePow2BitShift, + ItemsCount = list._longCount, + BlockSize = list._blockSize + }; + } } \ No newline at end of file diff --git a/Recyclable.Collections/SystemRandomNumberGenerator.cs b/Recyclable.Collections/SystemRandomNumberGenerator.cs index ffd8dab..104a8b3 100644 --- a/Recyclable.Collections/SystemRandomNumberGenerator.cs +++ b/Recyclable.Collections/SystemRandomNumberGenerator.cs @@ -1,9 +1,9 @@ -namespace Recyclable.Collections -{ - internal class SystemRandomNumberGenerator : IRandomNumberGenerator - { - private readonly Random _random = new(); - - public int NextInt32(int startIndex, int endIndex) => _random.Next(startIndex, endIndex); - } +namespace Recyclable.Collections +{ + internal class SystemRandomNumberGenerator : IRandomNumberGenerator + { + private readonly Random _random = new(); + + public int NextInt32(int startIndex, int endIndex) => _random.Next(startIndex, endIndex); + } } \ No newline at end of file diff --git a/Recyclable.Collections/ThrowHelper.cs b/Recyclable.Collections/ThrowHelper.cs index d50e7e3..59af58c 100644 --- a/Recyclable.Collections/ThrowHelper.cs +++ b/Recyclable.Collections/ThrowHelper.cs @@ -1,16 +1,16 @@ -using System.Diagnostics.Contracts; - -namespace Recyclable.Collections -{ - internal static class ThrowHelper - { - /// - /// This is a helper method to throw with the given message. - /// - /// Always - public static void ThrowArgumentOutOfRangeException(string argumentName, string message) => throw new ArgumentOutOfRangeException(argumentName, message); - public static void ThrowWrongReturnedArraySizeException(int returnedLength, int blockSize) => throw new InvalidOperationException($"The array size {returnedLength} doesn't match the size {blockSize} of the pool buffer and cannot be returned to this pool."); - public static void ThrowArgumentOutOfRangeException_Index() => throw new ArgumentOutOfRangeException("index", "Parameter `index` has invalid value. It must be within the no. of elements in the collection"); - public static void ThrowArgumentOutOfRangeException_Count() => throw new ArgumentOutOfRangeException("index", "Parameter `count` has invalid value. Combined with index, it must be within the no. of elements in the collection"); - } -} +using System.Diagnostics.Contracts; + +namespace Recyclable.Collections +{ + internal static class ThrowHelper + { + /// + /// This is a helper method to throw with the given message. + /// + /// Always + public static void ThrowArgumentOutOfRangeException(string argumentName, string message) => throw new ArgumentOutOfRangeException(argumentName, message); + public static void ThrowWrongReturnedArraySizeException(int returnedLength, int blockSize) => throw new InvalidOperationException($"The array size {returnedLength} doesn't match the size {blockSize} of the pool buffer and cannot be returned to this pool."); + public static void ThrowArgumentOutOfRangeException_Index() => throw new ArgumentOutOfRangeException("index", "Parameter `index` has invalid value. It must be within the no. of elements in the collection"); + public static void ThrowArgumentOutOfRangeException_Count() => throw new ArgumentOutOfRangeException("index", "Parameter `count` has invalid value. Combined with index, it must be within the no. of elements in the collection"); + } +} diff --git a/Recyclable.CollectionsTests/CustomIList.cs b/Recyclable.CollectionsTests/CustomIList.cs index 81acead..481b4c1 100644 --- a/Recyclable.CollectionsTests/CustomIList.cs +++ b/Recyclable.CollectionsTests/CustomIList.cs @@ -1,33 +1,33 @@ -using System.Collections; - -namespace Recyclable.CollectionsTests -{ - public class CustomIList : IList - { - protected List _list; - - public CustomIList() - { - _list = new List(); - } - - public CustomIList(IEnumerable items) - { - _list = new List(items); - } - - public T this[int index] { get => _list[index]; set => _list[index] = value; } - public int Count => _list.Count; - public bool IsReadOnly => false; - public void Add(T item) => _list.Add(item); - public void Clear() => _list.Clear(); - public bool Contains(T item) => _list.Contains(item); - public void CopyTo(T[] array, int arrayIndex) => _list.CopyTo(0, array, arrayIndex, _list.Count); - public IEnumerator GetEnumerator() => _list.GetEnumerator(); - public int IndexOf(T item) => _list.IndexOf(item); - public void Insert(int index, T item) => _list.Insert(index, item); - public bool Remove(T item) => _list.Remove(item); - public void RemoveAt(int index) => _list.RemoveAt(index); - IEnumerator IEnumerable.GetEnumerator() => _list.GetEnumerator(); - } +using System.Collections; + +namespace Recyclable.CollectionsTests +{ + public class CustomIList : IList + { + protected List _list; + + public CustomIList() + { + _list = new List(); + } + + public CustomIList(IEnumerable items) + { + _list = new List(items); + } + + public T this[int index] { get => _list[index]; set => _list[index] = value; } + public int Count => _list.Count; + public bool IsReadOnly => false; + public void Add(T item) => _list.Add(item); + public void Clear() => _list.Clear(); + public bool Contains(T item) => _list.Contains(item); + public void CopyTo(T[] array, int arrayIndex) => _list.CopyTo(0, array, arrayIndex, _list.Count); + public IEnumerator GetEnumerator() => _list.GetEnumerator(); + public int IndexOf(T item) => _list.IndexOf(item); + public void Insert(int index, T item) => _list.Insert(index, item); + public bool Remove(T item) => _list.Remove(item); + public void RemoveAt(int index) => _list.RemoveAt(index); + IEnumerator IEnumerable.GetEnumerator() => _list.GetEnumerator(); + } } \ No newline at end of file diff --git a/Recyclable.CollectionsTests/EnumerableWithoutCount.cs b/Recyclable.CollectionsTests/EnumerableWithoutCount.cs index 34df3e9..7c69e4d 100644 --- a/Recyclable.CollectionsTests/EnumerableWithoutCount.cs +++ b/Recyclable.CollectionsTests/EnumerableWithoutCount.cs @@ -1,17 +1,17 @@ -using System.Collections; - -namespace Recyclable.CollectionsTests -{ - public class EnumerableWithoutCount : IEnumerable - { - private readonly IEnumerable _testData; - - public EnumerableWithoutCount(IEnumerable testData) - { - _testData = testData; - } - - public IEnumerator GetEnumerator() => _testData.GetEnumerator(); - IEnumerator IEnumerable.GetEnumerator() => _testData.GetEnumerator(); - } +using System.Collections; + +namespace Recyclable.CollectionsTests +{ + public class EnumerableWithoutCount : IEnumerable + { + private readonly IEnumerable _testData; + + public EnumerableWithoutCount(IEnumerable testData) + { + _testData = testData; + } + + public IEnumerator GetEnumerator() => _testData.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => _testData.GetEnumerator(); + } } \ No newline at end of file diff --git a/Recyclable.CollectionsTests/MathUtilsTests.cs b/Recyclable.CollectionsTests/MathUtilsTests.cs index dd8e625..9abc965 100644 --- a/Recyclable.CollectionsTests/MathUtilsTests.cs +++ b/Recyclable.CollectionsTests/MathUtilsTests.cs @@ -1,85 +1,85 @@ -using FluentAssertions; -using Recyclable.Collections; - -namespace Recyclable.CollectionsTests -{ - public class MathUtilsTests - { - [Theory] - [InlineData(int.MaxValue / 1024, int.MaxValue / 10 / 1024)] - public void DivMod(long testNumber, int blockSize) - { - for (var testCase = testNumber; testCase >= 0; testCase--) - { - // Prepare - var expectedResult = testCase / blockSize; - var expectedRemainder = testCase % blockSize; - - // Act - var actualResult = MathUtils.DivMod(testCase, blockSize, out long actualRemainder); - - // Validate - _ = actualResult.Should().Be(expectedResult); - _ = actualRemainder.Should().Be(expectedRemainder); - } - } - - [Theory] - [InlineData(0, false)] - [InlineData(1, true)] - [InlineData(2, true)] - [InlineData(3, false)] - [InlineData(4, true)] - [InlineData(5, false)] - [InlineData(8, true)] - [InlineData(16, true)] - [InlineData(20, false)] - [InlineData(32, true)] - [InlineData(64, true)] - [InlineData(128, true)] - [InlineData(256, true)] - [InlineData(512, true)] - [InlineData(1024, true)] - [InlineData(2048, true)] - [InlineData(4096, true)] - [InlineData(8192, true)] - [InlineData(16384, true)] - [InlineData(32768, true)] - [InlineData(65536, true)] - [InlineData(131072, true)] - [InlineData(262144, true)] - [InlineData(524288, true)] - [InlineData(1048576, true)] - [InlineData(2097152, true)] - [InlineData(4194304, true)] - [InlineData(8388608, true)] - [InlineData(16777216, true)] - [InlineData(33554432, true)] - [InlineData(67108864, true)] - [InlineData(134217728, true)] - [InlineData(268435456, true)] - [InlineData(536870912, true)] - [InlineData(1073741824, true)] - [InlineData(2147483648, true)] - [InlineData(2147483649, false)] - [InlineData(4294967296, true)] - public void IsPow2(long testNumber, bool expected) - { - _ = MathUtils.IsPow2(testNumber).Should().Be(expected); - } - - [Theory] - [InlineData(-2, -1)] - [InlineData(-1, -1)] - [InlineData(0, -1)] - [InlineData(1, 0)] - [InlineData(2, 1)] - [InlineData(3, -1)] - [InlineData(4, 2)] - [InlineData(8, 3)] - public void GetPow2Shift(long testNumber, int expected) - { - _ = MathUtils.GetPow2Shift(testNumber).Should().Be(expected); - } - } -} +using FluentAssertions; +using Recyclable.Collections; + +namespace Recyclable.CollectionsTests +{ + public class MathUtilsTests + { + [Theory] + [InlineData(int.MaxValue / 1024, int.MaxValue / 10 / 1024)] + public void DivMod(long testNumber, int blockSize) + { + for (var testCase = testNumber; testCase >= 0; testCase--) + { + // Prepare + var expectedResult = testCase / blockSize; + var expectedRemainder = testCase % blockSize; + + // Act + var actualResult = MathUtils.DivMod(testCase, blockSize, out long actualRemainder); + + // Validate + _ = actualResult.Should().Be(expectedResult); + _ = actualRemainder.Should().Be(expectedRemainder); + } + } + + [Theory] + [InlineData(0, false)] + [InlineData(1, true)] + [InlineData(2, true)] + [InlineData(3, false)] + [InlineData(4, true)] + [InlineData(5, false)] + [InlineData(8, true)] + [InlineData(16, true)] + [InlineData(20, false)] + [InlineData(32, true)] + [InlineData(64, true)] + [InlineData(128, true)] + [InlineData(256, true)] + [InlineData(512, true)] + [InlineData(1024, true)] + [InlineData(2048, true)] + [InlineData(4096, true)] + [InlineData(8192, true)] + [InlineData(16384, true)] + [InlineData(32768, true)] + [InlineData(65536, true)] + [InlineData(131072, true)] + [InlineData(262144, true)] + [InlineData(524288, true)] + [InlineData(1048576, true)] + [InlineData(2097152, true)] + [InlineData(4194304, true)] + [InlineData(8388608, true)] + [InlineData(16777216, true)] + [InlineData(33554432, true)] + [InlineData(67108864, true)] + [InlineData(134217728, true)] + [InlineData(268435456, true)] + [InlineData(536870912, true)] + [InlineData(1073741824, true)] + [InlineData(2147483648, true)] + [InlineData(2147483649, false)] + [InlineData(4294967296, true)] + public void IsPow2(long testNumber, bool expected) + { + _ = MathUtils.IsPow2(testNumber).Should().Be(expected); + } + + [Theory] + [InlineData(-2, -1)] + [InlineData(-1, -1)] + [InlineData(0, -1)] + [InlineData(1, 0)] + [InlineData(2, 1)] + [InlineData(3, -1)] + [InlineData(4, 2)] + [InlineData(8, 3)] + public void GetPow2Shift(long testNumber, int expected) + { + _ = MathUtils.GetPow2Shift(testNumber).Should().Be(expected); + } + } +} diff --git a/Recyclable.CollectionsTests/Recyclable.CollectionsTests.csproj b/Recyclable.CollectionsTests/Recyclable.CollectionsTests.csproj index e042f9b..6f577e6 100644 --- a/Recyclable.CollectionsTests/Recyclable.CollectionsTests.csproj +++ b/Recyclable.CollectionsTests/Recyclable.CollectionsTests.csproj @@ -1,41 +1,41 @@ - - - - net8.0;net7.0;net6.0 - enable - enable - false - AnyCPU;x64 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - PreserveNewest - - - - + + + + net8.0;net7.0;net6.0 + enable + enable + false + AnyCPU;x64 + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + PreserveNewest + + + + diff --git a/Recyclable.CollectionsTests/RecyclableDictionaryTests.cs b/Recyclable.CollectionsTests/RecyclableDictionaryTests.cs index 5f9399e..21dd069 100644 --- a/Recyclable.CollectionsTests/RecyclableDictionaryTests.cs +++ b/Recyclable.CollectionsTests/RecyclableDictionaryTests.cs @@ -1,323 +1,323 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableDictionaryTests - { - private static readonly (int, string)[] _testData = new[] { (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e") }; - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldStoreItems(int itemsCount) - { - using var dict = new RecyclableDictionary(); - foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - dict.Add(key, -key); - } - - _ = dict.Should().HaveCount(itemsCount); - for (var i = 0; i < itemsCount; i++) - { - long expectedKey = i + 1; - dict.GetKey(i).Should().Be(expectedKey); - dict.GetValue(i).Should().Be(-expectedKey); - } - } - - [Fact] - public void IndexerShouldUpdateValue() - { - using var dict = new RecyclableDictionary(); - dict.Add(1, "a"); - - dict[1] = "b"; - - _ = dict[1].Should().Be("b"); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldSwapWithLast(int itemsCount) - { - using var dict = new RecyclableDictionary(); - foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - dict.Add(key, key); - } - - if (itemsCount > 0) - { - long keyToRemove = (itemsCount + 1) / 2; - dict.Remove(keyToRemove).Should().BeTrue(); - _ = dict.ContainsKey(keyToRemove).Should().BeFalse(); - _ = dict.Should().HaveCount(itemsCount - 1); - } - else - { - dict.Remove(0).Should().BeFalse(); - _ = dict.Should().BeEmpty(); - } - } - - [Fact] - public void TryGetValueShouldReturnValue() - { - using var dict = new RecyclableDictionary(); - dict.Add(1, "a"); - - var found = dict.TryGetValue(1, out var value); - - _ = found.Should().BeTrue(); - _ = value.Should().Be("a"); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void EnumeratorShouldYieldItems(int itemsCount) - { - using var dict = new RecyclableDictionary(); - foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - dict.Add(key, key); - } - - var actual = new List(); - var enumerator = dict.GetEnumerator(); - while (enumerator.MoveNext()) - { - actual.Add(enumerator.Current.Key); - } - - var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToList(); - _ = actual.Should().ContainInConsecutiveOrder(expected); - } - - [Fact] - public void AddRangeShouldAddItemsFromSpan() - { - using var dict = new RecyclableDictionary(); - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - dict.AddRange(data); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(i + 1); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - - [Fact] - public void AddRangeShouldAddItemsFromDictionary() - { - using var source = new RecyclableDictionary(); - source.Add(1, "a"); - source.Add(2, "b"); - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(2); - dict.GetKey(0).Should().Be(1); - dict.GetValue(0).Should().Be("a"); - dict.GetKey(1).Should().Be(2); - dict.GetValue(1).Should().Be("b"); - } - - [Fact] - public void AddRangeShouldAddListItemsInCorrectOrder() - { - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - using var source = new RecyclableList>(data); - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(data[i].Key); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - - [Fact] - public void AddRangeShouldAddLongListItemsInCorrectOrder() - { - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - using var source = new RecyclableLongList>(data); - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(data[i].Key); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedDictionaryItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(itemsCount); - for (int i = 0; i < data.Length; i++) - { - dict.GetKey(i).Should().Be(i); - dict.GetValue(i).Should().Be(data[i]); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(itemsCount); - for (int i = 0; i < data.Length; i++) - { - dict.GetKey(i).Should().Be(i); - dict.GetValue(i).Should().Be(data[i]); - } - } - - [Fact] - public void AddRangeShouldAddQueueItemsInCorrectOrder() - { - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - using var source = new RecyclableQueue>(data); - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(data[i].Key); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - - [Fact] - public void AddRangeShouldAddStackItemsInCorrectOrder() - { - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - using var source = new RecyclableStack>(data); - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(data[i].Key); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - - [Fact] - public void AddRangeShouldAddLinkedListItemsInCorrectOrder() - { - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - using var source = new RecyclableLinkedList>(data); - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(data[i].Key); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - - [Fact] - public void AddRangeShouldAddPriorityQueueItemsInCorrectOrder() - { - var data = new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b"), - new KeyValuePair(3, "c"), - }; - - using var source = new RecyclablePriorityQueue>(comparer: Comparer>.Create((x, y) => x.Key.CompareTo(y.Key))); - foreach (var kvp in data) - { - source.Enqueue(kvp); - } - using var dict = new RecyclableDictionary(); - - dict.AddRange(source); - - _ = dict.Count.Should().Be(3); - for (int i = 0; i < 3; i++) - { - dict.GetKey(i).Should().Be(data[i].Key); - dict.GetValue(i).Should().Be(data[i].Value); - } - } - } -} +using FluentAssertions; +using Recyclable.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableDictionaryTests + { + private static readonly (int, string)[] _testData = new[] { (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e") }; + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldStoreItems(int itemsCount) + { + using var dict = new RecyclableDictionary(); + foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + dict.Add(key, -key); + } + + _ = dict.Should().HaveCount(itemsCount); + for (var i = 0; i < itemsCount; i++) + { + long expectedKey = i + 1; + dict.GetKey(i).Should().Be(expectedKey); + dict.GetValue(i).Should().Be(-expectedKey); + } + } + + [Fact] + public void IndexerShouldUpdateValue() + { + using var dict = new RecyclableDictionary(); + dict.Add(1, "a"); + + dict[1] = "b"; + + _ = dict[1].Should().Be("b"); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldSwapWithLast(int itemsCount) + { + using var dict = new RecyclableDictionary(); + foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + dict.Add(key, key); + } + + if (itemsCount > 0) + { + long keyToRemove = (itemsCount + 1) / 2; + dict.Remove(keyToRemove).Should().BeTrue(); + _ = dict.ContainsKey(keyToRemove).Should().BeFalse(); + _ = dict.Should().HaveCount(itemsCount - 1); + } + else + { + dict.Remove(0).Should().BeFalse(); + _ = dict.Should().BeEmpty(); + } + } + + [Fact] + public void TryGetValueShouldReturnValue() + { + using var dict = new RecyclableDictionary(); + dict.Add(1, "a"); + + var found = dict.TryGetValue(1, out var value); + + _ = found.Should().BeTrue(); + _ = value.Should().Be("a"); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void EnumeratorShouldYieldItems(int itemsCount) + { + using var dict = new RecyclableDictionary(); + foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + dict.Add(key, key); + } + + var actual = new List(); + var enumerator = dict.GetEnumerator(); + while (enumerator.MoveNext()) + { + actual.Add(enumerator.Current.Key); + } + + var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToList(); + _ = actual.Should().ContainInConsecutiveOrder(expected); + } + + [Fact] + public void AddRangeShouldAddItemsFromSpan() + { + using var dict = new RecyclableDictionary(); + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + dict.AddRange(data); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(i + 1); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + + [Fact] + public void AddRangeShouldAddItemsFromDictionary() + { + using var source = new RecyclableDictionary(); + source.Add(1, "a"); + source.Add(2, "b"); + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(2); + dict.GetKey(0).Should().Be(1); + dict.GetValue(0).Should().Be("a"); + dict.GetKey(1).Should().Be(2); + dict.GetValue(1).Should().Be("b"); + } + + [Fact] + public void AddRangeShouldAddListItemsInCorrectOrder() + { + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + using var source = new RecyclableList>(data); + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(data[i].Key); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + + [Fact] + public void AddRangeShouldAddLongListItemsInCorrectOrder() + { + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + using var source = new RecyclableLongList>(data); + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(data[i].Key); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedDictionaryItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(itemsCount); + for (int i = 0; i < data.Length; i++) + { + dict.GetKey(i).Should().Be(i); + dict.GetValue(i).Should().Be(data[i]); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(itemsCount); + for (int i = 0; i < data.Length; i++) + { + dict.GetKey(i).Should().Be(i); + dict.GetValue(i).Should().Be(data[i]); + } + } + + [Fact] + public void AddRangeShouldAddQueueItemsInCorrectOrder() + { + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + using var source = new RecyclableQueue>(data); + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(data[i].Key); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + + [Fact] + public void AddRangeShouldAddStackItemsInCorrectOrder() + { + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + using var source = new RecyclableStack>(data); + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(data[i].Key); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + + [Fact] + public void AddRangeShouldAddLinkedListItemsInCorrectOrder() + { + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + using var source = new RecyclableLinkedList>(data); + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(data[i].Key); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + + [Fact] + public void AddRangeShouldAddPriorityQueueItemsInCorrectOrder() + { + var data = new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b"), + new KeyValuePair(3, "c"), + }; + + using var source = new RecyclablePriorityQueue>(comparer: Comparer>.Create((x, y) => x.Key.CompareTo(y.Key))); + foreach (var kvp in data) + { + source.Enqueue(kvp); + } + using var dict = new RecyclableDictionary(); + + dict.AddRange(source); + + _ = dict.Count.Should().Be(3); + for (int i = 0; i < 3; i++) + { + dict.GetKey(i).Should().Be(data[i].Key); + dict.GetValue(i).Should().Be(data[i].Value); + } + } + } +} diff --git a/Recyclable.CollectionsTests/RecyclableHashSetTests.cs b/Recyclable.CollectionsTests/RecyclableHashSetTests.cs index 8ab6120..9670888 100644 --- a/Recyclable.CollectionsTests/RecyclableHashSetTests.cs +++ b/Recyclable.CollectionsTests/RecyclableHashSetTests.cs @@ -1,293 +1,293 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableHashSetTests - { - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldStoreUniqueItems(int itemsCount) - { - using var set = new RecyclableHashSet(); - foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - set.Add(item).Should().BeTrue(); - } - - foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - set.Add(item).Should().BeFalse(); - } - - _ = set.Should().HaveCount(itemsCount); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldDeleteItem(int itemsCount) - { - using var set = new RecyclableHashSet(); - foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - set.Add(item); - } - - if (itemsCount > 0) - { - long value = (itemsCount + 1) / 2; - set.Remove(value).Should().BeTrue(); - _ = set.Contains(value).Should().BeFalse(); - _ = set.Should().HaveCount(itemsCount - 1); - } - else - { - set.Remove(0).Should().BeFalse(); - _ = set.Should().BeEmpty(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void EnumeratorShouldYieldItems(int itemsCount) - { - using var set = new RecyclableHashSet(); - foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - set.Add(item); - } - - var actual = new List(); - var enumerator = set.GetEnumerator(); - while (enumerator.MoveNext()) - { - actual.Add(enumerator.Current); - } - - var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToList(); - if (itemsCount == 0) - { - _ = actual.Should().BeEmpty(); - } - else - { - _ = actual.Should().Contain(expected).And.HaveCount(itemsCount); - } - } - - [Fact] - public void AddRangeShouldAddItemsFromSpan() - { - using var set = new RecyclableHashSet(); - var data = new[] { 1, 2, 3 }; - - set.AddRange(data); - - _ = set.Count.Should().Be(3); - _ = set.Should().ContainInOrder(data); - } - - [Fact] - public void AddRangeShouldIgnoreDuplicates() - { - using var set = new RecyclableHashSet(); - var data = new[] { 1, 2, 3 }; - - set.AddRange(data); - set.AddRange(data); - - _ = set.Count.Should().Be(3); - _ = set.Should().ContainInOrder(data); - } - [Fact] - public void AddRangeShouldAddItemsFromList() - { - using var set = new RecyclableHashSet(); - var list = new List { 1, 2, 3 }; - - set.AddRange(list); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromRecyclableList() - { - using var set = new RecyclableHashSet(); - using var list = new RecyclableList(new[] { 1, 2, 3 }); - - set.AddRange(list); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromLongList() - { - using var set = new RecyclableHashSet(); - using var list = new RecyclableLongList(new[] { 1, 2, 3 }); - - set.AddRange(list); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromStack() - { - using var set = new RecyclableHashSet(); - using var stack = new RecyclableStack(new[] { 1, 2, 3 }); - - set.AddRange(stack); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromQueue() - { - using var set = new RecyclableHashSet(); - using var queue = new RecyclableQueue(new[] { 1, 2, 3 }); - - set.AddRange(queue); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromArray() - { - using var set = new RecyclableHashSet(); - Array array = new int[] { 1, 2, 3 }; - - set.AddRange(array); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromICollection() - { - using var set = new RecyclableHashSet(); - System.Collections.ArrayList list = new System.Collections.ArrayList { 1, 2, 3 }; - - set.AddRange(list); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromGenericICollection() - { - using var set = new RecyclableHashSet(); - ICollection list = new List { 1, 2, 3 }; - - set.AddRange(list); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromSortedSet() - { - using var source = new RecyclableSortedSet(); - source.Add(1); - source.Add(2); - source.Add(3); - using var set = new RecyclableHashSet(); - - set.AddRange(source); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromLinkedList() - { - using var source = new RecyclableLinkedList(new[] { 1, 2, 3 }); - using var set = new RecyclableHashSet(); - - set.AddRange(source); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromPriorityQueue() - { - using var source = new RecyclablePriorityQueue(); - source.Enqueue(1); - source.Enqueue(2); - source.Enqueue(3); - using var set = new RecyclableHashSet(); - - set.AddRange(source); - - _ = set.Count.Should().Be(3); - _ = set.Should().Contain(new[] { 1, 2, 3 }); - } - - [Fact] - public void AddRangeShouldAddItemsFromDictionary() - { - using var source = new RecyclableDictionary(); - source.Add(1, "a"); - source.Add(2, "b"); - using var set = new RecyclableHashSet>(); - - set.AddRange(source); - - _ = set.Count.Should().Be(2); - set.Should().Contain(new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b") - }); - } - - [Fact] - public void AddRangeShouldAddItemsFromSortedDictionary() - { - using var source = new RecyclableSortedDictionary(); - source.Add(1, "a"); - source.Add(2, "b"); - using var set = new RecyclableHashSet>(); - - set.AddRange(source); - - _ = set.Count.Should().Be(2); - set.Should().Contain(new[] - { - new KeyValuePair(1, "a"), - new KeyValuePair(2, "b") - }); - } - - [Fact] - public void AddRangeShouldAddItemsFromSortedList() - { - using var source = new RecyclableSortedList(); - source.Add(1, "a"); - source.Add(2, "b"); - using var set = new RecyclableHashSet<(int Key, string Value)>(); - - set.AddRange(source); - - _ = set.Count.Should().Be(2); - set.Should().Contain(new[] { (1, "a"), (2, "b") }); - } - - } -} +using FluentAssertions; +using Recyclable.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableHashSetTests + { + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldStoreUniqueItems(int itemsCount) + { + using var set = new RecyclableHashSet(); + foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + set.Add(item).Should().BeTrue(); + } + + foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + set.Add(item).Should().BeFalse(); + } + + _ = set.Should().HaveCount(itemsCount); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldDeleteItem(int itemsCount) + { + using var set = new RecyclableHashSet(); + foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + set.Add(item); + } + + if (itemsCount > 0) + { + long value = (itemsCount + 1) / 2; + set.Remove(value).Should().BeTrue(); + _ = set.Contains(value).Should().BeFalse(); + _ = set.Should().HaveCount(itemsCount - 1); + } + else + { + set.Remove(0).Should().BeFalse(); + _ = set.Should().BeEmpty(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void EnumeratorShouldYieldItems(int itemsCount) + { + using var set = new RecyclableHashSet(); + foreach (var item in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + set.Add(item); + } + + var actual = new List(); + var enumerator = set.GetEnumerator(); + while (enumerator.MoveNext()) + { + actual.Add(enumerator.Current); + } + + var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToList(); + if (itemsCount == 0) + { + _ = actual.Should().BeEmpty(); + } + else + { + _ = actual.Should().Contain(expected).And.HaveCount(itemsCount); + } + } + + [Fact] + public void AddRangeShouldAddItemsFromSpan() + { + using var set = new RecyclableHashSet(); + var data = new[] { 1, 2, 3 }; + + set.AddRange(data); + + _ = set.Count.Should().Be(3); + _ = set.Should().ContainInOrder(data); + } + + [Fact] + public void AddRangeShouldIgnoreDuplicates() + { + using var set = new RecyclableHashSet(); + var data = new[] { 1, 2, 3 }; + + set.AddRange(data); + set.AddRange(data); + + _ = set.Count.Should().Be(3); + _ = set.Should().ContainInOrder(data); + } + [Fact] + public void AddRangeShouldAddItemsFromList() + { + using var set = new RecyclableHashSet(); + var list = new List { 1, 2, 3 }; + + set.AddRange(list); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromRecyclableList() + { + using var set = new RecyclableHashSet(); + using var list = new RecyclableList(new[] { 1, 2, 3 }); + + set.AddRange(list); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromLongList() + { + using var set = new RecyclableHashSet(); + using var list = new RecyclableLongList(new[] { 1, 2, 3 }); + + set.AddRange(list); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromStack() + { + using var set = new RecyclableHashSet(); + using var stack = new RecyclableStack(new[] { 1, 2, 3 }); + + set.AddRange(stack); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromQueue() + { + using var set = new RecyclableHashSet(); + using var queue = new RecyclableQueue(new[] { 1, 2, 3 }); + + set.AddRange(queue); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromArray() + { + using var set = new RecyclableHashSet(); + Array array = new int[] { 1, 2, 3 }; + + set.AddRange(array); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromICollection() + { + using var set = new RecyclableHashSet(); + System.Collections.ArrayList list = new System.Collections.ArrayList { 1, 2, 3 }; + + set.AddRange(list); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromGenericICollection() + { + using var set = new RecyclableHashSet(); + ICollection list = new List { 1, 2, 3 }; + + set.AddRange(list); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromSortedSet() + { + using var source = new RecyclableSortedSet(); + source.Add(1); + source.Add(2); + source.Add(3); + using var set = new RecyclableHashSet(); + + set.AddRange(source); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromLinkedList() + { + using var source = new RecyclableLinkedList(new[] { 1, 2, 3 }); + using var set = new RecyclableHashSet(); + + set.AddRange(source); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromPriorityQueue() + { + using var source = new RecyclablePriorityQueue(); + source.Enqueue(1); + source.Enqueue(2); + source.Enqueue(3); + using var set = new RecyclableHashSet(); + + set.AddRange(source); + + _ = set.Count.Should().Be(3); + _ = set.Should().Contain(new[] { 1, 2, 3 }); + } + + [Fact] + public void AddRangeShouldAddItemsFromDictionary() + { + using var source = new RecyclableDictionary(); + source.Add(1, "a"); + source.Add(2, "b"); + using var set = new RecyclableHashSet>(); + + set.AddRange(source); + + _ = set.Count.Should().Be(2); + set.Should().Contain(new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b") + }); + } + + [Fact] + public void AddRangeShouldAddItemsFromSortedDictionary() + { + using var source = new RecyclableSortedDictionary(); + source.Add(1, "a"); + source.Add(2, "b"); + using var set = new RecyclableHashSet>(); + + set.AddRange(source); + + _ = set.Count.Should().Be(2); + set.Should().Contain(new[] + { + new KeyValuePair(1, "a"), + new KeyValuePair(2, "b") + }); + } + + [Fact] + public void AddRangeShouldAddItemsFromSortedList() + { + using var source = new RecyclableSortedList(); + source.Add(1, "a"); + source.Add(2, "b"); + using var set = new RecyclableHashSet<(int Key, string Value)>(); + + set.AddRange(source); + + _ = set.Count.Should().Be(2); + set.Should().Contain(new[] { (1, "a"), (2, "b") }); + } + + } +} diff --git a/Recyclable.CollectionsTests/RecyclableLinkedListTests.cs b/Recyclable.CollectionsTests/RecyclableLinkedListTests.cs index 5f92a3a..d649b59 100644 --- a/Recyclable.CollectionsTests/RecyclableLinkedListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableLinkedListTests.cs @@ -1,589 +1,589 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Linq; -using System.Collections; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableLinkedListTests - { - private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" }; - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddLastShouldPreserveOrder(int itemsCount) - { - using var list = new RecyclableLinkedList(); - var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - foreach (var item in expected) - { - list.AddLast(item); - } - - var actual = new RecyclableLongList(); - foreach (var item in list) - { - actual.Add(item); - } - - _ = actual.Should().ContainInConsecutiveOrder(expected) - .And.BeEquivalentTo(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddFirstShouldReverseOrder(int itemsCount) - { - using var list = new RecyclableLinkedList(); - var source = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - foreach (var item in source) - { - list.AddFirst(item); - } - - var expected = source.Reverse().ToArray(); - var actual = new RecyclableLongList(); - foreach (var item in list) - { - actual.Add(item); - } - - _ = actual.Should().ContainInConsecutiveOrder(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveFirstShouldReturnItemsInOrder(int itemsCount) - { - var source = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var list = new RecyclableLinkedList(source); - var actual = new RecyclableLongList(); - while (list.LongCount > 0) - { - actual.Add(list.RemoveFirst()); - } - - _ = actual.Should().ContainInConsecutiveOrder(source); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveLastShouldReturnItemsInReverseOrder(int itemsCount) - { - var source = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var list = new RecyclableLinkedList(source); - var actual = new RecyclableLongList(); - while (list.LongCount > 0) - { - actual.Add(list.RemoveLast()); - } - - _ = actual.Should().ContainInConsecutiveOrder(source.Reverse()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableList(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableList(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddLongListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLongList(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromLongList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLongList(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddHashSetItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableHashSet(); - foreach (long item in data) - { - source.Add(item); - } - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromHashSet(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableHashSet(); - foreach (long item in data) - { - source.Add(item); - } - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddStackItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableStack(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromStack(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableStack(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedSetItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedSet(); - foreach (long item in data) - { - source.Add(item); - } - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedSet(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedSet(); - foreach (long item in data) - { - source.Add(item); - } - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddLinkedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLinkedList(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromLinkedList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLinkedList(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddPriorityQueueItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclablePriorityQueue(); - foreach (long item in data) - { - source.Enqueue(item); - } - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromPriorityQueue(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclablePriorityQueue(); - foreach (long item in data) - { - source.Enqueue(item); - } - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddQueueItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableQueue(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromQueue(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableQueue(data); - using var list = new RecyclableLinkedList(); - - list.AddRange(source); - list.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddDictionaryItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var list = new RecyclableLinkedList>(); - - list.AddRange(source); - - List> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromDictionary(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var list = new RecyclableLinkedList>(); - - list.AddRange(source); - list.AddRange(source); - - List> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var list = new RecyclableLinkedList<(int Key, long Value)>(); - - list.AddRange(source); - - List<(int Key, long Value)> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var list = new RecyclableLinkedList<(int Key, long Value)>(); - - list.AddRange(source); - list.AddRange(source); - - List<(int Key, long Value)> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedDictionaryItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var list = new RecyclableLinkedList>(); - - list.AddRange(source); - - List> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedDictionary(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var list = new RecyclableLinkedList>(); - - list.AddRange(source); - list.AddRange(source); - - List> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(expected); - } - - [Fact] - public void AddRangeShouldAddArrayItems() - { - long[] data = { 1, 2, 3 }; - using var list = new RecyclableLinkedList(); - - list.AddRange(data); - - _ = list.Should().Equal(data); - } - - [Fact] - public void AddRangeShouldAddCollectionItems() - { - ICollection collection = new long[] { 1, 2, 3 }; - using var list = new RecyclableLinkedList(); - - list.AddRange(collection); - - _ = list.Should().Equal(collection.Cast()); - } - - [Fact] - public void AddRangeShouldAddEnumerableItems() - { - IEnumerable enumerable = new long[] { 1, 2, 3 }; - using var list = new RecyclableLinkedList(); - - list.AddRange(enumerable); - - _ = list.Should().Equal(enumerable); - } - - [Fact] - public void AddRangeShouldAddSpanItems() - { - long[] data = { 1, 2, 3 }; - Span span = data; - using var list = new RecyclableLinkedList(); - - list.AddRange(span); - - _ = list.Should().Equal(data); - } - - [Fact] - public void AddRangeShouldAddListItems() - { - var data = new List { 1, 2, 3 }; - using var list = new RecyclableLinkedList(); - - list.AddRange(data); - - _ = list.Should().Equal(data); - } - } -} +using FluentAssertions; +using Recyclable.Collections; +using System.Linq; +using System.Collections; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableLinkedListTests + { + private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" }; + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddLastShouldPreserveOrder(int itemsCount) + { + using var list = new RecyclableLinkedList(); + var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + foreach (var item in expected) + { + list.AddLast(item); + } + + var actual = new RecyclableLongList(); + foreach (var item in list) + { + actual.Add(item); + } + + _ = actual.Should().ContainInConsecutiveOrder(expected) + .And.BeEquivalentTo(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddFirstShouldReverseOrder(int itemsCount) + { + using var list = new RecyclableLinkedList(); + var source = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + foreach (var item in source) + { + list.AddFirst(item); + } + + var expected = source.Reverse().ToArray(); + var actual = new RecyclableLongList(); + foreach (var item in list) + { + actual.Add(item); + } + + _ = actual.Should().ContainInConsecutiveOrder(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveFirstShouldReturnItemsInOrder(int itemsCount) + { + var source = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var list = new RecyclableLinkedList(source); + var actual = new RecyclableLongList(); + while (list.LongCount > 0) + { + actual.Add(list.RemoveFirst()); + } + + _ = actual.Should().ContainInConsecutiveOrder(source); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveLastShouldReturnItemsInReverseOrder(int itemsCount) + { + var source = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var list = new RecyclableLinkedList(source); + var actual = new RecyclableLongList(); + while (list.LongCount > 0) + { + actual.Add(list.RemoveLast()); + } + + _ = actual.Should().ContainInConsecutiveOrder(source.Reverse()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableList(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableList(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddLongListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLongList(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromLongList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLongList(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddHashSetItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableHashSet(); + foreach (long item in data) + { + source.Add(item); + } + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromHashSet(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableHashSet(); + foreach (long item in data) + { + source.Add(item); + } + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddStackItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableStack(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromStack(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableStack(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedSetItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedSet(); + foreach (long item in data) + { + source.Add(item); + } + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedSet(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedSet(); + foreach (long item in data) + { + source.Add(item); + } + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddLinkedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLinkedList(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromLinkedList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLinkedList(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddPriorityQueueItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclablePriorityQueue(); + foreach (long item in data) + { + source.Enqueue(item); + } + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromPriorityQueue(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclablePriorityQueue(); + foreach (long item in data) + { + source.Enqueue(item); + } + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddQueueItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableQueue(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromQueue(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableQueue(data); + using var list = new RecyclableLinkedList(); + + list.AddRange(source); + list.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddDictionaryItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var list = new RecyclableLinkedList>(); + + list.AddRange(source); + + List> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromDictionary(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var list = new RecyclableLinkedList>(); + + list.AddRange(source); + list.AddRange(source); + + List> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var list = new RecyclableLinkedList<(int Key, long Value)>(); + + list.AddRange(source); + + List<(int Key, long Value)> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var list = new RecyclableLinkedList<(int Key, long Value)>(); + + list.AddRange(source); + list.AddRange(source); + + List<(int Key, long Value)> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedDictionaryItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var list = new RecyclableLinkedList>(); + + list.AddRange(source); + + List> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedDictionary(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var list = new RecyclableLinkedList>(); + + list.AddRange(source); + list.AddRange(source); + + List> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(expected); + } + + [Fact] + public void AddRangeShouldAddArrayItems() + { + long[] data = { 1, 2, 3 }; + using var list = new RecyclableLinkedList(); + + list.AddRange(data); + + _ = list.Should().Equal(data); + } + + [Fact] + public void AddRangeShouldAddCollectionItems() + { + ICollection collection = new long[] { 1, 2, 3 }; + using var list = new RecyclableLinkedList(); + + list.AddRange(collection); + + _ = list.Should().Equal(collection.Cast()); + } + + [Fact] + public void AddRangeShouldAddEnumerableItems() + { + IEnumerable enumerable = new long[] { 1, 2, 3 }; + using var list = new RecyclableLinkedList(); + + list.AddRange(enumerable); + + _ = list.Should().Equal(enumerable); + } + + [Fact] + public void AddRangeShouldAddSpanItems() + { + long[] data = { 1, 2, 3 }; + Span span = data; + using var list = new RecyclableLinkedList(); + + list.AddRange(span); + + _ = list.Should().Equal(data); + } + + [Fact] + public void AddRangeShouldAddListItems() + { + var data = new List { 1, 2, 3 }; + using var list = new RecyclableLinkedList(); + + list.AddRange(data); + + _ = list.Should().Equal(data); + } + } +} diff --git a/Recyclable.CollectionsTests/RecyclableListTests.cs b/Recyclable.CollectionsTests/RecyclableListTests.cs index ebfa680..3df3b9c 100644 --- a/Recyclable.CollectionsTests/RecyclableListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableListTests.cs @@ -1,1844 +1,1844 @@ -using FluentAssertions; -using Recyclable.Collections; -using Recyclable.Collections.Linq; -using Recyclable.Collections.Pools; -using System.Collections; -using System.Numerics; - -#pragma warning disable xUnit1026, RCS1163, IDE0060, RCS1235 - -namespace Recyclable.CollectionsTests -{ - public class RecyclableListTests - { - [Fact] - public void AddRangeShouldAcceptNulls() - { - // Prepare - using var list = new RecyclableList(); - long?[] testData = new long?[] { null, default }; - - // Act - list.AddRange(testData); - - // Validate - List expectedData = new(); - expectedData.AddRange(testData); - - _ = list.Count.Should().Be(testData.Length); - _ = list.Should().HaveCount(testData.Length).And.AllSatisfy(x => x.Should().BeNull()).And.Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(); - - // Act - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = list.AddRange((IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new Span((long[])testData)); - } - else if (testData is long[] testDataArray) - { - list.AddRange(testDataArray); - } - else if (testData is List testDataList) - { - list.AddRange(testDataList); - } - else if (testData is RecyclableList testDataRecyclableList) - { - list.AddRange(testDataRecyclableList); - } - else if (testData is RecyclableLongList testDataRecyclableLongList) - { - list.AddRange(testDataRecyclableLongList); - } - else if (testData is IList testDataIList) - { - list.AddRange(testDataIList); - } - else if (testData is IEnumerable testDataIEnumerable) - { - list.AddRange(testDataIEnumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - // Validate - List expectedData = new(itemsCount); - expectedData.AddRange(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(); - - // Act - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = list.AddRange((IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new Span((long[])testData)); - } - else if (testData is long[] testDataArray) - { - list.AddRange(testDataArray); - } - else if (testData is List testDataList) - { - list.AddRange(testDataList); - } - else if (testData is RecyclableList testDataRecyclableList) - { - list.AddRange(testDataRecyclableList); - } - else if (testData is RecyclableLongList testDataRecyclableLongList) - { - list.AddRange(testDataRecyclableLongList); - } - else if (testData is IList testDataIList) - { - list.AddRange(testDataIList); - } - else if (testData is IEnumerable testDataIEnumerable) - { - list.AddRange(testDataIEnumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - // Validate - List expectedData = new(itemsCount); - expectedData.AddRange(testData); - - _ = list.Capacity.Should().Be(RecyclableDefaults.InitialCapacity); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(); - itemsCount = checked(itemsCount << 1); - - // Act - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((Array)testData); - list.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = list.AddRange((IEnumerable)testData); - _ = list.AddRange((IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IReadOnlyList)testData); - list.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - var readOnlySpan = new ReadOnlySpan((long[])testData); - list.AddRange(readOnlySpan); - list.AddRange(readOnlySpan); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - var readOnlySpan = new Span((long[])testData); - list.AddRange(readOnlySpan); - list.AddRange(readOnlySpan); - } - else if (testData is long[] testDataArray) - { - list.AddRange(testDataArray); - list.AddRange(testDataArray); - } - else if (testData is List testDataList) - { - list.AddRange(testDataList); - list.AddRange(testDataList); - } - else if (testData is RecyclableList testDataRecyclableList) - { - list.AddRange(testDataRecyclableList); - list.AddRange(testDataRecyclableList); - } - else if (testData is RecyclableLongList testDataRecyclableLongList) - { - list.AddRange(testDataRecyclableLongList); - list.AddRange(testDataRecyclableLongList); - } - else if (testData is IList testDataIList) - { - list.AddRange(testDataIList); - list.AddRange(testDataIList); - } - else if (testData is IEnumerable testDataIEnumerable) - { - list.AddRange(testDataIEnumerable); - list.AddRange(testDataIEnumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - // Validate - List expectedData = new(itemsCount); - expectedData.AddRange(testData); - expectedData.AddRange(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldAcceptDuplicates(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(); - testData = testData.Concat(testData.Reverse()); - itemsCount = checked(itemsCount << 1); - - // Act - foreach (var index in testData) - { - list.Add(index); - } - - // Validate - List expectedData = new(itemsCount); - expectedData.AddRange(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Fact] - public void AddShouldAcceptNulls() - { - // Prepare - long?[] testData = new long?[] { null, default }; - using var list = new RecyclableList(); - - // Act - foreach (var item in testData) - { - list.Add(item); - } - - // Validate - List expectedData = new(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.InitialCapacity); - _ = list.Should().AllSatisfy(x => x.Should().BeNull()).And.Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldAddItems(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(); - - // Act - foreach (var item in testData) - { - list.Add(item); - _ = list.Count.Should().Be((int)item); - } - - // Validate - var expectedData = testData.ToList(); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldAddItemWhenAfterAddRange(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(); - itemsCount = checked(itemsCount << 1); - - // Act - list.AddRange(testData); - foreach (var index in testData) - { - list.Add(index); - } - - // Validate - List expectedData = new(itemsCount); - expectedData.AddRange(testData); - expectedData.AddRange(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ClearShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, int itemsCount) - { - //* Clearing empty list is tested in . - if (itemsCount == 0) - { - return; - } - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - _ = list.AsArray[..itemsCount].Should().AllSatisfy(x => x.Should().NotBeNull()); - - // Act - list.Clear(); - - // Validate - _ = list.AsArray[..itemsCount].Should().AllSatisfy(x => x.Should().BeNull()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ClearShouldRemoveAllItems(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - _ = list.Count.Should().Be(itemsCount); - - // Act - list.Clear(); - list.Clear(); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(0); - _ = list.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConsecutiveDisposeShouldSucceed(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - list.Dispose(); - - // Act - list.Dispose(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConstructorShouldAcceptDuplicates(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - testData = testData.Concat(testData.Reverse()); - itemsCount = checked(itemsCount << 1); - - // Act - using var list = new RecyclableList(testData, itemsCount); - - // Validate - List expectedData = new(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConstructorSourceShouldInitializeList(string testCase, IEnumerable testData, int itemsCount) - { - // Act - using var list = new RecyclableList(testData, itemsCount); - - // Validate - List expectedData = new(testData); - - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ContainsShouldFindAllItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - long expectedItem = expectedData[(int)itemIndex]; - bool expected = expectedData.Contains(expectedItem); - - // Act - var actual = list.Contains(expectedItem); - - // Validate - _ = actual.Should().Be(expected); - } - } - - [Fact] - public void ContainsShouldNotFindAnythingWhenListEmpty() - { - // Prepare - using var list = new RecyclableList(); - - // Validate - _ = list.Contains(0).Should().BeFalse(); - _ = list.Contains(1).Should().BeFalse(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ContainsShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - long expectedItem = -expectedData[(int)itemIndex]; - var expected = expectedData.Contains(expectedItem); - - // Act - var actual = list.Contains(expectedItem); - - // Validate - _ = actual.Should().Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConvertAllShouldConvertAllItems(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList().ConvertAll(item => item + 0.1); - - // Act - using var actual = list.ConvertAll(item => item + 0.1); - - // Validate - _ = actual.Count.Should().Be(itemsCount); - _ = actual.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void CopyToShouldCopyAllItemsInTheCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - long[] copiedItems = new long[itemsCount]; - - // Act - list.CopyTo(copiedItems, 0); - - // Validate - long[] expectedData = new long[itemsCount]; - testData.ToList().CopyTo(expectedData, 0); - - _ = copiedItems.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void CopyToShouldCopyAllItemsInTheCorrectOrderWhenFromStart(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - long[] copiedItems = new long[itemsCount]; - - // Act - list.CopyTo(copiedItems); - - // Validate - long[] expectedData = new long[itemsCount]; - testData.ToList().CopyTo(expectedData); - - _ = copiedItems.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void DisposeShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, int itemsCount) - { - //* Disposing empty list is tested in . - if (itemsCount == 0) - { - return; - } - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var listArray = list.AsArray; - _ = list.AsArray[..itemsCount].Should().NotBeNull(); - _ = listArray[..itemsCount].Should().AllSatisfy(x => x.Should().NotBeNull()); - - // Act - list.Dispose(); - - // Validate - _ = listArray[..itemsCount].Should().AllSatisfy(x => x.Should().BeNull()); - } - - [Fact] - public void DisposeShouldReturnPooledArrayOnlyOnce() - { - // Prepare - var testData = RecyclableLongListTestData.CreateTestData(RecyclableDefaults.MinPooledArrayLength); - using RecyclableList firstInstance = new(testData); - var firstArray = firstInstance.AsArray; - - // Act - firstInstance.Dispose(); - - // Validate - using RecyclableList sameInstance = new(testData); - _ = sameInstance.AsArray.Should().BeSameAs(firstArray); - - using RecyclableList anotherInstance = new(testData); - _ = anotherInstance.AsArray.Should().NotBeSameAs(firstArray); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void DisposeShouldSucceed(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - - // Act - list.Dispose(); - - // Validate - _ = list.Capacity.Should().Be(0); - _ = list.Count.Should().Be(0); - _ = list.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void EnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - using var enumerator = list.GetEnumerator(); - var yieldedItems = new List(itemsCount); - - // Act - while (enumerator.MoveNext()) - { - yieldedItems.Add(enumerator.Current); - } - - // Validate - List expectedData = new(testData); - - _ = yieldedItems.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ExistsShouldFindAllItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.Exists(item => item == expectedItem); - - // Act - var actual = list.Exists(item => item == expectedItem); - - // Validate - _ = actual.Should().Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ExistsShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.Exists(item => item == -expectedItem); - - // Act - var actual = list.Exists(item => item == -expectedItem); - - // Validate - _ = actual.Should().Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindAllIndexesShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - //* There is no equivalent of .FindAllIndexes in List, so no comparison here. - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - - foreach (var itemIndex in itemIndexes) - { - // Act - using var actual = list.FindAllIndexes(item => item == itemIndex + 1); - - // Validate - _ = actual.Count.Should().Be(1); - if (itemsCount > 0) - { - _ = actual.Count.Should().Be(1); - _ = actual.Should().AllSatisfy(x => x.Should().Be((int)itemIndex)); - } - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void FindAllShouldReturnCorrectIndexes(int itemsCount) - { - const int expectedItem = 1; - - // Prepare - var testData = Enumerable.Range(0, itemsCount).Select(value => value % 2 == 0 ? expectedItem : -expectedItem); - using var list = new RecyclableList(testData, itemsCount); - - // Act - using var actual = list.FindAll(x => x == expectedItem); - - // Validate - var expectedData = testData.ToList().FindAll(x => x == expectedItem); - - _ = actual.Count.Should().Be(expectedData.Count); - _ = actual.Should().Equal(expectedData); - if (expectedData.Count > 0) - { - _ = actual.Should().AllSatisfy(x => x.Should().Be(expectedItem)).And.Equal(expectedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void FindAllShouldNotFindNonExistingItems(int itemsCount) - { - const int expectedItem = 1; - - // Prepare - var testData = Enumerable.Range(0, itemsCount).Select(_ => expectedItem); - using var list = new RecyclableList(testData, itemsCount); - - // Act - using var foundItems = list.FindAll(x => x == -expectedItem); - - // Validate - var expectedData = testData.ToList().FindAll(x => x == -expectedItem); - - _ = foundItems.Count.Should().Be(expectedData.Count); - _ = foundItems.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindIndexShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - - // Act - var actual = list.FindIndex(item => item == expectedItem); - - // Validate - var expected = expectedData.FindIndex(item => item == expectedItem); - - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindIndexShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.FindIndex((int)itemIndex, (int)(itemsCount - itemIndex), item => item == expectedItem); - - // Act - var actual = list.FindIndex((int)itemIndex, (int)(itemsCount - itemIndex), item => item == expectedItem); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindIndexShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.FindIndex(Math.Min(1, (int)itemIndex), item => item == expectedItem); - - // Act - var actual = list.FindIndex(Math.Min(1, (int)itemIndex), item => item == expectedItem); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindLastIndexShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.FindLastIndex(x => x == expectedItem); - - // Act - var actual = list.FindLastIndex(x => x == expectedItem); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindLastIndexShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - - // Act & Validate - var expected = expectedData.FindLastIndex(itemsCount - 1, itemsCount, x => x == expectedItem); - _ = list.FindLastIndex(itemsCount - 1, itemsCount, x => x == expectedItem).Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindLastIndexShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.FindLastIndex(itemsCount - 1, x => x == expectedItem); - - // Act - var actual = list.FindLastIndex(itemsCount - 1, x => x == expectedItem); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindLastIndexShouldThrowArgumentOutOfRange(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - int expected = int.MinValue; - - // Act & Validate - if (itemsCount - 1 != -1) - { - Assert.Throws(() => expected = expectedData.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem)); - Assert.Throws(() => _ = list.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem).Should().Be((int)itemIndex).And.Be(expected)); - } - else - { - expected = expectedData.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem); - _ = list.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem).Should().Be((int)itemIndex).And.Be(expected); - } - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindLastShouldReturnCorrectItem(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.FindLast(item => item == expectedItem); - - // Act - var actual = list.FindLast(item => item == expectedItem); - - // Validate - _ = actual.Should().Be(expectedData[(int)itemIndex]).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindShouldFindAllItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - long expectedItem = expectedData[(int)itemIndex]; - var expected = expectedData.Find(item => item == expectedItem); - - // Act - var actual = list.Find(item => item == expectedData[(int)itemIndex]); - - // Validate - _ = actual.Should().Be(expectedData[(int)itemIndex]); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void FindShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.Find(item => item == -expectedData[(int)itemIndex]); - - // Act - var actual = list.Find(item => item == -expectedData[(int)itemIndex]); - - // Validate - actual.Should().Be(0).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ForEachShouldGiveItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - var expected = new List(itemsCount); - expectedData.ForEach(expected.Add); - - // Act - var yieldedItems = new List(itemsCount); - list.ForEach(yieldedItems.Add); - - // Validate - _ = yieldedItems.Should().Equal(testData).And.Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ForEachShouldDoNothingWhenEmptyList(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - var expected = new List(itemsCount); - expectedData.ForEach(expected.Add); - - // Act - var yieldedItems = new List(itemsCount); - list.ForEach(item => yieldedItems.Add(item)); - - // Validate - _ = yieldedItems.Should().BeEmpty().And.Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void GetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var item in testData) - { - var expected = expectedData[(int)item - 1]; - - // Act - var actual = list[(int)item - 1]; - - // Validate - _ = actual.Should().Be(item).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void GetRangeShouldReturnCorrectItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - int startingIndex = (int)Math.Min(1, itemIndex); - var expectedRangeItems = expectedData.GetRange(startingIndex, (int)itemIndex); - - // Act - using var rangeItems = list.GetRange(startingIndex, (int)itemIndex); - - // Validate - _ = rangeItems.Count.Should().Be(expectedRangeItems.Count); - _ = rangeItems.Should().Equal(expectedRangeItems); - } - } - - [Fact] - public void IndexOfShouldNotFindAnythingWhenListEmpty() - { - // Prepare - using var list = new RecyclableList(); - - // Act & Validate - _ = list.IndexOf(-1).Should().Be(-1); - _ = list.IndexOf(0).Should().Be(-1); - _ = list.IndexOf(1).Should().Be(-1); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void IndexOfShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.IndexOf(-expectedData[(int)itemIndex]); - - // Act - var actual = list.IndexOf(-expectedData[(int)itemIndex]); - - // Validate - _ = actual.Should().Be(-1).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void IndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.IndexOf(expectedData[(int)itemIndex]); - - // Act - var actual = list.IndexOf(expectedData[(int)itemIndex]); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void IndexOfShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.IndexOf(expectedData[(int)itemIndex], (int)itemIndex, (int)(itemsCount - itemIndex)); - - // Act - var actual = list.IndexOf(expectedData[(int)itemIndex], (int)itemIndex, (int)(itemsCount - itemIndex)); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void IndexOfShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.IndexOf(expectedData[(int)itemIndex], (int)itemIndex); - - // Act - var actual = list.IndexOf(expectedData[(int)itemIndex], (int)itemIndex); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void LastIndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.LastIndexOf(expectedData[(int)itemIndex]); - - // Act - var actual = list.LastIndexOf(expectedData[(int)itemIndex]); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void LastIndexOfShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount); - - // Act - var actual = list.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void LastIndexOfShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - var expected = expectedData.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1); - - // Act - var actual = list.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1); - - // Validate - _ = actual.Should().Be((int)itemIndex).And.Be(expected); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void LastIndexOfShouldThrowArgumentOutOfRangeWhenCountTooBig(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = Assert.Throws(() => _ = expectedData.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount + 3).Should().Be((int)itemIndex)); - _ = Assert.Throws(() => _ = list.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount + 3).Should().Be((int)itemIndex)); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void InitializeSortClearAddRangeRemoveShouldSucceed(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - var expectedData = testData.ToList(); - var item = expectedData[(int)itemIndex]; - - // Act - using RecyclableList list = new(testData); - QuickSortExtensions.QuickSort(list); - - // Validate - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - - // Act - list.Clear(); - - // Validate - _ = list.Count.Should().Be(0); - _ = list.Should().BeEmpty(); - - // Act - list.AddRange(testData); - - // Validate - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(expectedData); - - // Prepare - expectedData.RemoveAt((int)itemIndex); - - // Act - _ = list.Remove(item).Should().BeTrue(); - _ = list.IndexOf(item).Should().Be(RecyclableDefaults.ItemNotFoundIndex); - _ = list.Contains(item).Should().BeFalse(); - _ = list.Count.Should().Be(itemsCount - 1); - _ = list.Should().Equal(expectedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void InsertShouldMoveItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedItems = list.ToList(); - var item = expectedItems[(int)itemIndex]; - expectedItems.Insert((int)itemIndex, item); - - // Act - list.Insert((int)itemIndex, item); - - // Validate - _ = list[(int)itemIndex].Should().Be(item); - _ = list[(int)itemIndex + 1].Should().Be(item); - _ = list.Count.Should().Be(itemsCount + 1); - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void InsertRangeShouldMoveItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData.Reverse(), itemsCount); - var expectedItems = testData.Reverse().ToList(); - var item = expectedItems[^1]; - expectedItems.InsertRange((int)itemIndex, testData); - - // Act - list.InsertRange((int)itemIndex, testData); - - // Validate - _ = list[(int)itemIndex].Should().Be(item); - _ = list.Count.Should().Be(itemsCount << 1); - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount << 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveAllShouldRemoveTheCorrectItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var itemsToRemove = itemIndexes.Select(x => list[(int)x]).ToArray(); - var expectedItems = testData.ToList(); - var expectedResult = expectedItems.RemoveAll(itemsToRemove.Contains); - - // Act - var actualResult = list.RemoveAll(itemsToRemove.Contains); - - // Validate - _ = actualResult.Should().Be(expectedResult); - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount - itemsToRemove.Length); - _ = list.Should().Equal(expectedItems); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveAtShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, int itemsCount, in long[] indexesToRemove) - { - // Prepare - foreach (int indexToRemove in indexesToRemove) - { - using var list = new RecyclableList(testData, itemsCount); - _ = list[^1].Should().NotBeNull(); - - // Act - list.RemoveAt(indexToRemove); - - // Validate - _ = list[list.Count].Should().BeNull(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveAtShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedItems = testData.ToList(); - expectedItems.RemoveAt((int)itemIndex); - - // Act - list.RemoveAt((int)itemIndex); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount - 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveRangeShouldRemoveCorrectItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - foreach (var itemIndex in itemIndexes) - { - // Prepare - int startingIndex = (int)Math.Min(1, itemIndex); - var expectedData = testData.ToList(); - expectedData.RemoveRange(startingIndex, (int)itemIndex); - - // Act - using var list = new RecyclableList(testData, itemsCount); - list.RemoveRange(startingIndex, (int)itemIndex); - - // Validate - _ = list.Count.Should().Be(expectedData.Count); - _ = list.Should().Equal(expectedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, int itemsCount, in long[] indexesToRemove) - { - - foreach (int indexToRemove in indexesToRemove) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedItems = testData.ToArray(); - var item = expectedItems[indexToRemove]; - _ = list[^1].Should().NotBeNull(); - - // Act - list.Remove(item); - - // Validate - _ = list[list.Count].Should().BeNull(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedItems = testData.ToList(); - var item = expectedItems[(int)itemIndex]; - var expected = expectedItems.Remove(item); - - // Act - var actual = list.Remove(item); - - // Validate - _ = actual.Should().BeTrue().And.Be(expected); - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(itemsCount - 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ReverseShouldSwapItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - expectedData.Reverse(); - - // Act - list.Reverse(); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ReverseShouldSwapItemsInCorrectOrderWhenConstrained(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - var expectedData = testData.ToArray(); - - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var startingItemIndex = (int)Math.Min(1, itemIndex); - var expectedRangeItems = expectedData.ToList(); - expectedRangeItems.Reverse(startingItemIndex, (int)itemIndex); - - // Act - list.Reverse(startingItemIndex, (int)itemIndex); - - // Validate - _ = list.Should().Equal(expectedRangeItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList(); - - // Act & Validate - foreach (long item in testData) - { - // Act - list[(int)item - 1] = item + 1; - - // Validate - expectedData[(int)item - 1] = item + 1; - _ = list[(int)item - 1].Should().Be(item + 1); - _ = list.Should().Equal(expectedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData.Reverse(), itemsCount); - var expectedData = testData.Reverse().ToList(); - expectedData.Sort(); - - // Act - list.Sort(); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrderWhenWithComparer(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData.Reverse(), itemsCount); - IComparer comparer = Comparer.Default; - var expectedData = testData.Reverse().ToList(); - expectedData.Sort(comparer); - - // Act - list.Sort(comparer); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrderWhenWithComparison(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData.Reverse(), itemsCount); - - static int comparison(long x, long y) - { - return (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0, - }; - } - - var expectedData = testData.Reverse().ToList(); - expectedData.Sort(comparison); - - // Act - list.Sort(comparison); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrderWhenConstrained(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - IComparer comparer = Comparer.Default; - var expectedData = testData.Reverse().ToArray(); - - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableList(testData.Reverse(), itemsCount); - var startingIndex = (int)Math.Min(1, itemIndex); - - var expectedSortedData = expectedData.ToList(); - expectedSortedData.Sort(startingIndex, (int)itemIndex, comparer); - - // Act - list.Sort(startingIndex, (int)itemIndex, comparer); - - // Validate - _ = list.Should().Equal(expectedSortedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ToArrayShouldReturnAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedData = testData.ToList().ToArray(); - - // Act - var returnedItems = list.ToArray(); - - // Validate - _ = returnedItems.Length.Should().Be(itemsCount); - _ = returnedItems.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldDecreaseCapacity(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedCapacity = itemsCount >= RecyclableDefaults.InitialCapacity ? itemsCount : RecyclableDefaults.InitialCapacity; - - // Act - list.TrimExcess(); - - // Validate - _ = list.Capacity.Should().Be(expectedCapacity); - _ = list.Count.Should().Be(itemsCount); - _ = list.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldNotBreakAdd(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)itemsCount + 1); - expectedCapacity = expectedCapacity >= RecyclableDefaults.InitialCapacity ? expectedCapacity : RecyclableDefaults.InitialCapacity; - - // Act - list.TrimExcess(); - list.Add(-1); - - // Validate - _ = list.Capacity.Should().Be(expectedCapacity); - _ = list.Count.Should().Be(itemsCount + 1); - _ = list.Should().Equal(testData.Append(-1)); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldNotBreakAddRange(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - var expectedCapacity = (int)BitOperations.RoundUpToPowerOf2(checked((uint)itemsCount << 1)); - expectedCapacity = expectedCapacity >= RecyclableDefaults.InitialCapacity ? expectedCapacity : RecyclableDefaults.InitialCapacity; - - // Act - list.TrimExcess(); - list.AddRange(testData); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedCapacity); - _ = list.Count.Should().Be(itemsCount << 1); - _ = list.Should().Equal(testData.Concat(testData)); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldNotBreakClear(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - - // Act - list.TrimExcess(); - list.Clear(); - - // Validate - _ = list.Capacity.Should().Be(Math.Max(RecyclableDefaults.InitialCapacity, itemsCount)); - _ = list.Count.Should().Be(0); - _ = list.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldNotBreakInsert(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - var expectedCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)itemsCount + 1); - expectedCapacity = expectedCapacity >= RecyclableDefaults.InitialCapacity ? expectedCapacity : RecyclableDefaults.InitialCapacity; - var expectedData = testData.ToArray(); - - foreach (var itemIndex in itemIndexes) - { - using var list = new RecyclableList(testData, itemsCount); - var expectedItemsAfterInsert = expectedData.ToList(); - expectedItemsAfterInsert.Insert((int)itemIndex, -3); - - // Act - list.TrimExcess(); - list.Insert((int)itemIndex, -3); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedCapacity); - _ = list.Count.Should().Be(expectedItemsAfterInsert.Count); - _ = list.Should().Equal(expectedItemsAfterInsert); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldNotBreakRemove(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - var expectedData = testData.ToArray(); - - foreach (var itemIndex in itemIndexes) - { - using var list = new RecyclableList(testData, itemsCount); - var expectedItemsAfterInsert = expectedData.ToList(); - expectedItemsAfterInsert.RemoveAt((int)itemIndex); - - // Act - list.TrimExcess(); - list.RemoveAt((int)itemIndex); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.Count.Should().Be(expectedItemsAfterInsert.Count); - _ = list.Should().Equal(expectedItemsAfterInsert); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimExcessShouldNotBreakIndexOf(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - var expectedData = testData.ToArray(); - - foreach (var itemIndex in itemIndexes) - { - using var list = new RecyclableList(testData, itemsCount); - - // Act - list.TrimExcess(); - var actual = list.IndexOf(expectedData[(int)itemIndex]); - - // Validate - _ = actual.Should().Be((int)itemIndex); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrimmedArraysShouldNotBePooled(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - - // Act - list.TrimExcess(); - var trimmedMemoryBlock = list._memoryBlock; - - list.Dispose(); - - // Validate - _ = list.Capacity.Should().Be(0); - _ = list.Count.Should().Be(0); - _ = list.Should().BeEmpty(); - - if (itemsCount >= RecyclableDefaults.MinPooledArrayLength) - { - var newMemoryBlock = RecyclableArrayPool.RentShared(itemsCount); - if (BitOperations.IsPow2(itemsCount)) - { - _ = newMemoryBlock.Should().BeSameAs(trimmedMemoryBlock); - } - else - { - _ = newMemoryBlock.Should().NotBeSameAs(trimmedMemoryBlock); - } - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrueForAllShouldBeFalseWhenNoMatch(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - var expectedData = testData.ToList(); - - foreach (var itemIndex in itemIndexes) - { - using RecyclableList list = new(testData, itemsCount); - Predicate condition = item => item == itemIndex; - var expected = expectedData.TrueForAll(condition); - - // Act - var actual = list.TrueForAll(condition); - - // Validate - _ = actual.Should().Be(expected).And.BeFalse(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void TrueForAllShouldBeTrueWhenMatched(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) - { - // Prepare - using RecyclableList list = new(testData, itemsCount); - int index = 0; - Predicate condition = item => item == ++index; - var expected = testData.ToList().TrueForAll(condition); - - index = 0; - - // Act - var actual = list.TrueForAll(condition); - - // Validate - _ = actual.Should().Be(expected).And.BeTrue(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void VersionedEnumerateShouldRaiseExceptionWhenCollectionIsModified(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - - // Act - _ = Assert.Throws(() => - { - list.Add(-1); - foreach (var item in (IRecyclableVersionedList)list) - { - list.Add(item); - } - }); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void VersionedEnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - // Prepare - using var list = new RecyclableList(testData, itemsCount); - - // Act - var yieldedItems = new List(itemsCount); - foreach (var item in (IRecyclableVersionedList)list) - { - yieldedItems.Add(item); - } - - // Validate - _ = yieldedItems.Should().Equal(testData); - } - } +using FluentAssertions; +using Recyclable.Collections; +using Recyclable.Collections.Linq; +using Recyclable.Collections.Pools; +using System.Collections; +using System.Numerics; + +#pragma warning disable xUnit1026, RCS1163, IDE0060, RCS1235 + +namespace Recyclable.CollectionsTests +{ + public class RecyclableListTests + { + [Fact] + public void AddRangeShouldAcceptNulls() + { + // Prepare + using var list = new RecyclableList(); + long?[] testData = new long?[] { null, default }; + + // Act + list.AddRange(testData); + + // Validate + List expectedData = new(); + expectedData.AddRange(testData); + + _ = list.Count.Should().Be(testData.Length); + _ = list.Should().HaveCount(testData.Length).And.AllSatisfy(x => x.Should().BeNull()).And.Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(); + + // Act + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = list.AddRange((IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new Span((long[])testData)); + } + else if (testData is long[] testDataArray) + { + list.AddRange(testDataArray); + } + else if (testData is List testDataList) + { + list.AddRange(testDataList); + } + else if (testData is RecyclableList testDataRecyclableList) + { + list.AddRange(testDataRecyclableList); + } + else if (testData is RecyclableLongList testDataRecyclableLongList) + { + list.AddRange(testDataRecyclableLongList); + } + else if (testData is IList testDataIList) + { + list.AddRange(testDataIList); + } + else if (testData is IEnumerable testDataIEnumerable) + { + list.AddRange(testDataIEnumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + // Validate + List expectedData = new(itemsCount); + expectedData.AddRange(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(); + + // Act + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = list.AddRange((IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new Span((long[])testData)); + } + else if (testData is long[] testDataArray) + { + list.AddRange(testDataArray); + } + else if (testData is List testDataList) + { + list.AddRange(testDataList); + } + else if (testData is RecyclableList testDataRecyclableList) + { + list.AddRange(testDataRecyclableList); + } + else if (testData is RecyclableLongList testDataRecyclableLongList) + { + list.AddRange(testDataRecyclableLongList); + } + else if (testData is IList testDataIList) + { + list.AddRange(testDataIList); + } + else if (testData is IEnumerable testDataIEnumerable) + { + list.AddRange(testDataIEnumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + // Validate + List expectedData = new(itemsCount); + expectedData.AddRange(testData); + + _ = list.Capacity.Should().Be(RecyclableDefaults.InitialCapacity); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(); + itemsCount = checked(itemsCount << 1); + + // Act + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((Array)testData); + list.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = list.AddRange((IEnumerable)testData); + _ = list.AddRange((IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IReadOnlyList)testData); + list.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + var readOnlySpan = new ReadOnlySpan((long[])testData); + list.AddRange(readOnlySpan); + list.AddRange(readOnlySpan); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + var readOnlySpan = new Span((long[])testData); + list.AddRange(readOnlySpan); + list.AddRange(readOnlySpan); + } + else if (testData is long[] testDataArray) + { + list.AddRange(testDataArray); + list.AddRange(testDataArray); + } + else if (testData is List testDataList) + { + list.AddRange(testDataList); + list.AddRange(testDataList); + } + else if (testData is RecyclableList testDataRecyclableList) + { + list.AddRange(testDataRecyclableList); + list.AddRange(testDataRecyclableList); + } + else if (testData is RecyclableLongList testDataRecyclableLongList) + { + list.AddRange(testDataRecyclableLongList); + list.AddRange(testDataRecyclableLongList); + } + else if (testData is IList testDataIList) + { + list.AddRange(testDataIList); + list.AddRange(testDataIList); + } + else if (testData is IEnumerable testDataIEnumerable) + { + list.AddRange(testDataIEnumerable); + list.AddRange(testDataIEnumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + // Validate + List expectedData = new(itemsCount); + expectedData.AddRange(testData); + expectedData.AddRange(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldAcceptDuplicates(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(); + testData = testData.Concat(testData.Reverse()); + itemsCount = checked(itemsCount << 1); + + // Act + foreach (var index in testData) + { + list.Add(index); + } + + // Validate + List expectedData = new(itemsCount); + expectedData.AddRange(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Fact] + public void AddShouldAcceptNulls() + { + // Prepare + long?[] testData = new long?[] { null, default }; + using var list = new RecyclableList(); + + // Act + foreach (var item in testData) + { + list.Add(item); + } + + // Validate + List expectedData = new(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.InitialCapacity); + _ = list.Should().AllSatisfy(x => x.Should().BeNull()).And.Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldAddItems(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(); + + // Act + foreach (var item in testData) + { + list.Add(item); + _ = list.Count.Should().Be((int)item); + } + + // Validate + var expectedData = testData.ToList(); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldAddItemWhenAfterAddRange(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(); + itemsCount = checked(itemsCount << 1); + + // Act + list.AddRange(testData); + foreach (var index in testData) + { + list.Add(index); + } + + // Validate + List expectedData = new(itemsCount); + expectedData.AddRange(testData); + expectedData.AddRange(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ClearShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, int itemsCount) + { + //* Clearing empty list is tested in . + if (itemsCount == 0) + { + return; + } + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + _ = list.AsArray[..itemsCount].Should().AllSatisfy(x => x.Should().NotBeNull()); + + // Act + list.Clear(); + + // Validate + _ = list.AsArray[..itemsCount].Should().AllSatisfy(x => x.Should().BeNull()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ClearShouldRemoveAllItems(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + _ = list.Count.Should().Be(itemsCount); + + // Act + list.Clear(); + list.Clear(); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(0); + _ = list.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConsecutiveDisposeShouldSucceed(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + list.Dispose(); + + // Act + list.Dispose(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConstructorShouldAcceptDuplicates(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + testData = testData.Concat(testData.Reverse()); + itemsCount = checked(itemsCount << 1); + + // Act + using var list = new RecyclableList(testData, itemsCount); + + // Validate + List expectedData = new(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConstructorSourceShouldInitializeList(string testCase, IEnumerable testData, int itemsCount) + { + // Act + using var list = new RecyclableList(testData, itemsCount); + + // Validate + List expectedData = new(testData); + + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ContainsShouldFindAllItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + long expectedItem = expectedData[(int)itemIndex]; + bool expected = expectedData.Contains(expectedItem); + + // Act + var actual = list.Contains(expectedItem); + + // Validate + _ = actual.Should().Be(expected); + } + } + + [Fact] + public void ContainsShouldNotFindAnythingWhenListEmpty() + { + // Prepare + using var list = new RecyclableList(); + + // Validate + _ = list.Contains(0).Should().BeFalse(); + _ = list.Contains(1).Should().BeFalse(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ContainsShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + long expectedItem = -expectedData[(int)itemIndex]; + var expected = expectedData.Contains(expectedItem); + + // Act + var actual = list.Contains(expectedItem); + + // Validate + _ = actual.Should().Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConvertAllShouldConvertAllItems(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList().ConvertAll(item => item + 0.1); + + // Act + using var actual = list.ConvertAll(item => item + 0.1); + + // Validate + _ = actual.Count.Should().Be(itemsCount); + _ = actual.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void CopyToShouldCopyAllItemsInTheCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + long[] copiedItems = new long[itemsCount]; + + // Act + list.CopyTo(copiedItems, 0); + + // Validate + long[] expectedData = new long[itemsCount]; + testData.ToList().CopyTo(expectedData, 0); + + _ = copiedItems.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void CopyToShouldCopyAllItemsInTheCorrectOrderWhenFromStart(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + long[] copiedItems = new long[itemsCount]; + + // Act + list.CopyTo(copiedItems); + + // Validate + long[] expectedData = new long[itemsCount]; + testData.ToList().CopyTo(expectedData); + + _ = copiedItems.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void DisposeShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, int itemsCount) + { + //* Disposing empty list is tested in . + if (itemsCount == 0) + { + return; + } + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var listArray = list.AsArray; + _ = list.AsArray[..itemsCount].Should().NotBeNull(); + _ = listArray[..itemsCount].Should().AllSatisfy(x => x.Should().NotBeNull()); + + // Act + list.Dispose(); + + // Validate + _ = listArray[..itemsCount].Should().AllSatisfy(x => x.Should().BeNull()); + } + + [Fact] + public void DisposeShouldReturnPooledArrayOnlyOnce() + { + // Prepare + var testData = RecyclableLongListTestData.CreateTestData(RecyclableDefaults.MinPooledArrayLength); + using RecyclableList firstInstance = new(testData); + var firstArray = firstInstance.AsArray; + + // Act + firstInstance.Dispose(); + + // Validate + using RecyclableList sameInstance = new(testData); + _ = sameInstance.AsArray.Should().BeSameAs(firstArray); + + using RecyclableList anotherInstance = new(testData); + _ = anotherInstance.AsArray.Should().NotBeSameAs(firstArray); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void DisposeShouldSucceed(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + + // Act + list.Dispose(); + + // Validate + _ = list.Capacity.Should().Be(0); + _ = list.Count.Should().Be(0); + _ = list.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void EnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + using var enumerator = list.GetEnumerator(); + var yieldedItems = new List(itemsCount); + + // Act + while (enumerator.MoveNext()) + { + yieldedItems.Add(enumerator.Current); + } + + // Validate + List expectedData = new(testData); + + _ = yieldedItems.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ExistsShouldFindAllItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.Exists(item => item == expectedItem); + + // Act + var actual = list.Exists(item => item == expectedItem); + + // Validate + _ = actual.Should().Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ExistsShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.Exists(item => item == -expectedItem); + + // Act + var actual = list.Exists(item => item == -expectedItem); + + // Validate + _ = actual.Should().Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindAllIndexesShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + //* There is no equivalent of .FindAllIndexes in List, so no comparison here. + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + + foreach (var itemIndex in itemIndexes) + { + // Act + using var actual = list.FindAllIndexes(item => item == itemIndex + 1); + + // Validate + _ = actual.Count.Should().Be(1); + if (itemsCount > 0) + { + _ = actual.Count.Should().Be(1); + _ = actual.Should().AllSatisfy(x => x.Should().Be((int)itemIndex)); + } + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void FindAllShouldReturnCorrectIndexes(int itemsCount) + { + const int expectedItem = 1; + + // Prepare + var testData = Enumerable.Range(0, itemsCount).Select(value => value % 2 == 0 ? expectedItem : -expectedItem); + using var list = new RecyclableList(testData, itemsCount); + + // Act + using var actual = list.FindAll(x => x == expectedItem); + + // Validate + var expectedData = testData.ToList().FindAll(x => x == expectedItem); + + _ = actual.Count.Should().Be(expectedData.Count); + _ = actual.Should().Equal(expectedData); + if (expectedData.Count > 0) + { + _ = actual.Should().AllSatisfy(x => x.Should().Be(expectedItem)).And.Equal(expectedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void FindAllShouldNotFindNonExistingItems(int itemsCount) + { + const int expectedItem = 1; + + // Prepare + var testData = Enumerable.Range(0, itemsCount).Select(_ => expectedItem); + using var list = new RecyclableList(testData, itemsCount); + + // Act + using var foundItems = list.FindAll(x => x == -expectedItem); + + // Validate + var expectedData = testData.ToList().FindAll(x => x == -expectedItem); + + _ = foundItems.Count.Should().Be(expectedData.Count); + _ = foundItems.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindIndexShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + + // Act + var actual = list.FindIndex(item => item == expectedItem); + + // Validate + var expected = expectedData.FindIndex(item => item == expectedItem); + + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindIndexShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.FindIndex((int)itemIndex, (int)(itemsCount - itemIndex), item => item == expectedItem); + + // Act + var actual = list.FindIndex((int)itemIndex, (int)(itemsCount - itemIndex), item => item == expectedItem); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindIndexShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.FindIndex(Math.Min(1, (int)itemIndex), item => item == expectedItem); + + // Act + var actual = list.FindIndex(Math.Min(1, (int)itemIndex), item => item == expectedItem); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindLastIndexShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.FindLastIndex(x => x == expectedItem); + + // Act + var actual = list.FindLastIndex(x => x == expectedItem); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindLastIndexShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + + // Act & Validate + var expected = expectedData.FindLastIndex(itemsCount - 1, itemsCount, x => x == expectedItem); + _ = list.FindLastIndex(itemsCount - 1, itemsCount, x => x == expectedItem).Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindLastIndexShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.FindLastIndex(itemsCount - 1, x => x == expectedItem); + + // Act + var actual = list.FindLastIndex(itemsCount - 1, x => x == expectedItem); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindLastIndexShouldThrowArgumentOutOfRange(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + int expected = int.MinValue; + + // Act & Validate + if (itemsCount - 1 != -1) + { + Assert.Throws(() => expected = expectedData.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem)); + Assert.Throws(() => _ = list.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem).Should().Be((int)itemIndex).And.Be(expected)); + } + else + { + expected = expectedData.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem); + _ = list.FindLastIndex(itemsCount - 1, itemsCount + 3, x => x == expectedItem).Should().Be((int)itemIndex).And.Be(expected); + } + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindLastShouldReturnCorrectItem(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.FindLast(item => item == expectedItem); + + // Act + var actual = list.FindLast(item => item == expectedItem); + + // Validate + _ = actual.Should().Be(expectedData[(int)itemIndex]).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindShouldFindAllItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + long expectedItem = expectedData[(int)itemIndex]; + var expected = expectedData.Find(item => item == expectedItem); + + // Act + var actual = list.Find(item => item == expectedData[(int)itemIndex]); + + // Validate + _ = actual.Should().Be(expectedData[(int)itemIndex]); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void FindShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.Find(item => item == -expectedData[(int)itemIndex]); + + // Act + var actual = list.Find(item => item == -expectedData[(int)itemIndex]); + + // Validate + actual.Should().Be(0).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ForEachShouldGiveItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + var expected = new List(itemsCount); + expectedData.ForEach(expected.Add); + + // Act + var yieldedItems = new List(itemsCount); + list.ForEach(yieldedItems.Add); + + // Validate + _ = yieldedItems.Should().Equal(testData).And.Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ForEachShouldDoNothingWhenEmptyList(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + var expected = new List(itemsCount); + expectedData.ForEach(expected.Add); + + // Act + var yieldedItems = new List(itemsCount); + list.ForEach(item => yieldedItems.Add(item)); + + // Validate + _ = yieldedItems.Should().BeEmpty().And.Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void GetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var item in testData) + { + var expected = expectedData[(int)item - 1]; + + // Act + var actual = list[(int)item - 1]; + + // Validate + _ = actual.Should().Be(item).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void GetRangeShouldReturnCorrectItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + int startingIndex = (int)Math.Min(1, itemIndex); + var expectedRangeItems = expectedData.GetRange(startingIndex, (int)itemIndex); + + // Act + using var rangeItems = list.GetRange(startingIndex, (int)itemIndex); + + // Validate + _ = rangeItems.Count.Should().Be(expectedRangeItems.Count); + _ = rangeItems.Should().Equal(expectedRangeItems); + } + } + + [Fact] + public void IndexOfShouldNotFindAnythingWhenListEmpty() + { + // Prepare + using var list = new RecyclableList(); + + // Act & Validate + _ = list.IndexOf(-1).Should().Be(-1); + _ = list.IndexOf(0).Should().Be(-1); + _ = list.IndexOf(1).Should().Be(-1); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void IndexOfShouldNotFindNonExistingItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.IndexOf(-expectedData[(int)itemIndex]); + + // Act + var actual = list.IndexOf(-expectedData[(int)itemIndex]); + + // Validate + _ = actual.Should().Be(-1).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void IndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.IndexOf(expectedData[(int)itemIndex]); + + // Act + var actual = list.IndexOf(expectedData[(int)itemIndex]); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void IndexOfShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.IndexOf(expectedData[(int)itemIndex], (int)itemIndex, (int)(itemsCount - itemIndex)); + + // Act + var actual = list.IndexOf(expectedData[(int)itemIndex], (int)itemIndex, (int)(itemsCount - itemIndex)); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void IndexOfShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.IndexOf(expectedData[(int)itemIndex], (int)itemIndex); + + // Act + var actual = list.IndexOf(expectedData[(int)itemIndex], (int)itemIndex); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void LastIndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.LastIndexOf(expectedData[(int)itemIndex]); + + // Act + var actual = list.LastIndexOf(expectedData[(int)itemIndex]); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void LastIndexOfShouldReturnCorrectIndexesWhenConstrainedCount(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount); + + // Act + var actual = list.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void LastIndexOfShouldReturnCorrectIndexesWhenConstrainedIndex(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + var expected = expectedData.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1); + + // Act + var actual = list.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1); + + // Validate + _ = actual.Should().Be((int)itemIndex).And.Be(expected); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void LastIndexOfShouldThrowArgumentOutOfRangeWhenCountTooBig(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = Assert.Throws(() => _ = expectedData.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount + 3).Should().Be((int)itemIndex)); + _ = Assert.Throws(() => _ = list.LastIndexOf(expectedData[(int)itemIndex], itemsCount - 1, itemsCount + 3).Should().Be((int)itemIndex)); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void InitializeSortClearAddRangeRemoveShouldSucceed(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + var expectedData = testData.ToList(); + var item = expectedData[(int)itemIndex]; + + // Act + using RecyclableList list = new(testData); + QuickSortExtensions.QuickSort(list); + + // Validate + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + + // Act + list.Clear(); + + // Validate + _ = list.Count.Should().Be(0); + _ = list.Should().BeEmpty(); + + // Act + list.AddRange(testData); + + // Validate + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(expectedData); + + // Prepare + expectedData.RemoveAt((int)itemIndex); + + // Act + _ = list.Remove(item).Should().BeTrue(); + _ = list.IndexOf(item).Should().Be(RecyclableDefaults.ItemNotFoundIndex); + _ = list.Contains(item).Should().BeFalse(); + _ = list.Count.Should().Be(itemsCount - 1); + _ = list.Should().Equal(expectedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void InsertShouldMoveItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedItems = list.ToList(); + var item = expectedItems[(int)itemIndex]; + expectedItems.Insert((int)itemIndex, item); + + // Act + list.Insert((int)itemIndex, item); + + // Validate + _ = list[(int)itemIndex].Should().Be(item); + _ = list[(int)itemIndex + 1].Should().Be(item); + _ = list.Count.Should().Be(itemsCount + 1); + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void InsertRangeShouldMoveItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData.Reverse(), itemsCount); + var expectedItems = testData.Reverse().ToList(); + var item = expectedItems[^1]; + expectedItems.InsertRange((int)itemIndex, testData); + + // Act + list.InsertRange((int)itemIndex, testData); + + // Validate + _ = list[(int)itemIndex].Should().Be(item); + _ = list.Count.Should().Be(itemsCount << 1); + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount << 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveAllShouldRemoveTheCorrectItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var itemsToRemove = itemIndexes.Select(x => list[(int)x]).ToArray(); + var expectedItems = testData.ToList(); + var expectedResult = expectedItems.RemoveAll(itemsToRemove.Contains); + + // Act + var actualResult = list.RemoveAll(itemsToRemove.Contains); + + // Validate + _ = actualResult.Should().Be(expectedResult); + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount - itemsToRemove.Length); + _ = list.Should().Equal(expectedItems); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveAtShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, int itemsCount, in long[] indexesToRemove) + { + // Prepare + foreach (int indexToRemove in indexesToRemove) + { + using var list = new RecyclableList(testData, itemsCount); + _ = list[^1].Should().NotBeNull(); + + // Act + list.RemoveAt(indexToRemove); + + // Validate + _ = list[list.Count].Should().BeNull(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveAtShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedItems = testData.ToList(); + expectedItems.RemoveAt((int)itemIndex); + + // Act + list.RemoveAt((int)itemIndex); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount - 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveRangeShouldRemoveCorrectItems(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + foreach (var itemIndex in itemIndexes) + { + // Prepare + int startingIndex = (int)Math.Min(1, itemIndex); + var expectedData = testData.ToList(); + expectedData.RemoveRange(startingIndex, (int)itemIndex); + + // Act + using var list = new RecyclableList(testData, itemsCount); + list.RemoveRange(startingIndex, (int)itemIndex); + + // Validate + _ = list.Count.Should().Be(expectedData.Count); + _ = list.Should().Equal(expectedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, int itemsCount, in long[] indexesToRemove) + { + + foreach (int indexToRemove in indexesToRemove) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedItems = testData.ToArray(); + var item = expectedItems[indexToRemove]; + _ = list[^1].Should().NotBeNull(); + + // Act + list.Remove(item); + + // Validate + _ = list[list.Count].Should().BeNull(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, int itemsCount, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedItems = testData.ToList(); + var item = expectedItems[(int)itemIndex]; + var expected = expectedItems.Remove(item); + + // Act + var actual = list.Remove(item); + + // Validate + _ = actual.Should().BeTrue().And.Be(expected); + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(itemsCount - 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ReverseShouldSwapItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + expectedData.Reverse(); + + // Act + list.Reverse(); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ReverseShouldSwapItemsInCorrectOrderWhenConstrained(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + var expectedData = testData.ToArray(); + + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var startingItemIndex = (int)Math.Min(1, itemIndex); + var expectedRangeItems = expectedData.ToList(); + expectedRangeItems.Reverse(startingItemIndex, (int)itemIndex); + + // Act + list.Reverse(startingItemIndex, (int)itemIndex); + + // Validate + _ = list.Should().Equal(expectedRangeItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList(); + + // Act & Validate + foreach (long item in testData) + { + // Act + list[(int)item - 1] = item + 1; + + // Validate + expectedData[(int)item - 1] = item + 1; + _ = list[(int)item - 1].Should().Be(item + 1); + _ = list.Should().Equal(expectedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData.Reverse(), itemsCount); + var expectedData = testData.Reverse().ToList(); + expectedData.Sort(); + + // Act + list.Sort(); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrderWhenWithComparer(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData.Reverse(), itemsCount); + IComparer comparer = Comparer.Default; + var expectedData = testData.Reverse().ToList(); + expectedData.Sort(comparer); + + // Act + list.Sort(comparer); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrderWhenWithComparison(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData.Reverse(), itemsCount); + + static int comparison(long x, long y) + { + return (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0, + }; + } + + var expectedData = testData.Reverse().ToList(); + expectedData.Sort(comparison); + + // Act + list.Sort(comparison); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrderWhenConstrained(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + IComparer comparer = Comparer.Default; + var expectedData = testData.Reverse().ToArray(); + + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableList(testData.Reverse(), itemsCount); + var startingIndex = (int)Math.Min(1, itemIndex); + + var expectedSortedData = expectedData.ToList(); + expectedSortedData.Sort(startingIndex, (int)itemIndex, comparer); + + // Act + list.Sort(startingIndex, (int)itemIndex, comparer); + + // Validate + _ = list.Should().Equal(expectedSortedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ToArrayShouldReturnAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedData = testData.ToList().ToArray(); + + // Act + var returnedItems = list.ToArray(); + + // Validate + _ = returnedItems.Length.Should().Be(itemsCount); + _ = returnedItems.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldDecreaseCapacity(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedCapacity = itemsCount >= RecyclableDefaults.InitialCapacity ? itemsCount : RecyclableDefaults.InitialCapacity; + + // Act + list.TrimExcess(); + + // Validate + _ = list.Capacity.Should().Be(expectedCapacity); + _ = list.Count.Should().Be(itemsCount); + _ = list.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldNotBreakAdd(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)itemsCount + 1); + expectedCapacity = expectedCapacity >= RecyclableDefaults.InitialCapacity ? expectedCapacity : RecyclableDefaults.InitialCapacity; + + // Act + list.TrimExcess(); + list.Add(-1); + + // Validate + _ = list.Capacity.Should().Be(expectedCapacity); + _ = list.Count.Should().Be(itemsCount + 1); + _ = list.Should().Equal(testData.Append(-1)); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldNotBreakAddRange(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + var expectedCapacity = (int)BitOperations.RoundUpToPowerOf2(checked((uint)itemsCount << 1)); + expectedCapacity = expectedCapacity >= RecyclableDefaults.InitialCapacity ? expectedCapacity : RecyclableDefaults.InitialCapacity; + + // Act + list.TrimExcess(); + list.AddRange(testData); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedCapacity); + _ = list.Count.Should().Be(itemsCount << 1); + _ = list.Should().Equal(testData.Concat(testData)); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldNotBreakClear(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + + // Act + list.TrimExcess(); + list.Clear(); + + // Validate + _ = list.Capacity.Should().Be(Math.Max(RecyclableDefaults.InitialCapacity, itemsCount)); + _ = list.Count.Should().Be(0); + _ = list.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldNotBreakInsert(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + var expectedCapacity = (int)BitOperations.RoundUpToPowerOf2((uint)itemsCount + 1); + expectedCapacity = expectedCapacity >= RecyclableDefaults.InitialCapacity ? expectedCapacity : RecyclableDefaults.InitialCapacity; + var expectedData = testData.ToArray(); + + foreach (var itemIndex in itemIndexes) + { + using var list = new RecyclableList(testData, itemsCount); + var expectedItemsAfterInsert = expectedData.ToList(); + expectedItemsAfterInsert.Insert((int)itemIndex, -3); + + // Act + list.TrimExcess(); + list.Insert((int)itemIndex, -3); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedCapacity); + _ = list.Count.Should().Be(expectedItemsAfterInsert.Count); + _ = list.Should().Equal(expectedItemsAfterInsert); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldNotBreakRemove(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + var expectedData = testData.ToArray(); + + foreach (var itemIndex in itemIndexes) + { + using var list = new RecyclableList(testData, itemsCount); + var expectedItemsAfterInsert = expectedData.ToList(); + expectedItemsAfterInsert.RemoveAt((int)itemIndex); + + // Act + list.TrimExcess(); + list.RemoveAt((int)itemIndex); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.Count.Should().Be(expectedItemsAfterInsert.Count); + _ = list.Should().Equal(expectedItemsAfterInsert); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimExcessShouldNotBreakIndexOf(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + var expectedData = testData.ToArray(); + + foreach (var itemIndex in itemIndexes) + { + using var list = new RecyclableList(testData, itemsCount); + + // Act + list.TrimExcess(); + var actual = list.IndexOf(expectedData[(int)itemIndex]); + + // Validate + _ = actual.Should().Be((int)itemIndex); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrimmedArraysShouldNotBePooled(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + + // Act + list.TrimExcess(); + var trimmedMemoryBlock = list._memoryBlock; + + list.Dispose(); + + // Validate + _ = list.Capacity.Should().Be(0); + _ = list.Count.Should().Be(0); + _ = list.Should().BeEmpty(); + + if (itemsCount >= RecyclableDefaults.MinPooledArrayLength) + { + var newMemoryBlock = RecyclableArrayPool.RentShared(itemsCount); + if (BitOperations.IsPow2(itemsCount)) + { + _ = newMemoryBlock.Should().BeSameAs(trimmedMemoryBlock); + } + else + { + _ = newMemoryBlock.Should().NotBeSameAs(trimmedMemoryBlock); + } + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrueForAllShouldBeFalseWhenNoMatch(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + var expectedData = testData.ToList(); + + foreach (var itemIndex in itemIndexes) + { + using RecyclableList list = new(testData, itemsCount); + Predicate condition = item => item == itemIndex; + var expected = expectedData.TrueForAll(condition); + + // Act + var actual = list.TrueForAll(condition); + + // Validate + _ = actual.Should().Be(expected).And.BeFalse(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void TrueForAllShouldBeTrueWhenMatched(string testCase, IEnumerable testData, int itemsCount, long[] itemIndexes) + { + // Prepare + using RecyclableList list = new(testData, itemsCount); + int index = 0; + Predicate condition = item => item == ++index; + var expected = testData.ToList().TrueForAll(condition); + + index = 0; + + // Act + var actual = list.TrueForAll(condition); + + // Validate + _ = actual.Should().Be(expected).And.BeTrue(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void VersionedEnumerateShouldRaiseExceptionWhenCollectionIsModified(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + + // Act + _ = Assert.Throws(() => + { + list.Add(-1); + foreach (var item in (IRecyclableVersionedList)list) + { + list.Add(item); + } + }); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void VersionedEnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + // Prepare + using var list = new RecyclableList(testData, itemsCount); + + // Act + var yieldedItems = new List(itemsCount); + foreach (var item in (IRecyclableVersionedList)list) + { + yieldedItems.Add(item); + } + + // Validate + _ = yieldedItems.Should().Equal(testData); + } + } } \ No newline at end of file diff --git a/Recyclable.CollectionsTests/RecyclableLongListTestData.cs b/Recyclable.CollectionsTests/RecyclableLongListTestData.cs index a9f5a30..c6c5fe1 100644 --- a/Recyclable.CollectionsTests/RecyclableLongListTestData.cs +++ b/Recyclable.CollectionsTests/RecyclableLongListTestData.cs @@ -1,282 +1,282 @@ -using MoreLinq; -using Open.Numeric.Primes; -using Recyclable.Collections; -using System.Numerics; - -namespace Recyclable.CollectionsTests -{ - public static class RecyclableLongListTestData - { - - private static readonly object[] _sourceRefData = Enumerable.Range(1, 100).Cast().ToArray(); - public static object[] SourceRefData => _sourceRefData; - - public static IEnumerable CreateTestData(long itemsCount) - { - for (long index = 1; index <= itemsCount; index++) - { - yield return index; - } - } - - public static IEnumerable CreateRefTestData(long itemsCount) - { - for (long index = 1; index <= itemsCount; index++) - { - yield return index; - } - } - - public static readonly IEnumerable ItemsCountVariants = new long[] - { - //RecyclableDefaults.MinPooledArrayLength - 5, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinPooledArrayLength + 1, RecyclableDefaults.MinPooledArrayLength + 5, 127, 128, 129, RecyclableDefaults.MinItemsCountForParallelization - 0, 1, 2, 3, 7, 10, 16, RecyclableDefaults.MinPooledArrayLength - 5, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinPooledArrayLength + 1, RecyclableDefaults.MinPooledArrayLength + 5, RecyclableDefaults.MinPooledArrayLength * 100 - }; - - public static readonly IEnumerable ItemsCountTestCases = ItemsCountVariants.Select(x => new object[] { (int)x }); - - public static readonly IEnumerable BlockSizeVariants = new int[] - { - 1, 2, 4, 16, RecyclableDefaults.MinPooledArrayLength - 5, (int)BitOperations.RoundUpToPowerOf2(RecyclableDefaults.MinPooledArrayLength) - }; - - private static bool IsValidBlockSize(long itemsCount, long blockSize) => itemsCount is < 1024 || blockSize is > 8; - - private static IEnumerable GetTargetDataVariants() - { - foreach (var itemsCount in ItemsCountVariants) - { - foreach (var targetBlockSize in BlockSizeVariants) - { - if (!IsValidBlockSize(itemsCount, targetBlockSize)) - { - continue; - } - - yield return new object[] { itemsCount, targetBlockSize }; - } - } - } - - public static IEnumerable TargetDataVariants => GetTargetDataVariants(); - - private static IEnumerable CombineSourceDataWithBlockSize(IEnumerable sourceData) - { - foreach (var testData in sourceData) - { - foreach (var targetBlockSize in BlockSizeVariants) - { - if (!IsValidBlockSize((long)testData[2], targetBlockSize)) - { - continue; - } - - yield return new object[] { testData[0], testData[1], testData[2], targetBlockSize }; - } - } - } - - private static IEnumerable CreateSourceDataVariants(long itemsCount, bool refType) - { - GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); - - switch (refType) - { - case false: - long[] testData = CreateTestData(itemsCount).ToArray(); - - yield return new object[] { $"Array[{itemsCount}]", testData, itemsCount }; - yield return new object[] { $"ICollection[{itemsCount}]", testData, itemsCount }; - yield return new object[] { $"ICollection[{itemsCount}]", testData, itemsCount }; - yield return new object[] { $"IEnumerable[{itemsCount}]", testData, itemsCount }; - yield return new object[] { $"IEnumerable[{itemsCount}] without non-enumerated count", new EnumerableWithoutCount(testData), itemsCount }; - yield return new object[] { $"IList[{itemsCount}]", new CustomIList(testData), itemsCount }; - yield return new object[] { $"IReadOnlyList[{itemsCount}])", testData, itemsCount }; - yield return new object[] { $"List[{itemsCount}]", testData.ToList(), itemsCount }; - yield return new object[] { $"ReadOnlySpan[{itemsCount}]", testData, itemsCount }; - yield return new object[] { $"RecyclableList[{itemsCount}]", testData.ToRecyclableList(), itemsCount }; - - foreach (var sourceBlockSize in BlockSizeVariants) - { - if (!IsValidBlockSize(itemsCount, sourceBlockSize)) - { - continue; - } - - yield return new object[] - { - $"RecyclableLongList[itemsCount: {itemsCount}, minBlockSize: {sourceBlockSize}]", - testData.ToRecyclableLongList(sourceBlockSize), - itemsCount - }; - } - - yield return new object[] { $"Span[{itemsCount}]", testData, itemsCount }; - yield return new object[] { $"T[{itemsCount}]", testData, itemsCount }; - break; - - case true: - IEnumerable testRefData = CreateRefTestData(itemsCount).ToArray(); - - yield return new object[] { $"Array[{itemsCount}]", testRefData, itemsCount }; - yield return new object[] { $"ICollection(itemsCount: {itemsCount}", testRefData, itemsCount }; - yield return new object[] { $"ICollection(itemsCount: {itemsCount}", testRefData, itemsCount }; - yield return new object[] { $"IEnumerable(itemsCount: {itemsCount})", testRefData, itemsCount }; - yield return new object[] { $"IEnumerable(itemsCount: {itemsCount}) without non-enumerated count", new EnumerableWithoutCount(testRefData), itemsCount }; - yield return new object[] { $"IList(itemsCount: {itemsCount})", new CustomIList(testRefData), itemsCount }; - yield return new object[] { $"IReadOnlyList(itemsCount: {itemsCount})", testRefData, itemsCount }; - yield return new object[] { $"List(itemsCount: {itemsCount}", testRefData.ToList(), itemsCount }; - yield return new object[] { $"ReadOnlySpan[{itemsCount}]", testRefData, itemsCount }; - yield return new object[] { $"RecyclableList(itemsCount: {itemsCount})", testRefData.ToRecyclableList(), itemsCount }; - - foreach (var sourceBlockSize in BlockSizeVariants) - { - if (!IsValidBlockSize(itemsCount, sourceBlockSize)) - { - continue; - } - - yield return new object[] - { - $"RecyclableLongList(itemsCount: {itemsCount}, minBlockSize: {sourceBlockSize})", - testRefData.ToRecyclableLongList(sourceBlockSize), - itemsCount - }; - } - - yield return new object[] { $"Span[{itemsCount}]", testRefData, itemsCount }; - yield return new object[] { $"T[{itemsCount}]", testRefData, itemsCount }; - break; - } - } - - private static IEnumerable CreateSourceDataVariants(bool refType) - { - foreach (var itemsCount in ItemsCountVariants) - { - foreach (var variant in CreateSourceDataVariants(itemsCount, refType)) - { - yield return variant; - } - } - } - - public static IEnumerable EmptySourceDataVariants => CreateSourceDataVariants(0, false); - public static IEnumerable SourceDataVariants => CreateSourceDataVariants(false); - public static IEnumerable SourceDataWithItemIndexVariants - { - get - { - foreach (var testCase in CreateSourceDataVariants(false).Where(testCase => (long)testCase[2] > 0)) - { - var itemIndexes = CreateItemIndexVariants((long)testCase[2], RecyclableDefaults.BlockSize).ToArray(); - yield return new object[] { testCase[0], testCase[1], testCase[2], itemIndexes }; - } - } - } - - public static IEnumerable SourceRefDataWithItemIndexVariants - { - get - { - IEnumerable testCases = CreateSourceDataVariants(true).Where(testCase => (long)testCase[2] > 0); - foreach (var testCase in testCases) - { - var itemIndexes = CreateItemIndexVariants((long)testCase[2], RecyclableDefaults.BlockSize).ToArray(); - - yield return new object[] { testCase[0], testCase[1], testCase[2], itemIndexes }; - } - } - } - - public static IEnumerable SourceDataWithBlockSizeVariants => CombineSourceDataWithBlockSize(SourceDataVariants); - public static IEnumerable SourceRefDataVariants => CreateSourceDataVariants(true); - public static IEnumerable SourceRefDataWithBlockSizeVariants { get; } = CombineSourceDataWithBlockSize(SourceRefDataVariants); - - private static IEnumerable _initialItemIndexVariants => new long[] { 0, 1, 2, 3, 4, 5 }; - private static IEnumerable CreateItemIndexVariants(long itemsCount, int blockSize) - { - IEnumerable primes = _initialItemIndexVariants.Concat( - _initialItemIndexVariants.SelectMany(index => new long[] { blockSize - index, blockSize + index }) - //new long[] { blockSize - 3, blockSize - 2, blockSize - 1, blockSize, blockSize + 1, blockSize + 2, blockSize + 3 } - ).ToArray(); - - IEnumerable second = Prime.Numbers.StartingAt(7) - .TakeUntil(prime => - prime > ((blockSize * 2) - 1) || - prime >= itemsCount - ); - - primes = primes.Concat(second).ToArray(); - - primes = primes.Concat( - primes.Select(index => itemsCount - index - 1) - ) - .Where(index => itemsCount > 0 && index >= 0 && index < itemsCount).ToArray() - .Distinct().ToArray(); - - return primes; - - //IEnumerable CreateItemIndexVariants() - //{ - //if (itemsCount > 0) - //{ - // yield return 0; - //} - - //foreach (long prime in primes) - //{ - // yield return prime; - - // long index = itemsCount - prime; - // if (index >= 0) - // { - // yield return index; - // } - //} - - //for (long index = itemsCount - (blockSize * 2) - 1; index < itemsCount; index++) - //{ - // if (index >= 0) - // { - // yield return index; - // } - //} - - //if ((blockSize / 16 * 16) + 1 < itemsCount) - //{ - // yield return (blockSize / 16 * 16) + 1; - //} - //} - - //return CreateItemIndexVariants(); - } - - public static IEnumerable CombineSourceRefDataWithBlockSizeWithItemIndex(bool refType) - { - IEnumerable sourceData = refType switch - { - false => SourceDataWithBlockSizeVariants, - true => SourceRefDataWithBlockSizeVariants - }; - - foreach (var testCase in sourceData) - { - long itemsCount = (long)testCase[2]; - if (itemsCount == 0) - { - continue; - } - - long[] itemIndexes = CreateItemIndexVariants(itemsCount, (int)testCase[3]) - .Where(_ => IsValidBlockSize((long)testCase[2], (int)testCase[3])) - .ToArray(); - - yield return new object[] { testCase[0], testCase[1], (long)testCase[2], (int)testCase[3], itemIndexes }; - } - } - - public static IEnumerable SourceDataWithBlockSizeWithItemIndexVariants { get; } = CombineSourceRefDataWithBlockSizeWithItemIndex(false); - public static IEnumerable SourceRefDataWithBlockSizeWithItemIndexVariants { get; } = CombineSourceRefDataWithBlockSizeWithItemIndex(true); - } +using MoreLinq; +using Open.Numeric.Primes; +using Recyclable.Collections; +using System.Numerics; + +namespace Recyclable.CollectionsTests +{ + public static class RecyclableLongListTestData + { + + private static readonly object[] _sourceRefData = Enumerable.Range(1, 100).Cast().ToArray(); + public static object[] SourceRefData => _sourceRefData; + + public static IEnumerable CreateTestData(long itemsCount) + { + for (long index = 1; index <= itemsCount; index++) + { + yield return index; + } + } + + public static IEnumerable CreateRefTestData(long itemsCount) + { + for (long index = 1; index <= itemsCount; index++) + { + yield return index; + } + } + + public static readonly IEnumerable ItemsCountVariants = new long[] + { + //RecyclableDefaults.MinPooledArrayLength - 5, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinPooledArrayLength + 1, RecyclableDefaults.MinPooledArrayLength + 5, 127, 128, 129, RecyclableDefaults.MinItemsCountForParallelization + 0, 1, 2, 3, 7, 10, 16, RecyclableDefaults.MinPooledArrayLength - 5, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinPooledArrayLength + 1, RecyclableDefaults.MinPooledArrayLength + 5, RecyclableDefaults.MinPooledArrayLength * 100 + }; + + public static readonly IEnumerable ItemsCountTestCases = ItemsCountVariants.Select(x => new object[] { (int)x }); + + public static readonly IEnumerable BlockSizeVariants = new int[] + { + 1, 2, 4, 16, RecyclableDefaults.MinPooledArrayLength - 5, (int)BitOperations.RoundUpToPowerOf2(RecyclableDefaults.MinPooledArrayLength) + }; + + private static bool IsValidBlockSize(long itemsCount, long blockSize) => itemsCount is < 1024 || blockSize is > 8; + + private static IEnumerable GetTargetDataVariants() + { + foreach (var itemsCount in ItemsCountVariants) + { + foreach (var targetBlockSize in BlockSizeVariants) + { + if (!IsValidBlockSize(itemsCount, targetBlockSize)) + { + continue; + } + + yield return new object[] { itemsCount, targetBlockSize }; + } + } + } + + public static IEnumerable TargetDataVariants => GetTargetDataVariants(); + + private static IEnumerable CombineSourceDataWithBlockSize(IEnumerable sourceData) + { + foreach (var testData in sourceData) + { + foreach (var targetBlockSize in BlockSizeVariants) + { + if (!IsValidBlockSize((long)testData[2], targetBlockSize)) + { + continue; + } + + yield return new object[] { testData[0], testData[1], testData[2], targetBlockSize }; + } + } + } + + private static IEnumerable CreateSourceDataVariants(long itemsCount, bool refType) + { + GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); + + switch (refType) + { + case false: + long[] testData = CreateTestData(itemsCount).ToArray(); + + yield return new object[] { $"Array[{itemsCount}]", testData, itemsCount }; + yield return new object[] { $"ICollection[{itemsCount}]", testData, itemsCount }; + yield return new object[] { $"ICollection[{itemsCount}]", testData, itemsCount }; + yield return new object[] { $"IEnumerable[{itemsCount}]", testData, itemsCount }; + yield return new object[] { $"IEnumerable[{itemsCount}] without non-enumerated count", new EnumerableWithoutCount(testData), itemsCount }; + yield return new object[] { $"IList[{itemsCount}]", new CustomIList(testData), itemsCount }; + yield return new object[] { $"IReadOnlyList[{itemsCount}])", testData, itemsCount }; + yield return new object[] { $"List[{itemsCount}]", testData.ToList(), itemsCount }; + yield return new object[] { $"ReadOnlySpan[{itemsCount}]", testData, itemsCount }; + yield return new object[] { $"RecyclableList[{itemsCount}]", testData.ToRecyclableList(), itemsCount }; + + foreach (var sourceBlockSize in BlockSizeVariants) + { + if (!IsValidBlockSize(itemsCount, sourceBlockSize)) + { + continue; + } + + yield return new object[] + { + $"RecyclableLongList[itemsCount: {itemsCount}, minBlockSize: {sourceBlockSize}]", + testData.ToRecyclableLongList(sourceBlockSize), + itemsCount + }; + } + + yield return new object[] { $"Span[{itemsCount}]", testData, itemsCount }; + yield return new object[] { $"T[{itemsCount}]", testData, itemsCount }; + break; + + case true: + IEnumerable testRefData = CreateRefTestData(itemsCount).ToArray(); + + yield return new object[] { $"Array[{itemsCount}]", testRefData, itemsCount }; + yield return new object[] { $"ICollection(itemsCount: {itemsCount}", testRefData, itemsCount }; + yield return new object[] { $"ICollection(itemsCount: {itemsCount}", testRefData, itemsCount }; + yield return new object[] { $"IEnumerable(itemsCount: {itemsCount})", testRefData, itemsCount }; + yield return new object[] { $"IEnumerable(itemsCount: {itemsCount}) without non-enumerated count", new EnumerableWithoutCount(testRefData), itemsCount }; + yield return new object[] { $"IList(itemsCount: {itemsCount})", new CustomIList(testRefData), itemsCount }; + yield return new object[] { $"IReadOnlyList(itemsCount: {itemsCount})", testRefData, itemsCount }; + yield return new object[] { $"List(itemsCount: {itemsCount}", testRefData.ToList(), itemsCount }; + yield return new object[] { $"ReadOnlySpan[{itemsCount}]", testRefData, itemsCount }; + yield return new object[] { $"RecyclableList(itemsCount: {itemsCount})", testRefData.ToRecyclableList(), itemsCount }; + + foreach (var sourceBlockSize in BlockSizeVariants) + { + if (!IsValidBlockSize(itemsCount, sourceBlockSize)) + { + continue; + } + + yield return new object[] + { + $"RecyclableLongList(itemsCount: {itemsCount}, minBlockSize: {sourceBlockSize})", + testRefData.ToRecyclableLongList(sourceBlockSize), + itemsCount + }; + } + + yield return new object[] { $"Span[{itemsCount}]", testRefData, itemsCount }; + yield return new object[] { $"T[{itemsCount}]", testRefData, itemsCount }; + break; + } + } + + private static IEnumerable CreateSourceDataVariants(bool refType) + { + foreach (var itemsCount in ItemsCountVariants) + { + foreach (var variant in CreateSourceDataVariants(itemsCount, refType)) + { + yield return variant; + } + } + } + + public static IEnumerable EmptySourceDataVariants => CreateSourceDataVariants(0, false); + public static IEnumerable SourceDataVariants => CreateSourceDataVariants(false); + public static IEnumerable SourceDataWithItemIndexVariants + { + get + { + foreach (var testCase in CreateSourceDataVariants(false).Where(testCase => (long)testCase[2] > 0)) + { + var itemIndexes = CreateItemIndexVariants((long)testCase[2], RecyclableDefaults.BlockSize).ToArray(); + yield return new object[] { testCase[0], testCase[1], testCase[2], itemIndexes }; + } + } + } + + public static IEnumerable SourceRefDataWithItemIndexVariants + { + get + { + IEnumerable testCases = CreateSourceDataVariants(true).Where(testCase => (long)testCase[2] > 0); + foreach (var testCase in testCases) + { + var itemIndexes = CreateItemIndexVariants((long)testCase[2], RecyclableDefaults.BlockSize).ToArray(); + + yield return new object[] { testCase[0], testCase[1], testCase[2], itemIndexes }; + } + } + } + + public static IEnumerable SourceDataWithBlockSizeVariants => CombineSourceDataWithBlockSize(SourceDataVariants); + public static IEnumerable SourceRefDataVariants => CreateSourceDataVariants(true); + public static IEnumerable SourceRefDataWithBlockSizeVariants { get; } = CombineSourceDataWithBlockSize(SourceRefDataVariants); + + private static IEnumerable _initialItemIndexVariants => new long[] { 0, 1, 2, 3, 4, 5 }; + private static IEnumerable CreateItemIndexVariants(long itemsCount, int blockSize) + { + IEnumerable primes = _initialItemIndexVariants.Concat( + _initialItemIndexVariants.SelectMany(index => new long[] { blockSize - index, blockSize + index }) + //new long[] { blockSize - 3, blockSize - 2, blockSize - 1, blockSize, blockSize + 1, blockSize + 2, blockSize + 3 } + ).ToArray(); + + IEnumerable second = Prime.Numbers.StartingAt(7) + .TakeUntil(prime => + prime > ((blockSize * 2) - 1) || + prime >= itemsCount + ); + + primes = primes.Concat(second).ToArray(); + + primes = primes.Concat( + primes.Select(index => itemsCount - index - 1) + ) + .Where(index => itemsCount > 0 && index >= 0 && index < itemsCount).ToArray() + .Distinct().ToArray(); + + return primes; + + //IEnumerable CreateItemIndexVariants() + //{ + //if (itemsCount > 0) + //{ + // yield return 0; + //} + + //foreach (long prime in primes) + //{ + // yield return prime; + + // long index = itemsCount - prime; + // if (index >= 0) + // { + // yield return index; + // } + //} + + //for (long index = itemsCount - (blockSize * 2) - 1; index < itemsCount; index++) + //{ + // if (index >= 0) + // { + // yield return index; + // } + //} + + //if ((blockSize / 16 * 16) + 1 < itemsCount) + //{ + // yield return (blockSize / 16 * 16) + 1; + //} + //} + + //return CreateItemIndexVariants(); + } + + public static IEnumerable CombineSourceRefDataWithBlockSizeWithItemIndex(bool refType) + { + IEnumerable sourceData = refType switch + { + false => SourceDataWithBlockSizeVariants, + true => SourceRefDataWithBlockSizeVariants + }; + + foreach (var testCase in sourceData) + { + long itemsCount = (long)testCase[2]; + if (itemsCount == 0) + { + continue; + } + + long[] itemIndexes = CreateItemIndexVariants(itemsCount, (int)testCase[3]) + .Where(_ => IsValidBlockSize((long)testCase[2], (int)testCase[3])) + .ToArray(); + + yield return new object[] { testCase[0], testCase[1], (long)testCase[2], (int)testCase[3], itemIndexes }; + } + } + + public static IEnumerable SourceDataWithBlockSizeWithItemIndexVariants { get; } = CombineSourceRefDataWithBlockSizeWithItemIndex(false); + public static IEnumerable SourceRefDataWithBlockSizeWithItemIndexVariants { get; } = CombineSourceRefDataWithBlockSizeWithItemIndex(true); + } } \ No newline at end of file diff --git a/Recyclable.CollectionsTests/RecyclableLongListTests.cs b/Recyclable.CollectionsTests/RecyclableLongListTests.cs index ab129f9..b27d428 100644 --- a/Recyclable.CollectionsTests/RecyclableLongListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableLongListTests.cs @@ -1,1073 +1,1073 @@ -using FluentAssertions; -using Recyclable.Collections; -using Recyclable.Collections.Linq; -using System.Collections; -using System.Numerics; - -#pragma warning disable xUnit1026, RCS1163, IDE0060, RCS1235 - -namespace Recyclable.CollectionsTests -{ - public class RecyclableLongListTests - { - private static long CalculateExpectedCapacity(string testCase, long itemsCount, int targetBlockSize) - { - var expectedCapacity = (long)BitOperations.RoundUpToPowerOf2((uint)itemsCount + 1); - if (targetBlockSize > itemsCount) - { - expectedCapacity = ((itemsCount / targetBlockSize) + (itemsCount % targetBlockSize > 0 ? 1 : 0)) * targetBlockSize; - } - - return expectedCapacity; - } - - [Fact] - public void AddRangeShouldAcceptNulls() - { - // Prepare - using var list = new RecyclableLongList(); - - // Act - list.AddRange(new long?[] { null, default }); - - // Validate - _ = list.Should().HaveCount(2).And.AllSatisfy(x => x.Should().BeNull()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(minBlockSize: targetBlockSize); - - // Act - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new Span((long[])testData)); - } - else if (testData is long[] testDataArray) - { - list.AddRange(testDataArray); - } - else if (testData is List testDataList) - { - list.AddRange(testDataList); - } - else if (testData is RecyclableList testDataRecyclableList) - { - list.AddRange(testDataRecyclableList); - } - else if (testData is RecyclableLongList testDataRecyclableLongList) - { - list.AddRange(testDataRecyclableLongList); - } - else if (testData is IList testDataIList) - { - list.AddRange(testDataIList); - } - else if (testData is IEnumerable testDataIEnumerable) - { - list.AddRange(testDataIEnumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - // Validate - long expectedItemsCount = itemsCount; - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedItemsCount); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount / targetBlockSize) - (itemsCount % targetBlockSize != 0 ? 0 : 1)); - _ = list.LongCount.Should().Be(expectedItemsCount); - _ = list.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, long itemsCount) - { - // Prepare - using var list = new RecyclableLongList(); - - // Act - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange(new Span((long[])testData)); - } - else if (testData is long[] testDataArray) - { - list.AddRange(testDataArray); - } - else if (testData is List testDataList) - { - list.AddRange(testDataList); - } - else if (testData is RecyclableList testDataRecyclableList) - { - list.AddRange(testDataRecyclableList); - } - else if (testData is RecyclableLongList testDataRecyclableLongList) - { - list.AddRange(testDataRecyclableLongList); - } - else if (testData is IList testDataIList) - { - list.AddRange(testDataIList); - } - else if (testData is IEnumerable testDataIEnumerable) - { - list.AddRange(testDataIEnumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.InitialCapacity); - _ = list.LastBlockWithData.Should().Be(-1); - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(minBlockSize: targetBlockSize); - - // Act - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((Array)testData); - list.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((ICollection)testData); - list.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IEnumerable)testData); - list.AddRange((IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - list.AddRange((IReadOnlyList)testData); - list.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - var readOnlySpan = new ReadOnlySpan((long[])testData); - list.AddRange(readOnlySpan); - list.AddRange(readOnlySpan); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - var readOnlySpan = new Span((long[])testData); - list.AddRange(readOnlySpan); - list.AddRange(readOnlySpan); - } - else if (testData is long[] testDataArray) - { - list.AddRange(testDataArray); - list.AddRange(testDataArray); - } - else if (testData is List testDataList) - { - list.AddRange(testDataList); - list.AddRange(testDataList); - } - else if (testData is RecyclableList testDataRecyclableList) - { - list.AddRange(testDataRecyclableList); - list.AddRange(testDataRecyclableList); - } - else if (testData is RecyclableLongList testDataRecyclableLongList) - { - list.AddRange(testDataRecyclableLongList); - list.AddRange(testDataRecyclableLongList); - } - else if (testData is IList testDataIList) - { - list.AddRange(testDataIList); - list.AddRange(testDataIList); - } - else if (testData is IEnumerable testDataIEnumerable) - { - list.AddRange(testDataIEnumerable); - list.AddRange(testDataIEnumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - // Validate - var expectedData = testData.Concat(testData); - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldAcceptDuplicates(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - testData = testData.Concat(testData); - - // Act - using var list = new RecyclableLongList(minBlockSize: targetBlockSize); - foreach (var index in testData) - { - list.Add(index); - } - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); - _ = list.Should().Equal(testData); - } - - [Fact] - public void AddShouldAcceptNulls() - { - // Prepare -#pragma warning disable IDE0028 - using var list = new RecyclableLongList(); - - // Act - list.Add(null); - list.Add(default); -#pragma warning restore IDE0028 - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.BlockSize); - _ = list.Should().AllSatisfy(x => x.Should().BeNull()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldAddItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(minBlockSize: targetBlockSize); - - // Act - foreach (var index in testData) - { - list.Add(index); - _ = list.LongCount.Should().Be(index); - } - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.LongCount.Should().Be(itemsCount, "we added so many items"); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount / list.BlockSize) - (itemsCount % list.BlockSize == 0 ? 1 : 0)); - _ = list.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - //[InlineData("Debugging case", new long[1] { 1 }, 1, 2)] - public void AddShouldAddItemWhenAfterAddRange(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Act - using var list = new RecyclableLongList(minBlockSize: targetBlockSize, itemsCount); - list.AddRange(testData); - foreach (var index in testData) - { - list.Add(index); - } - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); - _ = list.Should().Equal(testData.Concat(testData)); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ClearShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - if (itemsCount == 0) - { - /// Clearing empty list is tested in . - return; - } - - // Arrange - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - var blocks = list.AsArray.ToArray(); - _ = blocks.Should().AllBeOfType(); - var beforeItems = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).ToArray(); - _ = beforeItems.Should().AllSatisfy(x => x.Should().NotBeNull()); - - // Act - list.Clear(); - - // Assert - var afterItems = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).ToArray(); - _ = afterItems.Should().AllSatisfy(x => x.Should().BeNull()); - _ = list.AsArray.Should().AllSatisfy(x => x.Should().BeNull()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ClearShouldRemoveAllItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - _ = list.LongCount.Should().Be(itemsCount); - - // Act - list.Clear(); - list.Clear(); - - // Validate - _ = list.Capacity.Should().Be(0); - _ = list.LastBlockWithData.Should().Be(-1); - _ = list.LongCount.Should().Be(0); - _ = list.Should().BeEmpty(); - } - - [Fact] - public void ClearShouldReturnPooledArraysOnlyOnce() - { - // Arrange - var testData = RecyclableLongListTestData.CreateTestData(RecyclableDefaults.MinPooledArrayLength * 10); - using RecyclableLongList firstInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); - var firstArrays = firstInstances.AsArray.ToArray(); - - // Act - firstInstances.Clear(); - - // Assert - using RecyclableLongList sameInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); - _ = sameInstances.AsArray.Should().BeEquivalentTo(firstArrays.Reverse()); - - using RecyclableLongList otherInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); - _ = otherInstances.AsArray.Should().NotIntersectWith(firstArrays); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConsecutiveDisposeShouldSucceed(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - list.Dispose(); - - // Act - list.Dispose(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConstructorShouldAcceptDuplicates(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - testData = testData.Concat(testData); - - // Act - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / targetBlockSize) - (itemsCount * 2 % targetBlockSize > 0 ? 0 : 1)); - _ = list.LongCount.Should().Be(itemsCount * 2); - _ = list.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ConstructorSourceShouldInitializeList(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Act - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.LastBlockWithData.Should().Be((int)(itemsCount / targetBlockSize) - (itemsCount % targetBlockSize > 0 ? 0 : 1)); - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ContainsShouldFindAllItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = list.Contains(list[itemIndex]).Should().BeTrue($"we searched for {list[itemIndex]}"); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.TargetDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ContainsShouldNotFindAnythingWhenListEmpty(long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(minBlockSize: targetBlockSize, itemsCount); - - // Validate - _ = list.Contains(0).Should().BeFalse(); - _ = list.Contains(1).Should().BeFalse(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void ContainsShouldNotFindNonExistingItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = list.Contains(-list[itemIndex]).Should().BeFalse(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - //[InlineData("Debugging case", new[] { 1L, 2, }, 2, 2)] - public void CopyToShouldCopyAllItemsInTheCorrectOrder(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - long[] copiedItems = new long[itemsCount]; - - // Act - list.CopyTo(copiedItems, 0); - - // Validate - _ = copiedItems.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void DisposeShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - if (itemsCount == 0) - { - /// Disposing empty list is tested in . - return; - } - - // Arrange - using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); - var blocks = list.AsArray.ToArray(); - _ = blocks.Should().AllBeOfType(); - - _ = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).Should().AllSatisfy(x => x.Should().NotBeNull()); - - // Act - list.Dispose(); - - // Assert - _ = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).Should().AllSatisfy(x => x.Should().BeNull()); - _ = list.AsArray.Should().AllSatisfy(x => x.Should().BeNull()); - } - - [Fact] - public void DisposeShouldReturnPooledArrayOnlyOnce() - { - // Arrange - var testData = RecyclableLongListTestData.CreateTestData(RecyclableDefaults.MinPooledArrayLength * 10); - using RecyclableLongList firstInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); - var firstArrays = firstInstances.AsArray.ToArray(); - - // Act - firstInstances.Dispose(); - - // Assert - using RecyclableLongList sameInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); - _ = sameInstances.AsArray.Should().BeEquivalentTo(firstArrays); - - using RecyclableLongList otherInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); - _ = otherInstances.AsArray.Should().NotIntersectWith(firstArrays); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void DisposeShouldSucceed(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act - list.Dispose(); - - // Validate - _ = list.Capacity.Should().Be(0); - _ = list.LastBlockWithData.Should().Be(-1); - _ = list.LongCount.Should().Be(0); - _ = list.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void EnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act - var yieldedItems = new List(itemsCount); - using var enumerator = list.GetEnumerator(); - while (enumerator.MoveNext()) - { - yieldedItems.Add(enumerator.Current); - } - - // Validate - _ = yieldedItems.Should().Equal(testData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void GetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act & Validate - foreach (long item in testData) - { - _ = list[(int)item - 1].Should().Be(item); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void GetByIndexShouldReturnCorrectItemWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act & Validate - foreach (long item in testData) - { - _ = list[item - 1].Should().Be(item); - } - } - - [Fact] - public void IndexOfShouldNotFindAnythingWhenListEmpty() - { - // Prepare - using var list = new RecyclableLongList(); - - // Validate - _ = list.IndexOf(0).Should().Be(-1); - _ = list.IndexOf(1).Should().Be(-1); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void IndexOfShouldNotFindNonExistingItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = list.IndexOf(-list[itemIndex]).Should().Be(-1); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void IndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = list.IndexOf(list[itemIndex]).Should().Be((int)itemIndex); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void InitializeSortClearAddRangeRemoveShouldSucceed(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - var testDataList = testData.ToList(); - var item = testDataList[(int)itemIndex]; - - // Act - using RecyclableLongList list = new(testData, minBlockSize: targetBlockSize); - QuickSortExtensions.QuickSort(list); - - // Validate - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(testDataList); - - // Act - list.Clear(); - - // Validate - _ = list.LongCount.Should().Be(0); - _ = list.Should().BeEmpty(); - - // Act - list.AddRange(testData); - - // Validate - _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().Equal(testDataList); - - // Prepare - testDataList.RemoveAt((int)itemIndex); - - // Act - _ = list.Remove(item).Should().BeTrue(); - _ = list.LongIndexOf(item).Should().Be(RecyclableDefaults.ItemNotFoundIndexLong); - _ = list.Contains(item).Should().BeFalse(); - _ = list.LongCount.Should().Be(itemsCount - 1); - _ = list.Should().Equal(testDataList); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void InsertShouldMoveItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); - long expectedCapacity = CalculateExpectedCapacity(testCase, itemsCount, targetBlockSize); - var expectedItems = testData.ToList(); - - var existingItem = expectedItems[(int)itemIndex]; - var newItem = existingItem + 1; - expectedItems.Insert((int)itemIndex, newItem); - - // Act - list.Insert((int)itemIndex, newItem); - - // Validate - _ = list[itemIndex].Should().Be(newItem); - _ = list[itemIndex + 1].Should().Be(existingItem); - _ = list.Capacity.Should().Be(expectedCapacity); - _ = list.Count.Should().Be((int)itemsCount + 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void InsertShouldMoveItemsWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); - long expectedCapacity = CalculateExpectedCapacity(testCase, itemsCount, targetBlockSize); - var expectedItems = testData.ToList(); - - var existingItem = expectedItems[(int)itemIndex]; - var newItem = existingItem + 1; - expectedItems.Insert((int)itemIndex, newItem); - - // Act - list.Insert(itemIndex, newItem); - - // Validate - _ = list[itemIndex].Should().Be(newItem); - _ = list[itemIndex + 1].Should().Be(existingItem); - _ = list.Capacity.Should().Be(expectedCapacity); - _ = list.Count.Should().Be((int)itemsCount + 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Fact] - public void LongIndexOfShouldNotFindAnythingWhenListEmpty() - { - // Prepare - using var list = new RecyclableLongList(); - - // Validate - _ = list.LongIndexOf(0).Should().Be(-1); - _ = list.LongIndexOf(1).Should().Be(-1); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void LongIndexOfShouldNotFindNonExistingItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = list.LongIndexOf(-list[itemIndex]).Should().Be(-1); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void LongIndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act & Validate - foreach (var itemIndex in itemIndexes) - { - _ = list.LongIndexOf(list[itemIndex]).Should().Be(itemIndex); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveAtShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] indexesToRemove) - { - foreach (var indexToRemove in indexesToRemove) - { - // Arrange - using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); - _ = list[^1].Should().NotBeNull(); - - // Act - list.RemoveAt(indexToRemove); - - // Assert - _ = list[list.LongCount].Should().BeNull(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveAtShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); - var expectedItems = list.ToList(); - expectedItems.RemoveAt((int)itemIndex); - - // Act - list.RemoveAt((int)itemIndex); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); - _ = list.LongCount.Should().Be(itemsCount - 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveAtShouldRemoveTheCorrectItemWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); - var expectedItems = list.ToList(); - expectedItems.RemoveAt((int)itemIndex); - - // Act - list.RemoveAt(itemIndex); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); - _ = list.LongCount.Should().Be(itemsCount - 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] indexesToRemove) - { - var expectedItems = testData.ToArray(); - - foreach (var indexToRemove in indexesToRemove) - { - // Arrange - var itemToRemove = expectedItems[(int)indexToRemove]; - using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); - _ = list[^1].Should().NotBeNull(); - - // Act - list.Remove(itemToRemove); - - // Assert - _ = list[list.LongCount].Should().BeNull(); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) - { - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); - var expectedItems = list.ToList(); - var item = expectedItems[(int)itemIndex]; - expectedItems.RemoveAt((int)itemIndex); - - // Act - _ = list.Remove(item).Should().BeTrue(); - - // Validate - _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); - _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); - _ = list.LongCount.Should().Be(itemsCount - 1); - _ = list.Should().Equal(expectedItems); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - var expectedData = testData.ToList(); - - // Act & Validate - foreach (long item in testData) - { - // Act - list[(int)item - 1] = item + 1; - - // Validate - expectedData[(int)item - 1] = item + 1; - list[item - 1].Should().Be(item + 1); - list.Should().Equal(expectedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SetByIndexShouldReturnCorrectItemWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - var expectedData = testData.ToList(); - - // Act & Validate - foreach (long item in testData) - { - // Act - list[item - 1] = item + 1; - - // Validate - expectedData[(int)item - 1] = item + 1; - list[item - 1].Should().Be(item + 1); - list.Should().Equal(expectedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrder(string testCase, IEnumerable testData, long itemsCount) - { - // Prepare - using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); - var expectedData = testData.Reverse().ToList(); - expectedData.Sort(); - - // Act - list.Sort(); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrderWhenWithComparer(string testCase, IEnumerable testData, long itemsCount) - { - // Prepare - using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); - IComparer comparer = Comparer.Default; - var expectedData = testData.Reverse().ToList(); - expectedData.Sort(comparer); - - // Act - list.Sort(comparer); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrderWhenWithComparison(string testCase, IEnumerable testData, long itemsCount) - { - // Prepare - using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); - - static int comparison(long x, long y) - { - return (x - y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0, - }; - } - - var expectedData = testData.Reverse().ToList(); - expectedData.Sort(comparison); - - // Act - list.Sort(comparison); - - // Validate - _ = list.Should().Equal(expectedData); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] - public void SortShouldSortItemsInCorrectOrderWhenConstrained(string testCase, IEnumerable testData, long itemsCount, long[] itemIndexes) - { - // Prepare - IComparer comparer = Comparer.Default; - var expectedData = testData.Reverse().ToArray(); - - foreach (var itemIndex in itemIndexes) - { - // Prepare - using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); - var startingIndex = (int)Math.Min(1, itemIndex); - - var expectedSortedData = expectedData.ToList(); - expectedSortedData.Sort(startingIndex, (int)itemIndex, comparer); - - // Act - list.Sort(startingIndex, (int)itemIndex, comparer); - - // Validate - _ = list.Should().Equal(expectedSortedData); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void VersionedEnumerateShouldRaiseExceptionWhenCollectionIsModified(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount) - { - -1 - }; - - // Act - _ = Assert.Throws(() => - { - foreach (var item in (IRecyclableVersionedLongList)list) - { - list.Add(item); - } - }); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] - public void VersionedEnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount, int targetBlockSize) - { - // Prepare - using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); - - // Act - var yieldedItems = new List(itemsCount); - foreach (var item in (IRecyclableVersionedLongList)list) - { - yieldedItems.Add(item); - } - - // Validate - _ = yieldedItems.Should().Equal(testData); - } - } +using FluentAssertions; +using Recyclable.Collections; +using Recyclable.Collections.Linq; +using System.Collections; +using System.Numerics; + +#pragma warning disable xUnit1026, RCS1163, IDE0060, RCS1235 + +namespace Recyclable.CollectionsTests +{ + public class RecyclableLongListTests + { + private static long CalculateExpectedCapacity(string testCase, long itemsCount, int targetBlockSize) + { + var expectedCapacity = (long)BitOperations.RoundUpToPowerOf2((uint)itemsCount + 1); + if (targetBlockSize > itemsCount) + { + expectedCapacity = ((itemsCount / targetBlockSize) + (itemsCount % targetBlockSize > 0 ? 1 : 0)) * targetBlockSize; + } + + return expectedCapacity; + } + + [Fact] + public void AddRangeShouldAcceptNulls() + { + // Prepare + using var list = new RecyclableLongList(); + + // Act + list.AddRange(new long?[] { null, default }); + + // Validate + _ = list.Should().HaveCount(2).And.AllSatisfy(x => x.Should().BeNull()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(minBlockSize: targetBlockSize); + + // Act + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new Span((long[])testData)); + } + else if (testData is long[] testDataArray) + { + list.AddRange(testDataArray); + } + else if (testData is List testDataList) + { + list.AddRange(testDataList); + } + else if (testData is RecyclableList testDataRecyclableList) + { + list.AddRange(testDataRecyclableList); + } + else if (testData is RecyclableLongList testDataRecyclableLongList) + { + list.AddRange(testDataRecyclableLongList); + } + else if (testData is IList testDataIList) + { + list.AddRange(testDataIList); + } + else if (testData is IEnumerable testDataIEnumerable) + { + list.AddRange(testDataIEnumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + // Validate + long expectedItemsCount = itemsCount; + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedItemsCount); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount / targetBlockSize) - (itemsCount % targetBlockSize != 0 ? 0 : 1)); + _ = list.LongCount.Should().Be(expectedItemsCount); + _ = list.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, long itemsCount) + { + // Prepare + using var list = new RecyclableLongList(); + + // Act + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange(new Span((long[])testData)); + } + else if (testData is long[] testDataArray) + { + list.AddRange(testDataArray); + } + else if (testData is List testDataList) + { + list.AddRange(testDataList); + } + else if (testData is RecyclableList testDataRecyclableList) + { + list.AddRange(testDataRecyclableList); + } + else if (testData is RecyclableLongList testDataRecyclableLongList) + { + list.AddRange(testDataRecyclableLongList); + } + else if (testData is IList testDataIList) + { + list.AddRange(testDataIList); + } + else if (testData is IEnumerable testDataIEnumerable) + { + list.AddRange(testDataIEnumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.InitialCapacity); + _ = list.LastBlockWithData.Should().Be(-1); + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(minBlockSize: targetBlockSize); + + // Act + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((Array)testData); + list.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((ICollection)testData); + list.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IEnumerable)testData); + list.AddRange((IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + list.AddRange((IReadOnlyList)testData); + list.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + var readOnlySpan = new ReadOnlySpan((long[])testData); + list.AddRange(readOnlySpan); + list.AddRange(readOnlySpan); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + var readOnlySpan = new Span((long[])testData); + list.AddRange(readOnlySpan); + list.AddRange(readOnlySpan); + } + else if (testData is long[] testDataArray) + { + list.AddRange(testDataArray); + list.AddRange(testDataArray); + } + else if (testData is List testDataList) + { + list.AddRange(testDataList); + list.AddRange(testDataList); + } + else if (testData is RecyclableList testDataRecyclableList) + { + list.AddRange(testDataRecyclableList); + list.AddRange(testDataRecyclableList); + } + else if (testData is RecyclableLongList testDataRecyclableLongList) + { + list.AddRange(testDataRecyclableLongList); + list.AddRange(testDataRecyclableLongList); + } + else if (testData is IList testDataIList) + { + list.AddRange(testDataIList); + list.AddRange(testDataIList); + } + else if (testData is IEnumerable testDataIEnumerable) + { + list.AddRange(testDataIEnumerable); + list.AddRange(testDataIEnumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + // Validate + var expectedData = testData.Concat(testData); + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldAcceptDuplicates(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + testData = testData.Concat(testData); + + // Act + using var list = new RecyclableLongList(minBlockSize: targetBlockSize); + foreach (var index in testData) + { + list.Add(index); + } + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); + _ = list.Should().Equal(testData); + } + + [Fact] + public void AddShouldAcceptNulls() + { + // Prepare +#pragma warning disable IDE0028 + using var list = new RecyclableLongList(); + + // Act + list.Add(null); + list.Add(default); +#pragma warning restore IDE0028 + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.BlockSize); + _ = list.Should().AllSatisfy(x => x.Should().BeNull()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldAddItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(minBlockSize: targetBlockSize); + + // Act + foreach (var index in testData) + { + list.Add(index); + _ = list.LongCount.Should().Be(index); + } + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.LongCount.Should().Be(itemsCount, "we added so many items"); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount / list.BlockSize) - (itemsCount % list.BlockSize == 0 ? 1 : 0)); + _ = list.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + //[InlineData("Debugging case", new long[1] { 1 }, 1, 2)] + public void AddShouldAddItemWhenAfterAddRange(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Act + using var list = new RecyclableLongList(minBlockSize: targetBlockSize, itemsCount); + list.AddRange(testData); + foreach (var index in testData) + { + list.Add(index); + } + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); + _ = list.Should().Equal(testData.Concat(testData)); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ClearShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + if (itemsCount == 0) + { + /// Clearing empty list is tested in . + return; + } + + // Arrange + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + var blocks = list.AsArray.ToArray(); + _ = blocks.Should().AllBeOfType(); + var beforeItems = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).ToArray(); + _ = beforeItems.Should().AllSatisfy(x => x.Should().NotBeNull()); + + // Act + list.Clear(); + + // Assert + var afterItems = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).ToArray(); + _ = afterItems.Should().AllSatisfy(x => x.Should().BeNull()); + _ = list.AsArray.Should().AllSatisfy(x => x.Should().BeNull()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ClearShouldRemoveAllItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + _ = list.LongCount.Should().Be(itemsCount); + + // Act + list.Clear(); + list.Clear(); + + // Validate + _ = list.Capacity.Should().Be(0); + _ = list.LastBlockWithData.Should().Be(-1); + _ = list.LongCount.Should().Be(0); + _ = list.Should().BeEmpty(); + } + + [Fact] + public void ClearShouldReturnPooledArraysOnlyOnce() + { + // Arrange + var testData = RecyclableLongListTestData.CreateTestData(RecyclableDefaults.MinPooledArrayLength * 10); + using RecyclableLongList firstInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); + var firstArrays = firstInstances.AsArray.ToArray(); + + // Act + firstInstances.Clear(); + + // Assert + using RecyclableLongList sameInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); + _ = sameInstances.AsArray.Should().BeEquivalentTo(firstArrays.Reverse()); + + using RecyclableLongList otherInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); + _ = otherInstances.AsArray.Should().NotIntersectWith(firstArrays); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConsecutiveDisposeShouldSucceed(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + list.Dispose(); + + // Act + list.Dispose(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConstructorShouldAcceptDuplicates(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + testData = testData.Concat(testData); + + // Act + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount * 2); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / targetBlockSize) - (itemsCount * 2 % targetBlockSize > 0 ? 0 : 1)); + _ = list.LongCount.Should().Be(itemsCount * 2); + _ = list.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ConstructorSourceShouldInitializeList(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Act + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.LastBlockWithData.Should().Be((int)(itemsCount / targetBlockSize) - (itemsCount % targetBlockSize > 0 ? 0 : 1)); + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ContainsShouldFindAllItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = list.Contains(list[itemIndex]).Should().BeTrue($"we searched for {list[itemIndex]}"); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.TargetDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ContainsShouldNotFindAnythingWhenListEmpty(long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(minBlockSize: targetBlockSize, itemsCount); + + // Validate + _ = list.Contains(0).Should().BeFalse(); + _ = list.Contains(1).Should().BeFalse(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void ContainsShouldNotFindNonExistingItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = list.Contains(-list[itemIndex]).Should().BeFalse(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + //[InlineData("Debugging case", new[] { 1L, 2, }, 2, 2)] + public void CopyToShouldCopyAllItemsInTheCorrectOrder(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + long[] copiedItems = new long[itemsCount]; + + // Act + list.CopyTo(copiedItems, 0); + + // Validate + _ = copiedItems.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void DisposeShouldClearItemsWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + if (itemsCount == 0) + { + /// Disposing empty list is tested in . + return; + } + + // Arrange + using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); + var blocks = list.AsArray.ToArray(); + _ = blocks.Should().AllBeOfType(); + + _ = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).Should().AllSatisfy(x => x.Should().NotBeNull()); + + // Act + list.Dispose(); + + // Assert + _ = blocks.SelectMany(x => x.Take(targetBlockSize)).Take((int)itemsCount).Should().AllSatisfy(x => x.Should().BeNull()); + _ = list.AsArray.Should().AllSatisfy(x => x.Should().BeNull()); + } + + [Fact] + public void DisposeShouldReturnPooledArrayOnlyOnce() + { + // Arrange + var testData = RecyclableLongListTestData.CreateTestData(RecyclableDefaults.MinPooledArrayLength * 10); + using RecyclableLongList firstInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); + var firstArrays = firstInstances.AsArray.ToArray(); + + // Act + firstInstances.Dispose(); + + // Assert + using RecyclableLongList sameInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); + _ = sameInstances.AsArray.Should().BeEquivalentTo(firstArrays); + + using RecyclableLongList otherInstances = new(testData, RecyclableDefaults.MinPooledArrayLength); + _ = otherInstances.AsArray.Should().NotIntersectWith(firstArrays); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void DisposeShouldSucceed(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act + list.Dispose(); + + // Validate + _ = list.Capacity.Should().Be(0); + _ = list.LastBlockWithData.Should().Be(-1); + _ = list.LongCount.Should().Be(0); + _ = list.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void EnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act + var yieldedItems = new List(itemsCount); + using var enumerator = list.GetEnumerator(); + while (enumerator.MoveNext()) + { + yieldedItems.Add(enumerator.Current); + } + + // Validate + _ = yieldedItems.Should().Equal(testData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void GetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act & Validate + foreach (long item in testData) + { + _ = list[(int)item - 1].Should().Be(item); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void GetByIndexShouldReturnCorrectItemWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act & Validate + foreach (long item in testData) + { + _ = list[item - 1].Should().Be(item); + } + } + + [Fact] + public void IndexOfShouldNotFindAnythingWhenListEmpty() + { + // Prepare + using var list = new RecyclableLongList(); + + // Validate + _ = list.IndexOf(0).Should().Be(-1); + _ = list.IndexOf(1).Should().Be(-1); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void IndexOfShouldNotFindNonExistingItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = list.IndexOf(-list[itemIndex]).Should().Be(-1); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void IndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = list.IndexOf(list[itemIndex]).Should().Be((int)itemIndex); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void InitializeSortClearAddRangeRemoveShouldSucceed(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + var testDataList = testData.ToList(); + var item = testDataList[(int)itemIndex]; + + // Act + using RecyclableLongList list = new(testData, minBlockSize: targetBlockSize); + QuickSortExtensions.QuickSort(list); + + // Validate + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(testDataList); + + // Act + list.Clear(); + + // Validate + _ = list.LongCount.Should().Be(0); + _ = list.Should().BeEmpty(); + + // Act + list.AddRange(testData); + + // Validate + _ = list.LongCount.Should().Be(itemsCount); + _ = list.Should().Equal(testDataList); + + // Prepare + testDataList.RemoveAt((int)itemIndex); + + // Act + _ = list.Remove(item).Should().BeTrue(); + _ = list.LongIndexOf(item).Should().Be(RecyclableDefaults.ItemNotFoundIndexLong); + _ = list.Contains(item).Should().BeFalse(); + _ = list.LongCount.Should().Be(itemsCount - 1); + _ = list.Should().Equal(testDataList); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void InsertShouldMoveItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); + long expectedCapacity = CalculateExpectedCapacity(testCase, itemsCount, targetBlockSize); + var expectedItems = testData.ToList(); + + var existingItem = expectedItems[(int)itemIndex]; + var newItem = existingItem + 1; + expectedItems.Insert((int)itemIndex, newItem); + + // Act + list.Insert((int)itemIndex, newItem); + + // Validate + _ = list[itemIndex].Should().Be(newItem); + _ = list[itemIndex + 1].Should().Be(existingItem); + _ = list.Capacity.Should().Be(expectedCapacity); + _ = list.Count.Should().Be((int)itemsCount + 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void InsertShouldMoveItemsWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); + long expectedCapacity = CalculateExpectedCapacity(testCase, itemsCount, targetBlockSize); + var expectedItems = testData.ToList(); + + var existingItem = expectedItems[(int)itemIndex]; + var newItem = existingItem + 1; + expectedItems.Insert((int)itemIndex, newItem); + + // Act + list.Insert(itemIndex, newItem); + + // Validate + _ = list[itemIndex].Should().Be(newItem); + _ = list[itemIndex + 1].Should().Be(existingItem); + _ = list.Capacity.Should().Be(expectedCapacity); + _ = list.Count.Should().Be((int)itemsCount + 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Fact] + public void LongIndexOfShouldNotFindAnythingWhenListEmpty() + { + // Prepare + using var list = new RecyclableLongList(); + + // Validate + _ = list.LongIndexOf(0).Should().Be(-1); + _ = list.LongIndexOf(1).Should().Be(-1); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void LongIndexOfShouldNotFindNonExistingItems(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + _ = testData.Any().Should().BeTrue("we need items on the list that we can look for"); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = list.LongIndexOf(-list[itemIndex]).Should().Be(-1); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void LongIndexOfShouldReturnCorrectIndexes(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act & Validate + foreach (var itemIndex in itemIndexes) + { + _ = list.LongIndexOf(list[itemIndex]).Should().Be(itemIndex); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveAtShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] indexesToRemove) + { + foreach (var indexToRemove in indexesToRemove) + { + // Arrange + using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); + _ = list[^1].Should().NotBeNull(); + + // Act + list.RemoveAt(indexToRemove); + + // Assert + _ = list[list.LongCount].Should().BeNull(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveAtShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); + var expectedItems = list.ToList(); + expectedItems.RemoveAt((int)itemIndex); + + // Act + list.RemoveAt((int)itemIndex); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); + _ = list.LongCount.Should().Be(itemsCount - 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveAtShouldRemoveTheCorrectItemWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); + var expectedItems = list.ToList(); + expectedItems.RemoveAt((int)itemIndex); + + // Act + list.RemoveAt(itemIndex); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); + _ = list.LongCount.Should().Be(itemsCount - 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceRefDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldClearItemWhenReferenceType(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] indexesToRemove) + { + var expectedItems = testData.ToArray(); + + foreach (var indexToRemove in indexesToRemove) + { + // Arrange + var itemToRemove = expectedItems[(int)indexToRemove]; + using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount); + _ = list[^1].Should().NotBeNull(); + + // Act + list.Remove(itemToRemove); + + // Assert + _ = list[list.LongCount].Should().BeNull(); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldRemoveTheCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize, in long[] itemIndexes) + { + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize); + var expectedItems = list.ToList(); + var item = expectedItems[(int)itemIndex]; + expectedItems.RemoveAt((int)itemIndex); + + // Act + _ = list.Remove(item).Should().BeTrue(); + + // Validate + _ = list.Capacity.Should().BeGreaterThanOrEqualTo(itemsCount); + _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); + _ = list.LongCount.Should().Be(itemsCount - 1); + _ = list.Should().Equal(expectedItems); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SetByIndexShouldReturnCorrectItem(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + var expectedData = testData.ToList(); + + // Act & Validate + foreach (long item in testData) + { + // Act + list[(int)item - 1] = item + 1; + + // Validate + expectedData[(int)item - 1] = item + 1; + list[item - 1].Should().Be(item + 1); + list.Should().Equal(expectedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SetByIndexShouldReturnCorrectItemWhenLong(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + var expectedData = testData.ToList(); + + // Act & Validate + foreach (long item in testData) + { + // Act + list[item - 1] = item + 1; + + // Validate + expectedData[(int)item - 1] = item + 1; + list[item - 1].Should().Be(item + 1); + list.Should().Equal(expectedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrder(string testCase, IEnumerable testData, long itemsCount) + { + // Prepare + using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); + var expectedData = testData.Reverse().ToList(); + expectedData.Sort(); + + // Act + list.Sort(); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrderWhenWithComparer(string testCase, IEnumerable testData, long itemsCount) + { + // Prepare + using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); + IComparer comparer = Comparer.Default; + var expectedData = testData.Reverse().ToList(); + expectedData.Sort(comparer); + + // Act + list.Sort(comparer); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrderWhenWithComparison(string testCase, IEnumerable testData, long itemsCount) + { + // Prepare + using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); + + static int comparison(long x, long y) + { + return (x - y) switch + { + > 0 => 1, + < 0 => -1, + _ => 0, + }; + } + + var expectedData = testData.Reverse().ToList(); + expectedData.Sort(comparison); + + // Act + list.Sort(comparison); + + // Validate + _ = list.Should().Equal(expectedData); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithItemIndexVariants), MemberType = typeof(RecyclableLongListTestData))] + public void SortShouldSortItemsInCorrectOrderWhenConstrained(string testCase, IEnumerable testData, long itemsCount, long[] itemIndexes) + { + // Prepare + IComparer comparer = Comparer.Default; + var expectedData = testData.Reverse().ToArray(); + + foreach (var itemIndex in itemIndexes) + { + // Prepare + using var list = new RecyclableLongList(testData.Reverse(), initialCapacity: itemsCount); + var startingIndex = (int)Math.Min(1, itemIndex); + + var expectedSortedData = expectedData.ToList(); + expectedSortedData.Sort(startingIndex, (int)itemIndex, comparer); + + // Act + list.Sort(startingIndex, (int)itemIndex, comparer); + + // Validate + _ = list.Should().Equal(expectedSortedData); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void VersionedEnumerateShouldRaiseExceptionWhenCollectionIsModified(string testCase, IEnumerable testData, long itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, targetBlockSize, itemsCount) + { + -1 + }; + + // Act + _ = Assert.Throws(() => + { + foreach (var item in (IRecyclableVersionedLongList)list) + { + list.Add(item); + } + }); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataWithBlockSizeVariants), MemberType = typeof(RecyclableLongListTestData))] + public void VersionedEnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount, int targetBlockSize) + { + // Prepare + using var list = new RecyclableLongList(testData, minBlockSize: targetBlockSize, itemsCount); + + // Act + var yieldedItems = new List(itemsCount); + foreach (var item in (IRecyclableVersionedLongList)list) + { + yieldedItems.Add(item); + } + + // Validate + _ = yieldedItems.Should().Equal(testData); + } + } } \ No newline at end of file diff --git a/Recyclable.CollectionsTests/RecyclablePriorityQueueTests.cs b/Recyclable.CollectionsTests/RecyclablePriorityQueueTests.cs index 44d03d4..34671e5 100644 --- a/Recyclable.CollectionsTests/RecyclablePriorityQueueTests.cs +++ b/Recyclable.CollectionsTests/RecyclablePriorityQueueTests.cs @@ -1,495 +1,495 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Collections; - -namespace Recyclable.CollectionsTests -{ - public class RecyclablePriorityQueueTests - { - private static readonly int[] _testData = new[] { 4, 1, 3, 2, 5 }; - - [Fact] - public void DequeueShouldReturnItemsInSortedOrder() - { - using var queue = new RecyclablePriorityQueue(); - foreach (var item in _testData) - { - queue.Enqueue(item); - } - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().BeInAscendingOrder(); - } - - [Fact] - public void ShouldBeEmptyWhenNotInitialized() - { - using var queue = new RecyclablePriorityQueue(); - _ = queue.Should().BeEmpty(); - _ = queue.LongCount.Should().Be(0); - } - - [Fact] - public void ShouldBeEmptyAfterClear() - { - using var queue = new RecyclablePriorityQueue(); - foreach (var item in _testData) - { - queue.Enqueue(item); - } - - queue.Clear(); - _ = queue.Should().BeEmpty(); - } - - [Fact] - public void DequeueShouldThrowWhenNoElements() - { - using var queue = new RecyclablePriorityQueue(); - _ = Assert.Throws(() => queue.Dequeue()); - } - - [Fact] - public void AddRangeSpanShouldAddItemsInSortedOrder() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange((ReadOnlySpan)_testData); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeSpanShouldDoNothingWhenEmpty() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange(ReadOnlySpan.Empty); - _ = queue.Should().BeEmpty(); - } - - [Fact] - public void AddRangeSpanShouldNotOverrideItems() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange((ReadOnlySpan)_testData); - queue.AddRange((ReadOnlySpan)_testData); - - var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeArrayShouldAddItemsInSortedOrder() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange(_testData); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeListShouldAddItemsInSortedOrder() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange(new List(_testData)); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeReadOnlyMemoryShouldAddItemsInSortedOrder() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange((ReadOnlyMemory)_testData); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeMemoryShouldNotOverrideItems() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange(_testData.AsMemory()); - queue.AddRange(_testData.AsMemory()); - - var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeArrayShouldNotOverrideItems() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange(_testData); - queue.AddRange(_testData); - - var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeShouldAcceptNulls() - { - using var queue = new RecyclablePriorityQueue(); - queue.AddRange(new long?[] { null, 1 }); - _ = queue.Should().HaveCount(2).And.Contain((long?)null); - } - - [Fact] - public void AddRangeQueueShouldAddItemsInSortedOrder() - { - using var source = new RecyclableQueue(_testData); - using var queue = new RecyclablePriorityQueue(); - - queue.AddRange(source); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeQueueShouldNotOverrideItems() - { - using var source = new RecyclableQueue(_testData); - using var queue = new RecyclablePriorityQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeStackShouldAddItemsInSortedOrder() - { - using var source = new RecyclableStack(_testData); - using var queue = new RecyclablePriorityQueue(); - - queue.AddRange(source); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeSortedSetShouldAddItemsInSortedOrder() - { - using var source = new RecyclableSortedSet(); - foreach (int item in _testData) - { - source.Add(item); - } - - using var queue = new RecyclablePriorityQueue(); - - queue.AddRange(source); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeDictionaryShouldAddItemsInSortedOrder() - { - using var source = new RecyclableDictionary(); - for (int i = 0; i < _testData.Length; i++) - { - source.Add(i, _testData[i]); - } - - using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); - - queue.AddRange(source); - - var result = new List>(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Select((v, i) => new KeyValuePair(i, v)).ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeDictionaryShouldNotOverrideItems() - { - using var source = new RecyclableDictionary(); - for (int i = 0; i < _testData.Length; i++) - { - source.Add(i, _testData[i]); - } - - using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); - - queue.AddRange(source); - queue.AddRange(source); - - var result = new List>(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Select((v, i) => new KeyValuePair(i, v)) - .Concat(_testData.Select((v, i) => new KeyValuePair(i, v))) - .ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeSortedListShouldAddItemsInSortedOrder() - { - using var source = new RecyclableSortedList(); - for (int i = 0; i < _testData.Length; i++) - { - source.Add(i, _testData[i]); - } - - using var queue = new RecyclablePriorityQueue<(int Key, int Value)>(comparer: Comparer<(int Key, int Value)>.Create((a, b) => a.Key.CompareTo(b.Key))); - - queue.AddRange(source); - - var result = new List<(int Key, int Value)>(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Select((v, i) => (i, v)).ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeSortedListShouldNotOverrideItems() - { - using var source = new RecyclableSortedList(); - for (int i = 0; i < _testData.Length; i++) - { - source.Add(i, _testData[i]); - } - - using var queue = new RecyclablePriorityQueue<(int Key, int Value)>(comparer: Comparer<(int Key, int Value)>.Create((a, b) => a.Key.CompareTo(b.Key))); - - queue.AddRange(source); - queue.AddRange(source); - - var result = new List<(int Key, int Value)>(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Select((v, i) => (i, v)) - .Concat(_testData.Select((v, i) => (i, v))) - .OrderBy(p => p.Item1) - .ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeSortedDictionaryShouldAddItemsInSortedOrder() - { - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < _testData.Length; i++) - { - source.Add(i, _testData[i]); - } - - using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); - - queue.AddRange(source); - - var result = new List>(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Select((v, i) => new KeyValuePair(i, v)).ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeSortedDictionaryShouldNotOverrideItems() - { - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < _testData.Length; i++) - { - source.Add(i, _testData[i]); - } - - using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); - - queue.AddRange(source); - queue.AddRange(source); - - var result = new List>(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Select((v, i) => new KeyValuePair(i, v)) - .Concat(_testData.Select((v, i) => new KeyValuePair(i, v))) - .ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeEnumerableShouldAddItemsInSortedOrder() - { - using var queue = new RecyclablePriorityQueue(); - - _ = queue.AddRange((System.Collections.IEnumerable)_testData); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.OrderBy(v => v).ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeEnumerableShouldNotOverrideItems() - { - using var queue = new RecyclablePriorityQueue(); - - _ = queue.AddRange((System.Collections.IEnumerable)_testData); - _ = queue.AddRange((System.Collections.IEnumerable)_testData); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - var expected = _testData.Concat(_testData).OrderBy(v => v).ToList(); - _ = result.Should().Equal(expected); - } - - [Fact] - public void AddRangeReadOnlyCollectionShouldAddItemsInSortedOrder() - { - var source = new TestReadOnlyCollection(_testData); - using var queue = new RecyclablePriorityQueue(); - - queue.AddRange(source); - - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(_testData.OrderBy(static value => value)); - } - - [Fact] - public void AddRangeReadOnlyCollectionShouldNotOverrideItems() - { - var source = new TestReadOnlyCollection(_testData); - using var queue = new RecyclablePriorityQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); - var result = new List(); - while (queue.LongCount > 0) - { - result.Add(queue.Dequeue()); - } - - _ = result.Should().Equal(expected); - } - - private sealed class TestReadOnlyCollection : IReadOnlyCollection - { - private readonly T[] _items; - - public TestReadOnlyCollection(T[] items) - { - _items = items; - } - - public int Count => _items.Length; - - public IEnumerator GetEnumerator() => ((IEnumerable)_items).GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => _items.GetEnumerator(); - } - } -} - +using FluentAssertions; +using Recyclable.Collections; +using System.Collections; + +namespace Recyclable.CollectionsTests +{ + public class RecyclablePriorityQueueTests + { + private static readonly int[] _testData = new[] { 4, 1, 3, 2, 5 }; + + [Fact] + public void DequeueShouldReturnItemsInSortedOrder() + { + using var queue = new RecyclablePriorityQueue(); + foreach (var item in _testData) + { + queue.Enqueue(item); + } + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().BeInAscendingOrder(); + } + + [Fact] + public void ShouldBeEmptyWhenNotInitialized() + { + using var queue = new RecyclablePriorityQueue(); + _ = queue.Should().BeEmpty(); + _ = queue.LongCount.Should().Be(0); + } + + [Fact] + public void ShouldBeEmptyAfterClear() + { + using var queue = new RecyclablePriorityQueue(); + foreach (var item in _testData) + { + queue.Enqueue(item); + } + + queue.Clear(); + _ = queue.Should().BeEmpty(); + } + + [Fact] + public void DequeueShouldThrowWhenNoElements() + { + using var queue = new RecyclablePriorityQueue(); + _ = Assert.Throws(() => queue.Dequeue()); + } + + [Fact] + public void AddRangeSpanShouldAddItemsInSortedOrder() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange((ReadOnlySpan)_testData); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeSpanShouldDoNothingWhenEmpty() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange(ReadOnlySpan.Empty); + _ = queue.Should().BeEmpty(); + } + + [Fact] + public void AddRangeSpanShouldNotOverrideItems() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange((ReadOnlySpan)_testData); + queue.AddRange((ReadOnlySpan)_testData); + + var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeArrayShouldAddItemsInSortedOrder() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange(_testData); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeListShouldAddItemsInSortedOrder() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange(new List(_testData)); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeReadOnlyMemoryShouldAddItemsInSortedOrder() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange((ReadOnlyMemory)_testData); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeMemoryShouldNotOverrideItems() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange(_testData.AsMemory()); + queue.AddRange(_testData.AsMemory()); + + var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeArrayShouldNotOverrideItems() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange(_testData); + queue.AddRange(_testData); + + var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeShouldAcceptNulls() + { + using var queue = new RecyclablePriorityQueue(); + queue.AddRange(new long?[] { null, 1 }); + _ = queue.Should().HaveCount(2).And.Contain((long?)null); + } + + [Fact] + public void AddRangeQueueShouldAddItemsInSortedOrder() + { + using var source = new RecyclableQueue(_testData); + using var queue = new RecyclablePriorityQueue(); + + queue.AddRange(source); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeQueueShouldNotOverrideItems() + { + using var source = new RecyclableQueue(_testData); + using var queue = new RecyclablePriorityQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeStackShouldAddItemsInSortedOrder() + { + using var source = new RecyclableStack(_testData); + using var queue = new RecyclablePriorityQueue(); + + queue.AddRange(source); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeSortedSetShouldAddItemsInSortedOrder() + { + using var source = new RecyclableSortedSet(); + foreach (int item in _testData) + { + source.Add(item); + } + + using var queue = new RecyclablePriorityQueue(); + + queue.AddRange(source); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeDictionaryShouldAddItemsInSortedOrder() + { + using var source = new RecyclableDictionary(); + for (int i = 0; i < _testData.Length; i++) + { + source.Add(i, _testData[i]); + } + + using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); + + queue.AddRange(source); + + var result = new List>(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Select((v, i) => new KeyValuePair(i, v)).ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeDictionaryShouldNotOverrideItems() + { + using var source = new RecyclableDictionary(); + for (int i = 0; i < _testData.Length; i++) + { + source.Add(i, _testData[i]); + } + + using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); + + queue.AddRange(source); + queue.AddRange(source); + + var result = new List>(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Select((v, i) => new KeyValuePair(i, v)) + .Concat(_testData.Select((v, i) => new KeyValuePair(i, v))) + .ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeSortedListShouldAddItemsInSortedOrder() + { + using var source = new RecyclableSortedList(); + for (int i = 0; i < _testData.Length; i++) + { + source.Add(i, _testData[i]); + } + + using var queue = new RecyclablePriorityQueue<(int Key, int Value)>(comparer: Comparer<(int Key, int Value)>.Create((a, b) => a.Key.CompareTo(b.Key))); + + queue.AddRange(source); + + var result = new List<(int Key, int Value)>(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Select((v, i) => (i, v)).ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeSortedListShouldNotOverrideItems() + { + using var source = new RecyclableSortedList(); + for (int i = 0; i < _testData.Length; i++) + { + source.Add(i, _testData[i]); + } + + using var queue = new RecyclablePriorityQueue<(int Key, int Value)>(comparer: Comparer<(int Key, int Value)>.Create((a, b) => a.Key.CompareTo(b.Key))); + + queue.AddRange(source); + queue.AddRange(source); + + var result = new List<(int Key, int Value)>(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Select((v, i) => (i, v)) + .Concat(_testData.Select((v, i) => (i, v))) + .OrderBy(p => p.Item1) + .ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeSortedDictionaryShouldAddItemsInSortedOrder() + { + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < _testData.Length; i++) + { + source.Add(i, _testData[i]); + } + + using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); + + queue.AddRange(source); + + var result = new List>(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Select((v, i) => new KeyValuePair(i, v)).ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeSortedDictionaryShouldNotOverrideItems() + { + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < _testData.Length; i++) + { + source.Add(i, _testData[i]); + } + + using var queue = new RecyclablePriorityQueue>(comparer: Comparer>.Create((a, b) => a.Key.CompareTo(b.Key))); + + queue.AddRange(source); + queue.AddRange(source); + + var result = new List>(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Select((v, i) => new KeyValuePair(i, v)) + .Concat(_testData.Select((v, i) => new KeyValuePair(i, v))) + .ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeEnumerableShouldAddItemsInSortedOrder() + { + using var queue = new RecyclablePriorityQueue(); + + _ = queue.AddRange((System.Collections.IEnumerable)_testData); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.OrderBy(v => v).ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeEnumerableShouldNotOverrideItems() + { + using var queue = new RecyclablePriorityQueue(); + + _ = queue.AddRange((System.Collections.IEnumerable)_testData); + _ = queue.AddRange((System.Collections.IEnumerable)_testData); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + var expected = _testData.Concat(_testData).OrderBy(v => v).ToList(); + _ = result.Should().Equal(expected); + } + + [Fact] + public void AddRangeReadOnlyCollectionShouldAddItemsInSortedOrder() + { + var source = new TestReadOnlyCollection(_testData); + using var queue = new RecyclablePriorityQueue(); + + queue.AddRange(source); + + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(_testData.OrderBy(static value => value)); + } + + [Fact] + public void AddRangeReadOnlyCollectionShouldNotOverrideItems() + { + var source = new TestReadOnlyCollection(_testData); + using var queue = new RecyclablePriorityQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + var expected = _testData.Concat(_testData).OrderBy(static value => value).ToArray(); + var result = new List(); + while (queue.LongCount > 0) + { + result.Add(queue.Dequeue()); + } + + _ = result.Should().Equal(expected); + } + + private sealed class TestReadOnlyCollection : IReadOnlyCollection + { + private readonly T[] _items; + + public TestReadOnlyCollection(T[] items) + { + _items = items; + } + + public int Count => _items.Length; + + public IEnumerator GetEnumerator() => ((IEnumerable)_items).GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => _items.GetEnumerator(); + } + } +} + diff --git a/Recyclable.CollectionsTests/RecyclableQueueTests.cs b/Recyclable.CollectionsTests/RecyclableQueueTests.cs index 00eb715..dcea230 100644 --- a/Recyclable.CollectionsTests/RecyclableQueueTests.cs +++ b/Recyclable.CollectionsTests/RecyclableQueueTests.cs @@ -1,662 +1,662 @@ -using FluentAssertions; -using Recyclable.Collections; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableQueueTests - { - private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" }; - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void ShouldNotBeSortedWhenCreated(int itemsCount) - { - // Act - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var list = new RecyclableQueue(data, 2); - - // Validate - _ = list.Should().HaveCount(itemsCount) - .And.ContainInConsecutiveOrder(data); - _ = list.LongCount.Should().Be(itemsCount); - } - - [Fact] - public void ShouldBeEmptyWhenNotInitialized() - { - // Act - using var list = new RecyclableQueue(2); - - // Validate - _ = list.Should().BeEmpty(); - _ = list.LongCount.Should().Be(0); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void ShouldNotBeSortedWhenInitialized(int itemsCount) - { - // Act - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var list = new RecyclableQueue(2) - { - // populate via collection initializer - }; - foreach (var item in data) - { - list.Enqueue(item); - } - - // Validate - if (itemsCount == 0) - { - _ = list.Should().BeEmpty(); - } - else - { - _ = list.Should().NotBeEmpty() - .And.ContainInConsecutiveOrder(data) - .And.BeEquivalentTo(data); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void ShouldBeEmptyAfterClear(int itemsCount) - { - // Prepare - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()); - using var list = new RecyclableQueue(data); - - // Act - list.Clear(); - - // Validate - _ = list.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void DequeueShouldReturnItemsInTheSameOrder(int itemsCount) - { - // Prepare - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var list = new RecyclableQueue(); - - // Act - for (var itemIdx = 0; itemIdx < data.Length; itemIdx++) - { - list.Enqueue(data[itemIdx]); - } - - var dequeuedItems = new RecyclableLongList(); - while (list.LongCount > 0) - { - dequeuedItems.Add(list.Dequeue()); - } - - // Validate - _ = dequeuedItems.Should().ContainInConsecutiveOrder(data) - .And.BeEquivalentTo(data); - } - - [Fact] - public void DequeueShoudRaiseArgumentOutOfRangeWhenNoMoreElementsFound() - { - // Prepare - using var list = new RecyclableQueue(_testData); - - // Act - while (list.LongCount > 0) - { - _ = list.Dequeue(); - } - - _ = Assert.Throws(() => list.Dequeue()); - _ = list.LongCount.Should().Be(0); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void GetEnumeratorShouldYieldAllItemsInTheSameOrder(int itemsCount) - { - // Prepare - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var list = new RecyclableQueue(data); - - // Act - var actual = new RecyclableLongList(); - using var enumerator = list.GetEnumerator(); - while (enumerator.MoveNext()) - { - actual.Add(enumerator.Current); - } - - // Validate - _ = actual.Should().ContainInConsecutiveOrder(data) - .And.BeEquivalentTo(data); - } - - [Fact] - public void AddRangeShouldAcceptNulls() - { - using var queue = new RecyclableQueue(); - queue.AddRange(new long?[] { null, default }); - _ = queue.Should().HaveCount(2).And.AllSatisfy(x => x.Should().BeNull()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - using var queue = new RecyclableQueue(); - - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((System.Collections.ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = queue.AddRange((System.Collections.IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange(new Span((long[])testData)); - } - else if (testData is long[] array) - { - queue.AddRange(array); - } - else if (testData is List list) - { - queue.AddRange(list); - } - else if (testData is RecyclableList rList) - { - queue.AddRange(rList); - } - else if (testData is RecyclableLongList rLongList) - { - queue.AddRange(rLongList); - } - else if (testData is IList iList) - { - queue.AddRange((ICollection)iList); - } - else if (testData is IEnumerable enumerable) - { - queue.AddRange(enumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - List expected = new(itemsCount); - expected.AddRange(testData); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, int itemsCount) - { - using var queue = new RecyclableQueue(); - - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((System.Collections.ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = queue.AddRange((System.Collections.IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange(new Span((long[])testData)); - } - else if (testData is long[] array) - { - queue.AddRange(array); - } - else if (testData is List list) - { - queue.AddRange(list); - } - else if (testData is RecyclableList rList) - { - queue.AddRange(rList); - } - else if (testData is RecyclableLongList rLongList) - { - queue.AddRange(rLongList); - } - else if (testData is IList iList) - { - queue.AddRange((ICollection)iList); - } - else if (testData is IEnumerable enumerable) - { - queue.AddRange(enumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - List expected = new(itemsCount); - expected.AddRange(testData); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, int itemsCount) - { - using var queue = new RecyclableQueue(); - itemsCount = checked(itemsCount << 1); - - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((Array)testData); - queue.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((System.Collections.ICollection)testData); - queue.AddRange((System.Collections.ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((ICollection)testData); - queue.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = queue.AddRange((System.Collections.IEnumerable)testData); - _ = queue.AddRange((System.Collections.IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - queue.AddRange((IReadOnlyList)testData); - queue.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - var span = new ReadOnlySpan((long[])testData); - queue.AddRange(span); - queue.AddRange(span); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - var span = new Span((long[])testData); - queue.AddRange(span); - queue.AddRange(span); - } - else if (testData is long[] array) - { - queue.AddRange(array); - queue.AddRange(array); - } - else if (testData is List list) - { - queue.AddRange(list); - queue.AddRange(list); - } - else if (testData is RecyclableList rList) - { - queue.AddRange(rList); - queue.AddRange(rList); - } - else if (testData is RecyclableLongList rLongList) - { - queue.AddRange(rLongList); - queue.AddRange(rLongList); - } - else if (testData is IList iList) - { - queue.AddRange((ICollection)iList); - queue.AddRange((ICollection)iList); - } - else if (testData is IEnumerable enumerable) - { - queue.AddRange(enumerable); - queue.AddRange(enumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - List expected = new(itemsCount); - expected.AddRange(testData); - expected.AddRange(testData); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddStackItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableStack(data); - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromStack(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableStack(data); - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedSetItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedSet(); - foreach (long item in data) - { - source.Add(item); - } - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedSet(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedSet(); - foreach (long item in data) - { - source.Add(item); - } - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddLinkedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLinkedList(data); - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromLinkedList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLinkedList(data); - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddPriorityQueueItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclablePriorityQueue(); - foreach (long item in data) - { - source.Enqueue(item); - } - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromPriorityQueue(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclablePriorityQueue(); - foreach (long item in data) - { - source.Enqueue(item); - } - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddQueueItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableQueue(data); - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(data); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromQueue(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableQueue(data); - using var queue = new RecyclableQueue(); - - queue.AddRange(source); - queue.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddDictionaryItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var queue = new RecyclableQueue>(); - - queue.AddRange(source); - - List> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromDictionary(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var queue = new RecyclableQueue>(); - - queue.AddRange(source); - queue.AddRange(source); - - List> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var queue = new RecyclableQueue<(int Key, long Value)>(); - - queue.AddRange(source); - - List<(int Key, long Value)> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - - _ = queue.Count.Should().Be(itemsCount); - _ = queue.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var queue = new RecyclableQueue<(int Key, long Value)>(); - - queue.AddRange(source); - queue.AddRange(source); - - List<(int Key, long Value)> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - - _ = queue.Count.Should().Be(itemsCount * 2); - _ = queue.Should().Equal(expected); - } - } -} +using FluentAssertions; +using Recyclable.Collections; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableQueueTests + { + private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" }; + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void ShouldNotBeSortedWhenCreated(int itemsCount) + { + // Act + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var list = new RecyclableQueue(data, 2); + + // Validate + _ = list.Should().HaveCount(itemsCount) + .And.ContainInConsecutiveOrder(data); + _ = list.LongCount.Should().Be(itemsCount); + } + + [Fact] + public void ShouldBeEmptyWhenNotInitialized() + { + // Act + using var list = new RecyclableQueue(2); + + // Validate + _ = list.Should().BeEmpty(); + _ = list.LongCount.Should().Be(0); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void ShouldNotBeSortedWhenInitialized(int itemsCount) + { + // Act + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var list = new RecyclableQueue(2) + { + // populate via collection initializer + }; + foreach (var item in data) + { + list.Enqueue(item); + } + + // Validate + if (itemsCount == 0) + { + _ = list.Should().BeEmpty(); + } + else + { + _ = list.Should().NotBeEmpty() + .And.ContainInConsecutiveOrder(data) + .And.BeEquivalentTo(data); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void ShouldBeEmptyAfterClear(int itemsCount) + { + // Prepare + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()); + using var list = new RecyclableQueue(data); + + // Act + list.Clear(); + + // Validate + _ = list.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void DequeueShouldReturnItemsInTheSameOrder(int itemsCount) + { + // Prepare + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var list = new RecyclableQueue(); + + // Act + for (var itemIdx = 0; itemIdx < data.Length; itemIdx++) + { + list.Enqueue(data[itemIdx]); + } + + var dequeuedItems = new RecyclableLongList(); + while (list.LongCount > 0) + { + dequeuedItems.Add(list.Dequeue()); + } + + // Validate + _ = dequeuedItems.Should().ContainInConsecutiveOrder(data) + .And.BeEquivalentTo(data); + } + + [Fact] + public void DequeueShoudRaiseArgumentOutOfRangeWhenNoMoreElementsFound() + { + // Prepare + using var list = new RecyclableQueue(_testData); + + // Act + while (list.LongCount > 0) + { + _ = list.Dequeue(); + } + + _ = Assert.Throws(() => list.Dequeue()); + _ = list.LongCount.Should().Be(0); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void GetEnumeratorShouldYieldAllItemsInTheSameOrder(int itemsCount) + { + // Prepare + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var list = new RecyclableQueue(data); + + // Act + var actual = new RecyclableLongList(); + using var enumerator = list.GetEnumerator(); + while (enumerator.MoveNext()) + { + actual.Add(enumerator.Current); + } + + // Validate + _ = actual.Should().ContainInConsecutiveOrder(data) + .And.BeEquivalentTo(data); + } + + [Fact] + public void AddRangeShouldAcceptNulls() + { + using var queue = new RecyclableQueue(); + queue.AddRange(new long?[] { null, default }); + _ = queue.Should().HaveCount(2).And.AllSatisfy(x => x.Should().BeNull()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + using var queue = new RecyclableQueue(); + + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((System.Collections.ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = queue.AddRange((System.Collections.IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange(new Span((long[])testData)); + } + else if (testData is long[] array) + { + queue.AddRange(array); + } + else if (testData is List list) + { + queue.AddRange(list); + } + else if (testData is RecyclableList rList) + { + queue.AddRange(rList); + } + else if (testData is RecyclableLongList rLongList) + { + queue.AddRange(rLongList); + } + else if (testData is IList iList) + { + queue.AddRange((ICollection)iList); + } + else if (testData is IEnumerable enumerable) + { + queue.AddRange(enumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + List expected = new(itemsCount); + expected.AddRange(testData); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, int itemsCount) + { + using var queue = new RecyclableQueue(); + + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((System.Collections.ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = queue.AddRange((System.Collections.IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange(new Span((long[])testData)); + } + else if (testData is long[] array) + { + queue.AddRange(array); + } + else if (testData is List list) + { + queue.AddRange(list); + } + else if (testData is RecyclableList rList) + { + queue.AddRange(rList); + } + else if (testData is RecyclableLongList rLongList) + { + queue.AddRange(rLongList); + } + else if (testData is IList iList) + { + queue.AddRange((ICollection)iList); + } + else if (testData is IEnumerable enumerable) + { + queue.AddRange(enumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + List expected = new(itemsCount); + expected.AddRange(testData); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, int itemsCount) + { + using var queue = new RecyclableQueue(); + itemsCount = checked(itemsCount << 1); + + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((Array)testData); + queue.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((System.Collections.ICollection)testData); + queue.AddRange((System.Collections.ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((ICollection)testData); + queue.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = queue.AddRange((System.Collections.IEnumerable)testData); + _ = queue.AddRange((System.Collections.IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + queue.AddRange((IReadOnlyList)testData); + queue.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + var span = new ReadOnlySpan((long[])testData); + queue.AddRange(span); + queue.AddRange(span); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + var span = new Span((long[])testData); + queue.AddRange(span); + queue.AddRange(span); + } + else if (testData is long[] array) + { + queue.AddRange(array); + queue.AddRange(array); + } + else if (testData is List list) + { + queue.AddRange(list); + queue.AddRange(list); + } + else if (testData is RecyclableList rList) + { + queue.AddRange(rList); + queue.AddRange(rList); + } + else if (testData is RecyclableLongList rLongList) + { + queue.AddRange(rLongList); + queue.AddRange(rLongList); + } + else if (testData is IList iList) + { + queue.AddRange((ICollection)iList); + queue.AddRange((ICollection)iList); + } + else if (testData is IEnumerable enumerable) + { + queue.AddRange(enumerable); + queue.AddRange(enumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + List expected = new(itemsCount); + expected.AddRange(testData); + expected.AddRange(testData); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddStackItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableStack(data); + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromStack(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableStack(data); + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedSetItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedSet(); + foreach (long item in data) + { + source.Add(item); + } + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedSet(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedSet(); + foreach (long item in data) + { + source.Add(item); + } + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddLinkedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLinkedList(data); + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromLinkedList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLinkedList(data); + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddPriorityQueueItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclablePriorityQueue(); + foreach (long item in data) + { + source.Enqueue(item); + } + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromPriorityQueue(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclablePriorityQueue(); + foreach (long item in data) + { + source.Enqueue(item); + } + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddQueueItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableQueue(data); + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(data); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromQueue(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableQueue(data); + using var queue = new RecyclableQueue(); + + queue.AddRange(source); + queue.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddDictionaryItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var queue = new RecyclableQueue>(); + + queue.AddRange(source); + + List> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromDictionary(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var queue = new RecyclableQueue>(); + + queue.AddRange(source); + queue.AddRange(source); + + List> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var queue = new RecyclableQueue<(int Key, long Value)>(); + + queue.AddRange(source); + + List<(int Key, long Value)> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + + _ = queue.Count.Should().Be(itemsCount); + _ = queue.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var queue = new RecyclableQueue<(int Key, long Value)>(); + + queue.AddRange(source); + queue.AddRange(source); + + List<(int Key, long Value)> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + + _ = queue.Count.Should().Be(itemsCount * 2); + _ = queue.Should().Equal(expected); + } + } +} diff --git a/Recyclable.CollectionsTests/RecyclableSortedDictionaryTests.cs b/Recyclable.CollectionsTests/RecyclableSortedDictionaryTests.cs index 8fa94c2..bd5f098 100644 --- a/Recyclable.CollectionsTests/RecyclableSortedDictionaryTests.cs +++ b/Recyclable.CollectionsTests/RecyclableSortedDictionaryTests.cs @@ -1,96 +1,96 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableSortedDictionaryTests - { - [Fact] - public void AddShouldStoreUniqueItemsInOrder() - { - using var dict = new RecyclableSortedDictionary(); - var values = new[] { 4, 1, 3, 2, 5 }; - foreach (var v in values) - { - dict.Add(v, v); - } - - var result = new List(); - foreach (var kv in dict) - { - result.Add(kv.Key); - } - - _ = result.Should().Equal(values.OrderBy(x => x)); - } - - [Fact] - public void IndexerShouldUpdateValue() - { - using var dict = new RecyclableSortedDictionary(); - dict.Add(1, "a"); - - dict[1] = "b"; - - _ = dict[1].Should().Be("b"); - } - - [Fact] - public void RemoveShouldDeleteItem() - { - using var dict = new RecyclableSortedDictionary(); - var values = new[] { 4, 1, 3, 2, 5 }; - foreach (var v in values) - { - dict.Add(v, v.ToString()); - } - - dict.Remove(3).Should().BeTrue(); - _ = dict.ContainsKey(3).Should().BeFalse(); - _ = dict.Count.Should().Be(values.Length - 1); - } - - [Fact] - public void EnumeratorShouldYieldItemsInOrder() - { - using var dict = new RecyclableSortedDictionary(); - foreach (var v in new[] { 3, 1, 4, 2 }) - { - dict.Add(v, v); - } - - var result = new List(); - foreach (var item in dict) - { - result.Add(item.Key); - } - - _ = result.Should().Equal(new[] { 1, 2, 3, 4 }); - } - - [Fact] - public void TryGetValueShouldReturnValue() - { - using var dict = new RecyclableSortedDictionary(); - dict.Add(1, "a"); - - var found = dict.TryGetValue(1, out var value); - - _ = found.Should().BeTrue(); - _ = value.Should().Be("a"); - } - - [Fact] - public void ShouldBeEmptyAfterClear() - { - using var dict = new RecyclableSortedDictionary(); - dict.Add(1, 1); - dict.Add(2, 2); - - dict.Clear(); - _ = dict.Should().BeEmpty(); - } - } -} +using FluentAssertions; +using Recyclable.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableSortedDictionaryTests + { + [Fact] + public void AddShouldStoreUniqueItemsInOrder() + { + using var dict = new RecyclableSortedDictionary(); + var values = new[] { 4, 1, 3, 2, 5 }; + foreach (var v in values) + { + dict.Add(v, v); + } + + var result = new List(); + foreach (var kv in dict) + { + result.Add(kv.Key); + } + + _ = result.Should().Equal(values.OrderBy(x => x)); + } + + [Fact] + public void IndexerShouldUpdateValue() + { + using var dict = new RecyclableSortedDictionary(); + dict.Add(1, "a"); + + dict[1] = "b"; + + _ = dict[1].Should().Be("b"); + } + + [Fact] + public void RemoveShouldDeleteItem() + { + using var dict = new RecyclableSortedDictionary(); + var values = new[] { 4, 1, 3, 2, 5 }; + foreach (var v in values) + { + dict.Add(v, v.ToString()); + } + + dict.Remove(3).Should().BeTrue(); + _ = dict.ContainsKey(3).Should().BeFalse(); + _ = dict.Count.Should().Be(values.Length - 1); + } + + [Fact] + public void EnumeratorShouldYieldItemsInOrder() + { + using var dict = new RecyclableSortedDictionary(); + foreach (var v in new[] { 3, 1, 4, 2 }) + { + dict.Add(v, v); + } + + var result = new List(); + foreach (var item in dict) + { + result.Add(item.Key); + } + + _ = result.Should().Equal(new[] { 1, 2, 3, 4 }); + } + + [Fact] + public void TryGetValueShouldReturnValue() + { + using var dict = new RecyclableSortedDictionary(); + dict.Add(1, "a"); + + var found = dict.TryGetValue(1, out var value); + + _ = found.Should().BeTrue(); + _ = value.Should().Be("a"); + } + + [Fact] + public void ShouldBeEmptyAfterClear() + { + using var dict = new RecyclableSortedDictionary(); + dict.Add(1, 1); + dict.Add(2, 2); + + dict.Clear(); + _ = dict.Should().BeEmpty(); + } + } +} diff --git a/Recyclable.CollectionsTests/RecyclableSortedListTests.cs b/Recyclable.CollectionsTests/RecyclableSortedListTests.cs index e9580b0..db4c74e 100644 --- a/Recyclable.CollectionsTests/RecyclableSortedListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableSortedListTests.cs @@ -1,97 +1,97 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Linq; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableSortedListTests - { - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddShouldStoreItemsSorted(int itemsCount) - { - using var list = new RecyclableSortedList(); - foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount).Reverse()) - { - list.Add(key, -key); - } - - _ = list.Should().HaveCount(itemsCount) - .And.BeInAscendingOrder(x => x.Key); - for (int i = 0; i < itemsCount; i++) - { - long expectedKey = i + 1; - list.GetKey(i).Should().Be(expectedKey); - list.GetValue(i).Should().Be(-expectedKey); - } - } - - [Fact] - public void IndexerShouldUpdateValue() - { - using var list = new RecyclableSortedList(); - list.Add(1, "a"); - - list[1] = "b"; - - _ = list[1].Should().Be("b"); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void RemoveShouldDeleteItem(int itemsCount) - { - using var list = new RecyclableSortedList(); - foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) - { - list.Add(key, key); - } - - if (itemsCount > 0) - { - long keyToRemove = (itemsCount + 1) / 2; - list.Remove(keyToRemove).Should().BeTrue(); - _ = list.ContainsKey(keyToRemove).Should().BeFalse(); - _ = list.Should().HaveCount(itemsCount - 1); - } - else - { - list.Remove(0).Should().BeFalse(); - _ = list.Should().BeEmpty(); - } - } - - [Fact] - public void TryGetValueShouldReturnValue() - { - using var list = new RecyclableSortedList(); - list.Add(1, "a"); - - var found = list.TryGetValue(1, out var value); - - _ = found.Should().BeTrue(); - _ = value.Should().Be("a"); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void EnumeratorShouldYieldItemsSorted(int itemsCount) - { - using var list = new RecyclableSortedList(); - foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount).Reverse()) - { - list.Add(key, key); - } - - var actual = new List(); - var enumerator = list.GetEnumerator(); - while (enumerator.MoveNext()) - { - actual.Add(enumerator.Current.Key); - } - - var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToList(); - _ = actual.Should().ContainInConsecutiveOrder(expected); - } - } -} +using FluentAssertions; +using Recyclable.Collections; +using System.Linq; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableSortedListTests + { + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddShouldStoreItemsSorted(int itemsCount) + { + using var list = new RecyclableSortedList(); + foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount).Reverse()) + { + list.Add(key, -key); + } + + _ = list.Should().HaveCount(itemsCount) + .And.BeInAscendingOrder(x => x.Key); + for (int i = 0; i < itemsCount; i++) + { + long expectedKey = i + 1; + list.GetKey(i).Should().Be(expectedKey); + list.GetValue(i).Should().Be(-expectedKey); + } + } + + [Fact] + public void IndexerShouldUpdateValue() + { + using var list = new RecyclableSortedList(); + list.Add(1, "a"); + + list[1] = "b"; + + _ = list[1].Should().Be("b"); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void RemoveShouldDeleteItem(int itemsCount) + { + using var list = new RecyclableSortedList(); + foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount)) + { + list.Add(key, key); + } + + if (itemsCount > 0) + { + long keyToRemove = (itemsCount + 1) / 2; + list.Remove(keyToRemove).Should().BeTrue(); + _ = list.ContainsKey(keyToRemove).Should().BeFalse(); + _ = list.Should().HaveCount(itemsCount - 1); + } + else + { + list.Remove(0).Should().BeFalse(); + _ = list.Should().BeEmpty(); + } + } + + [Fact] + public void TryGetValueShouldReturnValue() + { + using var list = new RecyclableSortedList(); + list.Add(1, "a"); + + var found = list.TryGetValue(1, out var value); + + _ = found.Should().BeTrue(); + _ = value.Should().Be("a"); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void EnumeratorShouldYieldItemsSorted(int itemsCount) + { + using var list = new RecyclableSortedList(); + foreach (var key in RecyclableLongListTestData.CreateTestData(itemsCount).Reverse()) + { + list.Add(key, key); + } + + var actual = new List(); + var enumerator = list.GetEnumerator(); + while (enumerator.MoveNext()) + { + actual.Add(enumerator.Current.Key); + } + + var expected = RecyclableLongListTestData.CreateTestData(itemsCount).ToList(); + _ = actual.Should().ContainInConsecutiveOrder(expected); + } + } +} diff --git a/Recyclable.CollectionsTests/RecyclableSortedSetTests.cs b/Recyclable.CollectionsTests/RecyclableSortedSetTests.cs index 7563169..20bd9b8 100644 --- a/Recyclable.CollectionsTests/RecyclableSortedSetTests.cs +++ b/Recyclable.CollectionsTests/RecyclableSortedSetTests.cs @@ -1,68 +1,68 @@ -using FluentAssertions; -using Recyclable.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableSortedSetTests - { - [Fact] - public void AddShouldStoreUniqueItemsInOrder() - { - using var set = new RecyclableSortedSet(); - var values = new[] { 4, 1, 3, 2, 5 }; - foreach (var v in values) - { - set.Add(v).Should().BeTrue(); - } - - set.Add(3).Should().BeFalse(); - _ = set.Should().Equal(values.OrderBy(x => x)); - } - - [Fact] - public void RemoveShouldDeleteItem() - { - using var set = new RecyclableSortedSet(); - var values = new[] { 4, 1, 3, 2, 5 }; - foreach (var v in values) - { - set.Add(v); - } - - set.Remove(3).Should().BeTrue(); - _ = set.Contains(3).Should().BeFalse(); - _ = set.Should().Equal(values.Where(x => x != 3).OrderBy(x => x)); - } - - [Fact] - public void EnumeratorShouldYieldItemsInOrder() - { - using var set = new RecyclableSortedSet(); - foreach (var v in new[] { 3, 1, 4, 2 }) - { - set.Add(v); - } - - var result = new List(); - foreach (var item in set) - { - result.Add(item); - } - - _ = result.Should().Equal(new[] { 1, 2, 3, 4 }); - } - - [Fact] - public void ShouldBeEmptyAfterClear() - { - using var set = new RecyclableSortedSet(); - set.Add(1); - set.Add(2); - - set.Clear(); - _ = set.Should().BeEmpty(); - } - } -} +using FluentAssertions; +using Recyclable.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableSortedSetTests + { + [Fact] + public void AddShouldStoreUniqueItemsInOrder() + { + using var set = new RecyclableSortedSet(); + var values = new[] { 4, 1, 3, 2, 5 }; + foreach (var v in values) + { + set.Add(v).Should().BeTrue(); + } + + set.Add(3).Should().BeFalse(); + _ = set.Should().Equal(values.OrderBy(x => x)); + } + + [Fact] + public void RemoveShouldDeleteItem() + { + using var set = new RecyclableSortedSet(); + var values = new[] { 4, 1, 3, 2, 5 }; + foreach (var v in values) + { + set.Add(v); + } + + set.Remove(3).Should().BeTrue(); + _ = set.Contains(3).Should().BeFalse(); + _ = set.Should().Equal(values.Where(x => x != 3).OrderBy(x => x)); + } + + [Fact] + public void EnumeratorShouldYieldItemsInOrder() + { + using var set = new RecyclableSortedSet(); + foreach (var v in new[] { 3, 1, 4, 2 }) + { + set.Add(v); + } + + var result = new List(); + foreach (var item in set) + { + result.Add(item); + } + + _ = result.Should().Equal(new[] { 1, 2, 3, 4 }); + } + + [Fact] + public void ShouldBeEmptyAfterClear() + { + using var set = new RecyclableSortedSet(); + set.Add(1); + set.Add(2); + + set.Clear(); + _ = set.Should().BeEmpty(); + } + } +} diff --git a/Recyclable.CollectionsTests/RecyclableStackTests.cs b/Recyclable.CollectionsTests/RecyclableStackTests.cs index 96cd5ee..90d2633 100644 --- a/Recyclable.CollectionsTests/RecyclableStackTests.cs +++ b/Recyclable.CollectionsTests/RecyclableStackTests.cs @@ -1,817 +1,817 @@ -using FluentAssertions; -using Recyclable.Collections; - -namespace Recyclable.CollectionsTests -{ - public class RecyclableStackTests - { - private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" }; - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void GetEnumeratorShouldYieldAllItemsInReversedOrder(int itemsCount) - { - // Prepare - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var list = new RecyclableStack(data); - - // Act - var actual = new RecyclableLongList(); - using var enumerator = list.GetEnumerator(); - while (enumerator.MoveNext()) - { - actual.Add(enumerator.Current); - } - - // Validate - _ = actual.Should().ContainInConsecutiveOrder(data.Reverse()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void ShouldNotBeSortedWhenCreated(int itemsCount) - { - // Act - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var sortedList = new RecyclableStack(data, 2); - - // Validate - _ = sortedList.Should().HaveCount(itemsCount) - .And.ContainInConsecutiveOrder(data.Reverse()); - } - - [Fact] - public void ShouldBeEmptyWhenNotInitialized() - { - // Act - using var sortedList = new RecyclableStack(2); - - // Validate - _ = sortedList.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void ShouldNotBeSortedWhenInitialized(int itemsCount) - { - // Act - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var sortedList = new RecyclableStack(2); - foreach (var item in data) - { - sortedList.Push(item); - } - - // Validate - if (itemsCount == 0) - { - _ = sortedList.Should().BeEmpty(); - } - else - { - _ = sortedList.Should().NotBeEmpty() - .And.ContainInConsecutiveOrder(data.Reverse()) - .And.BeEquivalentTo(data); - } - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void ShouldBeEmptyAfterClear(int itemsCount) - { - // Prepare - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - using var sortedList = new RecyclableStack(data); - - // Act - sortedList.Clear(); - - // Validate - _ = sortedList.Should().BeEmpty(); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void PopShouldReturnItemsInReversedOrder(int itemsCount) - { - // Prepare - using var list = new RecyclableStack(); - - // Act - var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); - for (var itemIdx = 0; itemIdx < data.Length; itemIdx++) - { - list.Push(data[itemIdx]); - } - - var dequeuedItems = new RecyclableLongList(); - while (list.LongCount > 0) - { - dequeuedItems.Add(list.Pop()); - } - - // Validate - _ = dequeuedItems.Should().ContainInConsecutiveOrder(data.Reverse()); - } - - [Fact] - public void PopShouldRaiseArgumentOutOfRangeWhenNoMoreElementsFound() - { - // Prepare - using var list = new RecyclableStack(_testData); - - // Act - while (list.LongCount > 0) - { - _ = list.Pop(); - } - - _ = Assert.Throws(() => list.Pop()); - } - [Fact] - public void AddRangeShouldAcceptNulls() - { - using var stack = new RecyclableStack(); - stack.AddRange(new long?[] { null, default }); - _ = stack.Should().HaveCount(2).And.AllSatisfy(x => x.Should().BeNull()); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) - { - using var stack = new RecyclableStack(); - - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((System.Collections.ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = stack.AddRange((System.Collections.IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange(new Span((long[])testData)); - } - else if (testData is long[] array) - { - stack.AddRange(array); - } - else if (testData is List list) - { - stack.AddRange(list); - } - else if (testData is RecyclableList rList) - { - stack.AddRange(rList); - } - else if (testData is RecyclableLongList rLongList) - { - stack.AddRange(rLongList); - } - else if (testData is IList iList) - { - stack.AddRange((ICollection)iList); - } - else if (testData is IEnumerable enumerable) - { - stack.AddRange(enumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - List expected = new(itemsCount); - expected.AddRange(testData); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, int itemsCount) - { - using var stack = new RecyclableStack(); - - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((System.Collections.ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = stack.AddRange((System.Collections.IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange(new ReadOnlySpan((long[])testData)); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange(new Span((long[])testData)); - } - else if (testData is long[] array) - { - stack.AddRange(array); - } - else if (testData is List list) - { - stack.AddRange(list); - } - else if (testData is RecyclableList rList) - { - stack.AddRange(rList); - } - else if (testData is RecyclableLongList rLongList) - { - stack.AddRange(rLongList); - } - else if (testData is IList iList) - { - stack.AddRange((ICollection)iList); - } - else if (testData is IEnumerable enumerable) - { - stack.AddRange(enumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - List expected = new(itemsCount); - expected.AddRange(testData); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, int itemsCount) - { - using var stack = new RecyclableStack(); - itemsCount = checked(itemsCount << 1); - - if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((Array)testData); - stack.AddRange((Array)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((System.Collections.ICollection)testData); - stack.AddRange((System.Collections.ICollection)testData); - } - else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((ICollection)testData); - stack.AddRange((ICollection)testData); - } - else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) - { - _ = stack.AddRange((System.Collections.IEnumerable)testData); - _ = stack.AddRange((System.Collections.IEnumerable)testData); - } - else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) - { - stack.AddRange((IReadOnlyList)testData); - stack.AddRange((IReadOnlyList)testData); - } - else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) - { - var span = new ReadOnlySpan((long[])testData); - stack.AddRange(span); - stack.AddRange(span); - } - else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) - { - var span = new Span((long[])testData); - stack.AddRange(span); - stack.AddRange(span); - } - else if (testData is long[] array) - { - stack.AddRange(array); - stack.AddRange(array); - } - else if (testData is List list) - { - stack.AddRange(list); - stack.AddRange(list); - } - else if (testData is RecyclableList rList) - { - stack.AddRange(rList); - stack.AddRange(rList); - } - else if (testData is RecyclableLongList rLongList) - { - stack.AddRange(rLongList); - stack.AddRange(rLongList); - } - else if (testData is IList iList) - { - stack.AddRange((ICollection)iList); - stack.AddRange((ICollection)iList); - } - else if (testData is IEnumerable enumerable) - { - stack.AddRange(enumerable); - stack.AddRange(enumerable); - } - else - { - throw new InvalidCastException("Unknown type of test data"); - } - - List expected = new(itemsCount); - expected.AddRange(testData); - expected.AddRange(testData); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableList(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableList(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddLongListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLongList(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromLongList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLongList(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddHashSetItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableHashSet(); - foreach (long item in data) - { - source.Add(item); - } - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromHashSet(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableHashSet(); - foreach (long item in data) - { - source.Add(item); - } - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddStackItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableStack(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromStack(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableStack(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedSetItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedSet(); - foreach (long item in data) - { - source.Add(item); - } - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedSet(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedSet(); - foreach (long item in data) - { - source.Add(item); - } - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddLinkedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLinkedList(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromLinkedList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableLinkedList(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddQueueItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableQueue(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - - List expected = new(itemsCount); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromQueue(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableQueue(data); - using var stack = new RecyclableStack(); - - stack.AddRange(source); - stack.AddRange(source); - - List expected = new(itemsCount * 2); - expected.AddRange(data); - expected.AddRange(data); - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddDictionaryItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var stack = new RecyclableStack>(); - - stack.AddRange(source); - - List> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromDictionary(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var stack = new RecyclableStack>(); - - stack.AddRange(source); - stack.AddRange(source); - - List> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var stack = new RecyclableStack<(int Key, long Value)>(); - - stack.AddRange(source); - - List<(int Key, long Value)> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedList(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedList(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var stack = new RecyclableStack<(int Key, long Value)>(); - - stack.AddRange(source); - stack.AddRange(source); - - List<(int Key, long Value)> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add((i, data[i])); - } - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldAddSortedDictionaryItemsInCorrectOrder(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var stack = new RecyclableStack>(); - - stack.AddRange(source); - - List> expected = new(itemsCount); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount); - _ = stack.Should().Equal(expected); - } - - [Theory] - [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] - public void AddRangeShouldNotOverrideItemsFromSortedDictionary(int itemsCount) - { - long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); - using var source = new RecyclableSortedDictionary(); - for (int i = 0; i < data.Length; i++) - { - source.Add(i, data[i]); - } - using var stack = new RecyclableStack>(); - - stack.AddRange(source); - stack.AddRange(source); - - List> expected = new(itemsCount * 2); - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - for (int i = 0; i < data.Length; i++) - { - expected.Add(new KeyValuePair(i, data[i])); - } - expected.Reverse(); - - _ = stack.Count.Should().Be(itemsCount * 2); - _ = stack.Should().Equal(expected); - } - - } -} +using FluentAssertions; +using Recyclable.Collections; + +namespace Recyclable.CollectionsTests +{ + public class RecyclableStackTests + { + private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" }; + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void GetEnumeratorShouldYieldAllItemsInReversedOrder(int itemsCount) + { + // Prepare + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var list = new RecyclableStack(data); + + // Act + var actual = new RecyclableLongList(); + using var enumerator = list.GetEnumerator(); + while (enumerator.MoveNext()) + { + actual.Add(enumerator.Current); + } + + // Validate + _ = actual.Should().ContainInConsecutiveOrder(data.Reverse()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void ShouldNotBeSortedWhenCreated(int itemsCount) + { + // Act + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var sortedList = new RecyclableStack(data, 2); + + // Validate + _ = sortedList.Should().HaveCount(itemsCount) + .And.ContainInConsecutiveOrder(data.Reverse()); + } + + [Fact] + public void ShouldBeEmptyWhenNotInitialized() + { + // Act + using var sortedList = new RecyclableStack(2); + + // Validate + _ = sortedList.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void ShouldNotBeSortedWhenInitialized(int itemsCount) + { + // Act + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var sortedList = new RecyclableStack(2); + foreach (var item in data) + { + sortedList.Push(item); + } + + // Validate + if (itemsCount == 0) + { + _ = sortedList.Should().BeEmpty(); + } + else + { + _ = sortedList.Should().NotBeEmpty() + .And.ContainInConsecutiveOrder(data.Reverse()) + .And.BeEquivalentTo(data); + } + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void ShouldBeEmptyAfterClear(int itemsCount) + { + // Prepare + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + using var sortedList = new RecyclableStack(data); + + // Act + sortedList.Clear(); + + // Validate + _ = sortedList.Should().BeEmpty(); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void PopShouldReturnItemsInReversedOrder(int itemsCount) + { + // Prepare + using var list = new RecyclableStack(); + + // Act + var data = RecyclableLongListTestData.CreateTestData(itemsCount).Select(i => i.ToString()).ToArray(); + for (var itemIdx = 0; itemIdx < data.Length; itemIdx++) + { + list.Push(data[itemIdx]); + } + + var dequeuedItems = new RecyclableLongList(); + while (list.LongCount > 0) + { + dequeuedItems.Add(list.Pop()); + } + + // Validate + _ = dequeuedItems.Should().ContainInConsecutiveOrder(data.Reverse()); + } + + [Fact] + public void PopShouldRaiseArgumentOutOfRangeWhenNoMoreElementsFound() + { + // Prepare + using var list = new RecyclableStack(_testData); + + // Act + while (list.LongCount > 0) + { + _ = list.Pop(); + } + + _ = Assert.Throws(() => list.Pop()); + } + [Fact] + public void AddRangeShouldAcceptNulls() + { + using var stack = new RecyclableStack(); + stack.AddRange(new long?[] { null, default }); + _ = stack.Should().HaveCount(2).And.AllSatisfy(x => x.Should().BeNull()); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddItemsInCorrectOrder(string testCase, IEnumerable testData, int itemsCount) + { + using var stack = new RecyclableStack(); + + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((System.Collections.ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = stack.AddRange((System.Collections.IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange(new Span((long[])testData)); + } + else if (testData is long[] array) + { + stack.AddRange(array); + } + else if (testData is List list) + { + stack.AddRange(list); + } + else if (testData is RecyclableList rList) + { + stack.AddRange(rList); + } + else if (testData is RecyclableLongList rLongList) + { + stack.AddRange(rLongList); + } + else if (testData is IList iList) + { + stack.AddRange((ICollection)iList); + } + else if (testData is IEnumerable enumerable) + { + stack.AddRange(enumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + List expected = new(itemsCount); + expected.AddRange(testData); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.EmptySourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldDoNothingWhenSourceIsEmpty(string testCase, IEnumerable testData, int itemsCount) + { + using var stack = new RecyclableStack(); + + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((System.Collections.ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = stack.AddRange((System.Collections.IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange(new ReadOnlySpan((long[])testData)); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange(new Span((long[])testData)); + } + else if (testData is long[] array) + { + stack.AddRange(array); + } + else if (testData is List list) + { + stack.AddRange(list); + } + else if (testData is RecyclableList rList) + { + stack.AddRange(rList); + } + else if (testData is RecyclableLongList rLongList) + { + stack.AddRange(rLongList); + } + else if (testData is IList iList) + { + stack.AddRange((ICollection)iList); + } + else if (testData is IEnumerable enumerable) + { + stack.AddRange(enumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + List expected = new(itemsCount); + expected.AddRange(testData); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.SourceDataVariants), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItems(string testCase, IEnumerable testData, int itemsCount) + { + using var stack = new RecyclableStack(); + itemsCount = checked(itemsCount << 1); + + if (testCase.Contains("Array[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((Array)testData); + stack.AddRange((Array)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((System.Collections.ICollection)testData); + stack.AddRange((System.Collections.ICollection)testData); + } + else if (testCase.Contains("ICollection[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((ICollection)testData); + stack.AddRange((ICollection)testData); + } + else if (testCase.Contains("IEnumerable[", StringComparison.OrdinalIgnoreCase)) + { + _ = stack.AddRange((System.Collections.IEnumerable)testData); + _ = stack.AddRange((System.Collections.IEnumerable)testData); + } + else if (testCase.Contains("IReadOnlyList[", StringComparison.OrdinalIgnoreCase)) + { + stack.AddRange((IReadOnlyList)testData); + stack.AddRange((IReadOnlyList)testData); + } + else if (testCase.Contains("ReadOnlySpan[", StringComparison.OrdinalIgnoreCase)) + { + var span = new ReadOnlySpan((long[])testData); + stack.AddRange(span); + stack.AddRange(span); + } + else if (testCase.Contains("Span[", StringComparison.OrdinalIgnoreCase)) + { + var span = new Span((long[])testData); + stack.AddRange(span); + stack.AddRange(span); + } + else if (testData is long[] array) + { + stack.AddRange(array); + stack.AddRange(array); + } + else if (testData is List list) + { + stack.AddRange(list); + stack.AddRange(list); + } + else if (testData is RecyclableList rList) + { + stack.AddRange(rList); + stack.AddRange(rList); + } + else if (testData is RecyclableLongList rLongList) + { + stack.AddRange(rLongList); + stack.AddRange(rLongList); + } + else if (testData is IList iList) + { + stack.AddRange((ICollection)iList); + stack.AddRange((ICollection)iList); + } + else if (testData is IEnumerable enumerable) + { + stack.AddRange(enumerable); + stack.AddRange(enumerable); + } + else + { + throw new InvalidCastException("Unknown type of test data"); + } + + List expected = new(itemsCount); + expected.AddRange(testData); + expected.AddRange(testData); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableList(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableList(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddLongListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLongList(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromLongList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLongList(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddHashSetItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableHashSet(); + foreach (long item in data) + { + source.Add(item); + } + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromHashSet(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableHashSet(); + foreach (long item in data) + { + source.Add(item); + } + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddStackItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableStack(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromStack(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableStack(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedSetItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedSet(); + foreach (long item in data) + { + source.Add(item); + } + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedSet(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedSet(); + foreach (long item in data) + { + source.Add(item); + } + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddLinkedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLinkedList(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromLinkedList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableLinkedList(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddQueueItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableQueue(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + + List expected = new(itemsCount); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromQueue(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableQueue(data); + using var stack = new RecyclableStack(); + + stack.AddRange(source); + stack.AddRange(source); + + List expected = new(itemsCount * 2); + expected.AddRange(data); + expected.AddRange(data); + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddDictionaryItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var stack = new RecyclableStack>(); + + stack.AddRange(source); + + List> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromDictionary(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var stack = new RecyclableStack>(); + + stack.AddRange(source); + stack.AddRange(source); + + List> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedListItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var stack = new RecyclableStack<(int Key, long Value)>(); + + stack.AddRange(source); + + List<(int Key, long Value)> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedList(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedList(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var stack = new RecyclableStack<(int Key, long Value)>(); + + stack.AddRange(source); + stack.AddRange(source); + + List<(int Key, long Value)> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add((i, data[i])); + } + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldAddSortedDictionaryItemsInCorrectOrder(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var stack = new RecyclableStack>(); + + stack.AddRange(source); + + List> expected = new(itemsCount); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount); + _ = stack.Should().Equal(expected); + } + + [Theory] + [MemberData(nameof(RecyclableLongListTestData.ItemsCountTestCases), MemberType = typeof(RecyclableLongListTestData))] + public void AddRangeShouldNotOverrideItemsFromSortedDictionary(int itemsCount) + { + long[] data = RecyclableLongListTestData.CreateTestData(itemsCount).ToArray(); + using var source = new RecyclableSortedDictionary(); + for (int i = 0; i < data.Length; i++) + { + source.Add(i, data[i]); + } + using var stack = new RecyclableStack>(); + + stack.AddRange(source); + stack.AddRange(source); + + List> expected = new(itemsCount * 2); + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + for (int i = 0; i < data.Length; i++) + { + expected.Add(new KeyValuePair(i, data[i])); + } + expected.Reverse(); + + _ = stack.Count.Should().Be(itemsCount * 2); + _ = stack.Should().Equal(expected); + } + + } +} diff --git a/Recyclable.CollectionsTests/xunit.runner.json b/Recyclable.CollectionsTests/xunit.runner.json index 5c18afe..3e6e47f 100644 --- a/Recyclable.CollectionsTests/xunit.runner.json +++ b/Recyclable.CollectionsTests/xunit.runner.json @@ -1,6 +1,6 @@ -{ - "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "methodDisplay": "method", - "parallelizeTestCollections": false, - "preEnumerateTheories": false -} +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "methodDisplay": "method", + "parallelizeTestCollections": false, + "preEnumerateTheories": false +} diff --git a/SourceCodeGenerator.Net/RecyclableCollectionsGenerator.cs b/SourceCodeGenerator.Net/RecyclableCollectionsGenerator.cs index 6d22282..8b6e8cd 100644 --- a/SourceCodeGenerator.Net/RecyclableCollectionsGenerator.cs +++ b/SourceCodeGenerator.Net/RecyclableCollectionsGenerator.cs @@ -1,19 +1,19 @@ -using Microsoft.CodeAnalysis; -using System; - -namespace SourceCodeGenerator.Net -{ - [Generator] - public class RecyclableCollectionsGenerator : ISourceGenerator - { - public void Execute(GeneratorExecutionContext context) - { - context.AddSource($".g.cs"); - } - - public void Initialize(GeneratorInitializationContext context) - { - // Nothing to initialize at this point yet - } - } -} +using Microsoft.CodeAnalysis; +using System; + +namespace SourceCodeGenerator.Net +{ + [Generator] + public class RecyclableCollectionsGenerator : ISourceGenerator + { + public void Execute(GeneratorExecutionContext context) + { + context.AddSource($".g.cs"); + } + + public void Initialize(GeneratorInitializationContext context) + { + // Nothing to initialize at this point yet + } + } +} diff --git a/SourceCodeGenerator.Net/SourceCodeGenerator.Net.csproj b/SourceCodeGenerator.Net/SourceCodeGenerator.Net.csproj index 76fdb19..46d302b 100644 --- a/SourceCodeGenerator.Net/SourceCodeGenerator.Net.csproj +++ b/SourceCodeGenerator.Net/SourceCodeGenerator.Net.csproj @@ -1,17 +1,17 @@ - - - - net8.0;net7.0;net6.0 - enable - True - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + net8.0;net7.0;net6.0 + enable + True + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/VersionedCollectionsGenerator/VersionedCollectionsGenerator.cs b/VersionedCollectionsGenerator/VersionedCollectionsGenerator.cs index 0ded016..b413dc4 100644 --- a/VersionedCollectionsGenerator/VersionedCollectionsGenerator.cs +++ b/VersionedCollectionsGenerator/VersionedCollectionsGenerator.cs @@ -1,133 +1,133 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Text; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace VersionedCollectionsGenerator -{ - [Generator] - public sealed class VersionedCollectionsGenerator : ISourceGenerator - { - private const string AttributeText = """ -using System; - -namespace VersionedCollectionsGenerator -{ - [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] - internal sealed class GenerateVersionedAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] - internal sealed class CloneForVersionedAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] - internal sealed class RewriteForVersionedAttribute : Attribute - { - } -} -"""; - - public void Initialize(GeneratorInitializationContext context) - { - context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); - } - - public void Execute(GeneratorExecutionContext context) - { - context.AddSource("GenerateVersionedAttribute.g.cs", SourceText.From(AttributeText, Encoding.UTF8)); - - if (context.SyntaxReceiver is not SyntaxReceiver receiver) - { - return; - } - - foreach (var candidate in receiver.Candidates) - { - var model = context.Compilation.GetSemanticModel(candidate.SyntaxTree); - var symbol = model.GetDeclaredSymbol(candidate) as INamedTypeSymbol; - if (symbol is null) - { - continue; - } - - if (!symbol.GetAttributes().Any(a => a.AttributeClass?.ToDisplayString() == "VersionedCollectionsGenerator.GenerateVersionedAttribute")) - { - continue; - } - - string originalName = symbol.Name; - string newName = $"{originalName}Versioned"; - - var partials = GetAllPartials(context.Compilation, originalName); - int index = 0; - foreach (var partial in partials) - { - var tree = partial.SyntaxTree; - var root = tree.GetRoot(); - var rewriter = new RenameRewriter(originalName, newName); - var newRoot = rewriter.Visit(root); - var text = newRoot.ToFullString() - .Replace("#if WITH_VERSIONING", string.Empty) - .Replace("#endif", string.Empty); - context.AddSource($"{newName}_{index++}.g.cs", SourceText.From(text, Encoding.UTF8)); - } - } - } - - private static IEnumerable GetAllPartials(Compilation compilation, string className) - { - foreach (var tree in compilation.SyntaxTrees) - { - var root = tree.GetRoot(); - foreach (var cls in root.DescendantNodes().OfType()) - { - if (cls.Identifier.ValueText == className) - { - yield return cls; - } - } - } - } - - private sealed class RenameRewriter : CSharpSyntaxRewriter - { - private readonly string _oldName; - private readonly string _newName; - - public RenameRewriter(string oldName, string newName) - { - _oldName = oldName; - _newName = newName; - } - - public override SyntaxToken VisitToken(SyntaxToken token) - { - if (token.ValueText == _oldName) - { - return SyntaxFactory.Identifier(token.LeadingTrivia, _newName, token.TrailingTrivia); - } - - return base.VisitToken(token); - } - } - - private sealed class SyntaxReceiver : ISyntaxReceiver - { - public List Candidates { get; } = new(); - - public void OnVisitSyntaxNode(SyntaxNode syntaxNode) - { - if (syntaxNode is ClassDeclarationSyntax classDecl && classDecl.AttributeLists.Count > 0) - { - Candidates.Add(classDecl); - } - } - } - } -} +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace VersionedCollectionsGenerator +{ + [Generator] + public sealed class VersionedCollectionsGenerator : ISourceGenerator + { + private const string AttributeText = """ +using System; + +namespace VersionedCollectionsGenerator +{ + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] + internal sealed class GenerateVersionedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] + internal sealed class CloneForVersionedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] + internal sealed class RewriteForVersionedAttribute : Attribute + { + } +} +"""; + + public void Initialize(GeneratorInitializationContext context) + { + context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); + } + + public void Execute(GeneratorExecutionContext context) + { + context.AddSource("GenerateVersionedAttribute.g.cs", SourceText.From(AttributeText, Encoding.UTF8)); + + if (context.SyntaxReceiver is not SyntaxReceiver receiver) + { + return; + } + + foreach (var candidate in receiver.Candidates) + { + var model = context.Compilation.GetSemanticModel(candidate.SyntaxTree); + var symbol = model.GetDeclaredSymbol(candidate) as INamedTypeSymbol; + if (symbol is null) + { + continue; + } + + if (!symbol.GetAttributes().Any(a => a.AttributeClass?.ToDisplayString() == "VersionedCollectionsGenerator.GenerateVersionedAttribute")) + { + continue; + } + + string originalName = symbol.Name; + string newName = $"{originalName}Versioned"; + + var partials = GetAllPartials(context.Compilation, originalName); + int index = 0; + foreach (var partial in partials) + { + var tree = partial.SyntaxTree; + var root = tree.GetRoot(); + var rewriter = new RenameRewriter(originalName, newName); + var newRoot = rewriter.Visit(root); + var text = newRoot.ToFullString() + .Replace("#if WITH_VERSIONING", string.Empty) + .Replace("#endif", string.Empty); + context.AddSource($"{newName}_{index++}.g.cs", SourceText.From(text, Encoding.UTF8)); + } + } + } + + private static IEnumerable GetAllPartials(Compilation compilation, string className) + { + foreach (var tree in compilation.SyntaxTrees) + { + var root = tree.GetRoot(); + foreach (var cls in root.DescendantNodes().OfType()) + { + if (cls.Identifier.ValueText == className) + { + yield return cls; + } + } + } + } + + private sealed class RenameRewriter : CSharpSyntaxRewriter + { + private readonly string _oldName; + private readonly string _newName; + + public RenameRewriter(string oldName, string newName) + { + _oldName = oldName; + _newName = newName; + } + + public override SyntaxToken VisitToken(SyntaxToken token) + { + if (token.ValueText == _oldName) + { + return SyntaxFactory.Identifier(token.LeadingTrivia, _newName, token.TrailingTrivia); + } + + return base.VisitToken(token); + } + } + + private sealed class SyntaxReceiver : ISyntaxReceiver + { + public List Candidates { get; } = new(); + + public void OnVisitSyntaxNode(SyntaxNode syntaxNode) + { + if (syntaxNode is ClassDeclarationSyntax classDecl && classDecl.AttributeLists.Count > 0) + { + Candidates.Add(classDecl); + } + } + } + } +} diff --git a/VersionedCollectionsGenerator/VersionedCollectionsGenerator.csproj b/VersionedCollectionsGenerator/VersionedCollectionsGenerator.csproj index cc41630..d2b3c41 100644 --- a/VersionedCollectionsGenerator/VersionedCollectionsGenerator.csproj +++ b/VersionedCollectionsGenerator/VersionedCollectionsGenerator.csproj @@ -1,19 +1,19 @@ - - - - net8.0;net7.0;net6.0 - enable - enable - preview - True - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + net8.0;net7.0;net6.0 + enable + enable + preview + True + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + +