Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[perf] System.Collections.** and System.Buffers.** performance regressions in Mono AOT x64 microbenchmarks from Preview 5 to Preview 7 #89251

Closed
kotlarmilos opened this issue Jul 20, 2023 · 3 comments
Labels
Milestone

Comments

@kotlarmilos
Copy link
Member

Description

The following performance regressions occurred between the Preview 4 snapshot (May 2nd, 2023) and Preview 7 snapshot (July 19th, 2023).

The configuration used for the benchmarks is Mono AOT with LLVM on x64 ubuntu 18.04.

Name Baseline Value Compare Value % Difference
System.Collections.Tests.Perf_PriorityQueue<Int32, Int32>.Enumerate(Size: 10) 48.24 55.58 15.22
System.Collections.Tests.Perf_BitArray.BitArraySet(Size: 4) 9.86 10.38 5.27
System.Collections.Tests.Perf_BitArray.BitArrayNot(Size: 512) 156.05 387.13 148.08
System.Collections.Tests.Perf_BitArray.BitArrayNot(Size: 4) 3.83 4.11 7.31
System.Collections.Tests.Perf_BitArray.BitArrayCopyToBoolArray(Size: 512) 7519.8 8942.84 18.92
System.Collections.Tests.Perf_BitArray.BitArrayByteArrayCtor(Size: 512) 1418.08 1509.38 6.44
System.Collections.Tests.Perf_BitArray.BitArrayBoolArrayCtor(Size: 512) 825.32 875.1 6.03
System.Collections.Tests.Perf_BitArray.BitArrayAnd(Size: 4) 4.94 5.39 9.11
System.Collections.Tests.Add_Remove_SteadyState<String>.Queue(Count: 512) 21.68 24.49 12.96
System.Collections.Sort<Int32>.Array_Comparison(Size: 512) 28171.27 29595.3 5.05
System.Collections.IterateForEach<String>.IEnumerable(Size: 512) 2962.18 3405.16 14.95
System.Collections.IterateForEach<Int32>.Dictionary(Size: 512) 2918.23 3256.52 11.59
System.Collections.IterateFor<String>.ReadOnlySpan(Size: 512) 461.08 683.44 48.23
System.Collections.IterateFor<String>.Array(Size: 512) 347.92 460.09 32.24
System.Collections.IndexerSet<String>.List(Size: 512) 2918.13 3256.95 11.61
System.Collections.IndexerSet<Int32>.List(Size: 512) 1321.05 1468.21 11.14
System.Collections.CtorFromCollection<Int32>.ConcurrentStack(Size: 512) 6904.3 7311.26 5.89
System.Collections.ContainsTrue<String>.HashSet(Size: 512) 17877.2 19374.79 8.38
System.Collections.ContainsTrue<Int32>.ImmutableArray(Size: 512) 106299.93 313108.63 194.55
System.Collections.ContainsTrue<Int32>.ICollection(Size: 512) 102156.81 309156.44 202.63
System.Collections.ContainsFalse<Int32>.ICollection(Size: 512) 194446.04 577782.73 197.14
System.Collections.Concurrent.Count<String>.Queue(Size: 512) 7.93 8.43 6.31
System.Buffers.Text.Tests.Utf8ParserTests.TryParseUInt64(value: 18446744073709551615) 41.01 57.29 39.7
System.Buffers.Text.Tests.Utf8ParserTests.TryParseBool(value: true) 11.85 12.5 5.49
System.Buffers.Tests.ReadOnlySequenceTests<Byte>.FirstSpanMemory 20.75 22.07 6.36
@kotlarmilos
Copy link
Member Author

kotlarmilos commented Jul 20, 2023

@MihaZupan Some of them may have regressed in #87621.

/cc: @vargaz

@MihaZupan
Copy link
Member

MihaZupan commented Jul 20, 2023

That change should be cosmetic only

-bool someCondition = span.IndexOfAnyExcept(foo) >= 0;
+bool someCondition = span.ContainsAnyExcept(foo);

static bool ContainsAnyExcept(Span, value) => span.IndexOfAnyExcept(value) >= 0;

I suppose it's possible you could get worse codegen for some of these, but the differences here are way too excessive.

Besides, none of these benchmarks look like they'd be hitting the changed code.

@kotlarmilos kotlarmilos modified the milestones: 8.0.0, 9.0.0 Aug 8, 2023
@steveisok
Copy link
Member

Since this is about .net 8, there's really not much action to take here. Closing.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants