From 2a1d27d4f877fa375e77d1de8e4306099eac100b Mon Sep 17 00:00:00 2001 From: PSMinIO Developer Date: Mon, 14 Jul 2025 17:01:22 -0400 Subject: [PATCH] Optimize flushing thresholds for maximum performance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⚡ 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! --- Module/PSMinIO/bin/PSMinIO.dll | Bin 178688 -> 178688 bytes Module/PSMinIO/bin/PSMinIO.pdb | Bin 484864 -> 484864 bytes src/Utils/ZipArchiveBuilder.cs | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Module/PSMinIO/bin/PSMinIO.dll b/Module/PSMinIO/bin/PSMinIO.dll index b5e2b6e738672e62ba492a23d068ecc1f51e4a09..c2043b43a86f3ac1fed0a154bbd56b6173cb127e 100644 GIT binary patch delta 112 zcmV-$0FVEG^a_CV3Xq5d>e%|Dv5dhT0ssh;PaYovh{J<$9*1xq0k?1-0@O$JRIt3cK(4(&j&XZ|9Mgs<0VnmT<_kKT z-IlSphil)I@7-=t$+SDl%T8<+w(0Z@!7>;M1& diff --git a/Module/PSMinIO/bin/PSMinIO.pdb b/Module/PSMinIO/bin/PSMinIO.pdb index ae798e7bd10e7c2ba46a4e8b71ad1c2cf0127590..968a292048987abafa5b9105107c6866fe85a82c 100644 GIT binary patch delta 234 zcmZoTBinFBc0+@ZuDPkXxkXxXT8go;MY3tKrIE3TX^NSFrCE|uikY#oL5g8&GEmxF zUrVXBcB5l3<0cUgKKVS?lbd-yC#afyQR4R4KlhKR`m(x94|p6RRJSxO3Toay@fTx0 zFeD8&#O!vNv?*b1rM!;+W4gbM4N5n+tFB zGfoWPTK0$4Zd1|;X_lHa-D}NfYTM7$G6FFZ5HkZY%l0$1tTi>nnzro^>j_7&QSE1J s*|wjtWw&6FIJ0PR2O|Rm!`etuZR^BLzxno)-PwOOJ=-qh#QsDX0B~7i_y7O^ diff --git a/src/Utils/ZipArchiveBuilder.cs b/src/Utils/ZipArchiveBuilder.cs index 212b7bb..cd958a9 100644 --- a/src/Utils/ZipArchiveBuilder.cs +++ b/src/Utils/ZipArchiveBuilder.cs @@ -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;