Back to list
DaveSkender

performance-testing

by DaveSkender

Stock Indicators for .NET is a C# NuGet package that transforms raw equity, commodity, forex, or cryptocurrency financial market price quotes into technical indicators and trading insights. You'll need this essential data in the investment tools that you're building for algorithmic trading, technical analysis, machine learning, or visual charting.

1,169🍴 265📅 Jan 22, 2026

SKILL.md


name: performance-testing description: Benchmark indicator performance with BenchmarkDotNet. Use for Series/Buffer/Stream benchmarks, regression detection, and optimization patterns. Target 1.5x Series for StreamHub, 1.2x for BufferList.

Performance testing

Running benchmarks

cd tools/performance

# Run all benchmarks (~15-20 minutes)
dotnet run -c Release

# Run specific category
dotnet run -c Release --filter *StreamIndicators*
dotnet run -c Release --filter *BufferIndicators*
dotnet run -c Release --filter *SeriesIndicators*

# Run specific indicator
dotnet run -c Release --filter *.EmaHub

Adding benchmarks

Series pattern

[Benchmark]
public void ToMyIndicator() => quotes.ToMyIndicator(14);

Stream pattern

[Benchmark]
public object MyIndicatorHub() => quoteHub.ToMyIndicatorHub(14).Results;

Buffer pattern

[Benchmark]
public MyIndicatorList MyIndicatorList() => new(14) { quotes };

Style comparison

[Benchmark]
public IReadOnlyList<MyResult> MyIndicatorSeries() => quotes.ToMyIndicator(14);

[Benchmark]
public IReadOnlyList<MyResult> MyIndicatorBuffer() => quotes.ToMyIndicatorList(14);

[Benchmark]
public IReadOnlyList<MyResult> MyIndicatorStream() => quoteHub.ToMyIndicator(14).Results;

Performance targets

Note: These are optimization goals for future v3.1+ effort. Current implementations vary—see PERFORMANCE_ANALYSIS.md for actual measured performance. Some indicator families (e.g., EMA) have inherent framework overhead due to simple operation costs.

StyleTarget vs SeriesUse Case
SeriesBaselineBatch processing
BufferList≤ 1.2xIncremental data
StreamHub≤ 1.5xReal-time feeds

Expected execution times (502 periods)

Note: These are optimization targets. Actual execution times vary by indicator complexity and current implementation.

ComplexityTimeExamples
Fast< 30μsSMA, EMA, WMA, RSI
Medium30-60μsMACD, Bollinger Bands, ATR
Complex60-100μsHMA, ADX, Stochastic
Advanced100-200μs+Ichimoku, Hurst

Regression detection

# Auto-detect baseline and results
pwsh detect-regressions.ps1

# Custom threshold (default 10%)
pwsh detect-regressions.ps1 -ThresholdPercent 15

Exit codes:

  • 0 - No regressions
  • 1 - Regressions found

Creating baselines

cp BenchmarkDotNet.Artifacts/results/Performance.*-report-full.json \
   baselines/baseline-v3.0.0.json

Required optimization patterns

  • Minimize allocations in hot paths
  • Avoid LINQ in performance-critical loops
  • Use Span<T> for zero-copy operations
  • Cache calculations when possible
  • Test with realistic data sizes (502 periods)

Prohibited patterns

  • Excessive LINQ in hot paths
  • Boxing/unboxing of value types
  • Unnecessary string allocations
  • Redundant calculations in loops
  • Poor cache locality

See references/benchmark-patterns.md for detailed patterns.


Last updated: December 31, 2025

Score

Total Score

90/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 1000以上

+15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

0/5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon