mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-07-26 06:48:13 +00:00
Optimize flushing thresholds for maximum performance
⚡ PERFORMANCE-OPTIMIZED FLUSHING: � ENHANCED PERFORMANCE THRESHOLDS: • Increased flush threshold from 5MB to 128MB for maximum throughput • Extended time-based flushing from 3 seconds to 10 seconds • Significantly reduced I/O overhead during large operations • Still maintains progress visibility for long-running operations ✅ OPTIMIZED FLUSHING STRATEGY: • Size-based: Every 128MB of data written (minimal interruptions) • Time-based: Every 10 seconds maximum (reasonable progress updates) • File-based: After every file completion (unchanged for progress tracking) • Aggressive flush: Still uses reflection + OS-level flush for reliability � PERFORMANCE BENEFITS: • Minimal I/O interruptions during large file processing • Maximum throughput for bulk operations • Reduced CPU overhead from frequent flushing • Still provides reasonable progress updates every 10 seconds � EXPECTED RESULTS: • Faster processing of large file collections • Better performance for multi-GB operations • Less frequent but still visible progress updates • Optimal balance for production workloads Perfect for high-performance zip operations!
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 = 5 * 1024 * 1024; // 5MB (balanced flushing for good performance)
|
||||
private const long FlushThreshold = 128 * 1024 * 1024; // 128MB (optimized for performance)
|
||||
private long _bytesWrittenSinceFlush = 0;
|
||||
private DateTime _lastFlush = DateTime.UtcNow;
|
||||
private const int FlushIntervalMs = 3000; // 3 seconds (reasonable time-based flushing)
|
||||
private const int FlushIntervalMs = 10000; // 10 seconds (performance-optimized time-based flushing)
|
||||
|
||||
// Cancellation support
|
||||
private CancellationTokenSource? _cancellationTokenSource;
|
||||
|
||||
Reference in New Issue
Block a user