Skip to content

Commit

Permalink
+ Disabled assembly serialization
Browse files Browse the repository at this point in the history
+ Added FastAdd
  • Loading branch information
MineCake147E committed Jul 6, 2019
1 parent 051fc7f commit 63014dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MonoAudio.Core/MonoAudio.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<WarningsAsErrors>NU1605;CS1591</WarningsAsErrors>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
4 changes: 2 additions & 2 deletions MonoAudio.Core/SystemExtensions/Memory/SpanExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public static void FastAdd(ReadOnlySpan<float> samplesToAdd, Span<float> buffer)
dst[i] += src[i];
}
if (remainder == 0) return;
var srcRem = src.Slice(newLength);
var dstRem = dst.Slice(newLength);
var srcRem = samplesToAdd.Slice(newLength);
var dstRem = buffer.Slice(newLength);
for (int i = 0; i < srcRem.Length; i++)
{
dstRem[i] += srcRem[i];
Expand Down
2 changes: 1 addition & 1 deletion Tests/MonoAudio.Core.Tests.CoreFx/SpanExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void FastAddTest(int length)
} while (sw.ElapsedMilliseconds < length);
sw.Stop();
Console.WriteLine(cntStandard);
Console.WriteLine($"{nameof(SpanExtensions.FastFill)} seems to be {(double)cntFast / cntStandard} times faster than {nameof(Span<float>.Fill)}");
Console.WriteLine($"{nameof(SpanExtensions.FastFill)} seems to be {(double)cntFast / cntStandard} times faster than unsafe loop");
Assert.Greater(cntFast, cntStandard);
}
}
Expand Down

0 comments on commit 63014dd

Please sign in to comment.