Releases: mh-khani/SFXFinder
SFX Finder-1.1.0-win64
SFX Finder Windows 64bit Version 1.1.0
Improvements & Optimizations in SFXListInitialize Method
1. Replaced Task.Run with Parallel.ForEach for Faster Processing
Change:
Previously, Task.Run was used to filter files in a single thread. It has been replaced with Parallel.ForEach to process multiple files simultaneously.
Benefit:
File processing is now parallelized, significantly improving speed.
On multi-core processors, this approach can be several times faster than before.
2. Replaced List with ConcurrentBag
Change:
Instead of using ToArray(), a ConcurrentBag is now used to store matched files.
Benefit:
ConcurrentBag is designed for multi-threaded environments, preventing conflicts when adding data in Parallel.ForEach.
It ensures safe and efficient storage of file paths while filtering.
3. Optimized ProgressBar Updates Using IProgress
Change:
Previously, progressBar1.Value was updated inside an Invoke action, which caused UI lag. Now, IProgress is used for smoother updates.
Benefit:
Eliminates the need for direct Invoke, making updates faster and more efficient.
Progress updates are now handled asynchronously, reducing UI delays.
4. Improved ListView Performance with BeginUpdate() and EndUpdate()
Change:
Previously, items were added one by one, causing frequent UI rendering. Now, sfxlist.BeginUpdate(); and sfxlist.EndUpdate(); are used to batch updates.
Benefit:
Prevents UI lag when adding a large number of items.
The ListView is updated only once, reducing unnecessary redraws and improving responsiveness.
5. Used Interlocked.Increment(ref processedFiles) for Safe Multi-Threaded Counting
Change:
The previous processedFiles++ operation has been replaced with Interlocked.Increment(ref processedFiles).
Benefit:
Ensures thread-safe increments, preventing incorrect counts when multiple threads update processedFiles.
Avoids race conditions, ensuring accurate progress calculation.
Final Results 🚀
✅ Significantly faster file processing (several times quicker than before)
✅ Smooth and responsive UI (reduced lag and improved performance)
✅ Efficient multi-threading with safe concurrent operations
✅ Optimized ProgressBar updates without UI blocking
🔥 Overall, these changes dramatically improve the app’s performance and user experience! 🚀
SFXFinder-1.0.0-win64
SFX Finder Windows 64bit Version 1.0.0