mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 11:14:45 +00:00
Instruct parallel foreach to not go over the number of processor threads, it's counter productive.
And it should not do it by default but apparently, it does.
This commit is contained in:
@@ -213,6 +213,10 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
_stopwatch.Restart();
|
||||
|
||||
Parallel.ForEach(_rootImporter.Files,
|
||||
new ParallelOptions
|
||||
{
|
||||
MaxDegreeOfParallelism = Environment.ProcessorCount
|
||||
},
|
||||
file =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
@@ -284,6 +288,10 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
_stopwatch.Restart();
|
||||
|
||||
Parallel.ForEach(_rootImporter.Archives,
|
||||
new ParallelOptions
|
||||
{
|
||||
MaxDegreeOfParallelism = Environment.ProcessorCount
|
||||
},
|
||||
archive =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
@@ -365,6 +373,10 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
_stopwatch.Restart();
|
||||
|
||||
Parallel.ForEach(_rootImporter.Archives,
|
||||
new ParallelOptions
|
||||
{
|
||||
MaxDegreeOfParallelism = Environment.ProcessorCount
|
||||
},
|
||||
archive =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
|
||||
Reference in New Issue
Block a user