ArrayExtensions.IsSequenceEqual — Use MemoryExtensions.SequenceEqual
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- performance
Research direction
Open Utilities/ArrayExtensions.cs and locate ArrayExtensions.IsSequenceEqual. Compare the current equality loop with the proposed AsSpan().SequenceEqual approach, then run the repository's existing test suite to confirm behavior for the relevant array comparisons. Done means the method uses MemoryExtensions.SequenceEqual without per-element boxing and existing tests pass.
Written by the indexing model from the issue text.
Description
File: Utilities/ArrayExtensions.cs
The hand-rolled equality loop uses boxed Equals(source[i], other[i]) — that's virtual dispatch and boxing for every element.
// BEFORE if (!Equals(source[i], other[i])) ...
// AFTER — intrinsic-optimised, SIMD-enabled on .NET 8
return source.AsSpan().SequenceEqual(other.AsSpan());
MemoryExtensions.SequenceEqual is SIMD-vectorised by the JIT on .NET 8 and avoids all boxing. For long[] comparisons across the histogram counts array (which can be ~185KB), this is material.
- Dominant language
- C#
- Stars
- 185
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HdrHistogram/HdrHistogram.NET
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
HdrHistogram/HdrHistogram.NET#167 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HdrHistogram/HdrHistogram.NET#166 ·
-
WriterReaderPhaser.FlipPhase - Task.Yield().GetAwaiter().GetResult() is a Thread Pool Anti-Pattern Openagent enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HdrHistogram/HdrHistogram.NET#144 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
HdrHistogram/HdrHistogram.NET#156 ·
-
agent enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
HdrHistogram/HdrHistogram.NET#148 ·
All issues in HdrHistogram/HdrHistogram.NET
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·