Uh oh!
There was an error while loading. Please reload this page.
Make ToDictionary() selectors parallel. - #100590
Conversation
jozkee
commented
May 20, 2024
As stated in #96262 (comment), this will likely regress cases with a trivial key selector. @lateapexearlyspeed could you please provide a benchmark to see how bad it hits it so we can do an informed decision? |
lateapexearlyspeed
commented
May 29, 2024
@jozkee following is benchmark result of trivial key (and element) selector case. Toolchain in "runtime-main" is library before change and toolchain in "runtime" is library after change. // * Summary * BenchmarkDotNet=v0.13.1.1603-nightly, OS=Windows 10.0.22631 PowerPlanMode=00000000-0000-0000-0000-000000000000 Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog IterationTime=250.0000 ms
[Benchmark]publicvoidTestParallelToDictionary(){IEnumerable<int>collection=Enumerable.Range(0,ItemCount);Dictionary<int,int>_=collection.AsParallel().ToDictionary(i =>i, i =>i);}[Params(1,10,100,1000,10000)]publicintItemCount{get;set;} |
stephentoub
commented
May 29, 2024
@EgorBot -amd usingSystem.Linq;usingBenchmarkDotNet.Attributes;usingBenchmarkDotNet.Running;BenchmarkRunner.Run<Tests>(args:args);publicclassTests{[Benchmark]publicvoidTestParallelToDictionary(){IEnumerable<int>collection=Enumerable.Range(0,ItemCount);Dictionary<int,int>_=collection.AsParallel().ToDictionary(i =>i, i =>i);}[Benchmark]publicvoidTestSelectParallelToDictionary(){IEnumerable<int>collection=Enumerable.Range(0,ItemCount);Dictionary<int,int>_=collection.AsParallel().Select(i =>i).ToDictionary(i =>i, i =>i);}[Benchmark]publicvoidTestWhereSelectParallelToDictionary(){IEnumerable<int>collection=Enumerable.Range(0,ItemCount);Dictionary<int,int>_=collection.AsParallel().Where(i =>true).Select(i =>i).ToDictionary(i =>i, i =>i);}[Params(1,10,100,1000,10000)]publicintItemCount{get;set;}} |
stephentoub
commented
May 29, 2024
@EgorBo, what's the invocation syntax for your bot? |
I typically use Example: #102805 (comment)
|
stephentoub
commented
May 29, 2024
@EgorBot -intel -arm64 |
stephentoub
commented
May 29, 2024
Thanks. What am I doing wrong that it's not kicking in? |
EgorBo
commented
May 29, 2024
It's correct as is (I already see 3 16-core VMs allocated for these requests😆) - it's just that currently there is no feedback that the jobs have started yet |
stephentoub
commented
May 29, 2024
Ah! Ok. I'm used to the other bots that post a comment indicating that they've received the request. Thanks. |
EgorBot
commented
May 29, 2024
|
EgorBot
commented
May 29, 2024
|
ericstj
commented
Nov 4, 2024
It looks like @EgorBo's test results show some significant regressions. Am I reading that correctly @jozkee@stephentoub? |
stephentoub
commented
Nov 4, 2024
Yes |
stephentoub
commented
May 28, 2025
Closing per #96262 (comment). But thank you for the PR, regardless. |
Fix#96262