2.3 KiB
2.3 KiB
Benchmark Backtest Performance
This command runs the backtest performance tests and records the results in the performance benchmark CSV file.
Usage
Run this command to benchmark backtest performance and update the tracking CSV:
/benchmark-backtest-performance
Or run the script directly:
./scripts/benchmark-backtest-performance.sh
What it does
- Runs the performance telemetry test (
ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry) - Extracts performance metrics from the test output
- Appends a new row to
src/Managing.Workers.Tests/performance-benchmarks.csv
CSV Format
The CSV file contains the following columns:
DateTime: ISO 8601 timestamp when the benchmark was runTestName: Name of the test that was executedCandlesCount: Number of candles processedExecutionTimeSeconds: Total execution time in secondsProcessingRateCandlesPerSec: Candles processed per secondMemoryStartMB: Memory usage at startMemoryEndMB: Memory usage at endMemoryPeakMB: Peak memory usageSignalUpdatesCount: Total signal updates performedSignalUpdatesSkipped: Number of signal updates skippedSignalUpdateEfficiencyPercent: Percentage of signal updates that were skippedBacktestStepsCount: Number of backtest steps executedAverageSignalUpdateMs: Average time per signal updateAverageBacktestStepMs: Average time per backtest stepFinalPnL: Final profit and lossWinRatePercent: Win rate percentageGrowthPercentage: Growth percentageScore: Backtest scoreCommitHash: Git commit hashGitBranch: Git branch nameEnvironment: Environment where test was run
Implementation Details
The command uses regex patterns to extract metrics from the test console output and formats them into CSV rows. It automatically detects the current git branch and commit hash for tracking.
Example Output
🚀 Running backtest performance benchmark...
📊 Test Results:
• Processing Rate: 2,684.8 candles/sec
• Execution Time: 2.15s
• Memory Usage: 24.24MB peak
• Signal Efficiency: 33.1%
✅ Benchmark data recorded in performance-benchmarks.csv
Files Modified
src/Managing.Workers.Tests/performance-benchmarks.csv- Performance tracking data