Skip to content

Commit 1ccd825

Browse files
committed
Fixing 20% performance regression caused by bad inlining???
1 parent 657e847 commit 1ccd825

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ColorChord.NET/NoteFinder/Gen2NoteFinderDFT.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ public unsafe void AddAudioData(ReadOnlySpan<short> newData)
298298
/// <summary> Shifts in 16 samples of audio data, updating the sin and cos accumulators with their new values. </summary>
299299
/// <remarks> This assumes AVX2 support. Use <see cref="AddAudioData(short)"/> on systems that do not have AVX2 support, or for batches smaller than 16 samples. </remarks>
300300
/// <param name="newData"> The data to process </param>
301+
[MethodImpl(MethodImplOptions.NoInlining)] // I won't pretend to understand why, but ever since I made this a sealed non-static class (was static), this started getting inlined, and this results in about a 20% drop in performance.
301302
private void AddAudioData256(Vector256<short> newData)
302303
{
303304
Vector256<ushort> IncrementingFrom0 = Vector256.Create((ushort)0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);

0 commit comments

Comments
 (0)