mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-07-26 06:48:13 +00:00
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:
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user