perf: remove debug logging and optimize rolling window maintenance (+5.0%)

This commit is contained in:
2025-11-11 12:26:44 +07:00
parent 46966cc5d8
commit 61fdcec902
3 changed files with 15 additions and 14 deletions

View File

@@ -251,8 +251,6 @@ public class BacktestExecutor
_logger.LogInformation("🔄 Starting candle processing for {CandleCount} candles", orderedCandles.Count);
// Process all candles with optimized rolling window approach
_logger.LogInformation("🎯 Starting to process {Count} candles in loop", orderedCandles.Count);
Console.WriteLine("CONSOLE: About to start candle processing loop");
foreach (var candle in orderedCandles)
{
// Maintain rolling window efficiently using List
@@ -273,11 +271,6 @@ public class BacktestExecutor
// Smart signal caching - reduce signal update frequency for performance
// RSI and similar indicators don't need updates every candle for 15-minute data
var shouldSkipSignalUpdate = ShouldSkipSignalUpdate(currentCandle, totalCandles);
if (currentCandle <= 5) // Debug first few candles
{
_logger.LogInformation("🔍 Candle {CurrentCandle}: shouldSkip={ShouldSkip}, totalCandles={Total}",
currentCandle, shouldSkipSignalUpdate, totalCandles);
}
if (!shouldSkipSignalUpdate)
{
@@ -292,12 +285,6 @@ public class BacktestExecutor
signalUpdateSkipCount++;
// Skip signal update - reuse previous signal state
// This saves ~1ms per skipped update and improves performance significantly
if (signalUpdateSkipCount <= 5) // Log first few skips for debugging
{
_logger.LogInformation(
"⏭️ Signal update skipped for candle {CurrentCandle} (total skipped: {SkipCount})",
currentCandle, signalUpdateSkipCount);
}
}
// Run with optimized backtest path (minimize async calls)