Add Span API for SMA, EMA, and WMA with zero-allocation performance improvements

- Implemented zero-allocation methods for SMA, EMA, and WMA calculations using ReadOnlySpan and Span.
- Added unit tests for Span API to validate input, match TSeries calculations, handle NaN values, and ensure zero allocation.
- Enhanced documentation to include usage examples for the new Span API.
- Introduced performance benchmarks comparing the new Span API against existing TSeries implementations and other libraries.
This commit is contained in:
Miha Kralj
2025-11-29 20:48:01 -08:00
parent 5c1fb18520
commit 2d28b8f62a
12 changed files with 936 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\lib\quantalib.csproj" />
</ItemGroup>
<ItemGroup>
<!-- Comparison libraries -->
<PackageReference Include="Skender.Stock.Indicators" Version="2.6.1" />
<PackageReference Include="Tulip.NETCore" Version="0.8.0.1" />
<PackageReference Include="TALib.NETCore" Version="0.5.0" />
<!-- Benchmarking -->
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>
</Project>