Improved speed of XCI Trimmer read headers by removing garbage collect and superfluous read

This commit is contained in:
Aaron Murgatroyd 2025-05-19 22:32:39 +10:00
parent 4d16b2b4e4
commit 449333c451
2 changed files with 7 additions and 4 deletions

View file

@ -142,7 +142,6 @@ namespace Ryujinx.Common.Utilities
{ {
Log = log; Log = log;
Filename = path; Filename = path;
ReadHeader();
} }
public void CheckFreeSpace(CancellationToken? cancelToken = null) public void CheckFreeSpace(CancellationToken? cancelToken = null)
@ -435,7 +434,6 @@ namespace Ryujinx.Common.Utilities
_binaryReader.Close(); _binaryReader.Close();
_binaryReader = null; _binaryReader = null;
_fileStream = null; _fileStream = null;
GC.Collect();
} }
private void ReadHeader() private void ReadHeader()

View file

@ -76,9 +76,14 @@ namespace Ryujinx.Ava.UI.ViewModels
foreach (ApplicationData xciApp in apps) foreach (ApplicationData xciApp in apps)
{ {
AddOrUpdateXCITrimmerFile(CreateXCITrimmerFile(xciApp.Path)); AddOrUpdateXCITrimmerFile(CreateXCITrimmerFile(xciApp.Path));
_mainWindowViewModel.StatusBarProgressValue = ++appsProcessed;
if (appsProcessed % 50 == 0)
{
_mainWindowViewModel.StatusBarProgressValue = appsProcessed;
Dispatcher.UIThread.InvokeAsync(() => { }, DispatcherPriority.Render).Wait(); Dispatcher.UIThread.InvokeAsync(() => { }, DispatcherPriority.Render).Wait();
} }
appsProcessed++;
}
} }
finally finally
{ {