-
-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Labels
Description
FEATURE REQUEST (Optimization)
I've completed a bunch of performance tests on a scheduling algorithm implemented with GeneticSharp. Following are my findings.
I've used PLINQ/TPL to try to improve performance here and there.
Following are my results:
- ParallelTaskExecutor.Start, changed loop to Parallel.For, removing the Task.Run RESULT: +2%
- GeneticAlgorithm.Cross, GeneticAlgorithm.Mutate, changed loop to Parallel.ForEach (see PR) and used ConcurrentBag RESULT: +80% +110%
Additional context
I didn't like too much the actual implementation of ParallelTaskExecutor due to the need of sizing the min and max threads manually. If I understand well, Parallel class use a default (automatic) partitioner which can be customized if required (maybe even through the external interface?).
Let me know what you think.
Kind Regards,
References
MSDN Parallel Class
MSDN Custom Partitioners for PLINQ and TPL