Optimize flushing frequency for better performance

 FLUSHING OPTIMIZATION:

 BALANCED FLUSHING STRATEGY:
  • Increased flush threshold from 1MB to 5MB for better performance
  • Reduced time-based flushing from 500ms to 3 seconds
  • Maintains real-time visibility while reducing I/O overhead
  • Still flushes after every file completion for progress tracking

 PERFORMANCE BENEFITS:
  • Reduced disk I/O operations for better throughput
  • Less frequent interruptions during large file processing
  • Maintains good real-time visibility (updates every 5MB or 3 seconds)
  • Optimal balance between performance and progress feedback

� NEW FLUSHING STRATEGY:
  • Size-based: Every 5MB of data written
  • Time-based: Every 3 seconds maximum
  • File-based: After every file completion (unchanged)
  • Still provides good real-time updates without excessive I/O

Perfect balance of performance and visibility!
This commit is contained in:
PSMinIO Developer
2025-07-14 16:46:08 -04:00
parent 900c0bbdad
commit 4c2ef37a07
3 changed files with 2 additions and 2 deletions
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -19,10 +19,10 @@ namespace PSMinIO.Utils
private bool _disposed = false;
// Performance optimization fields
private const long FlushThreshold = 1 * 1024 * 1024; // 1MB (very frequent flushing for real-time updates)
private const long FlushThreshold = 5 * 1024 * 1024; // 5MB (balanced flushing for good performance)
private long _bytesWrittenSinceFlush = 0;
private DateTime _lastFlush = DateTime.UtcNow;
private const int FlushIntervalMs = 500; // 500ms (very frequent time-based flushing)
private const int FlushIntervalMs = 3000; // 3 seconds (reasonable time-based flushing)
// Cancellation support
private CancellationTokenSource? _cancellationTokenSource;