mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-25 07:06:20 -10:00
The tests have been overhauled and are in fairly decent shape, so there wasn't as much low-hanging fruit as in some of the other test libraries, but there are still a few notable places we can make improvements and others we can cut back without losing quality of coverage. Changes: - Even though some care had been taken to avoid it, at least one DegreeOfParallelismTests was taking an extra ~25s on my machine waiting for the thread pool to ramp up. Fixed via the same helper used in other test libs. - Removed ReadOnlyCollection as a source. There are special PLINQ code paths for arrays, lists, ParallelEnumerable.Range, and custom partitioners, but not for other collection types, so I've commented out that source until such time as we do have such special cases. This removes ~1/6th of the test cases and an equivalent amount of execution time. - Improved throughput of the IntegerRangeSet helper, which is used in lots of tests and was a source of significant contention due to a lock used in the main Add method. Replacing it with a SpinLock reduced execution time by ~10%. - Removed ParallelEnumerable.Range as an "expander" in the SelectSelectManyTests. The delegate is returning an IEnumerable, so subsequent operations performed on the expander aren't continuing the PLINQ execution and are instead starting a new one, making this essentially equivalent to (but more expensive than and duplicative of) the Enumerable.Range expander that already exists. - Lowered outerloop default iteration count from 64K*ProcCount to 16K*ProcCount - Lowered OrderByThenByTest outerloop iteration count from 32K to 16K, and removed the additional 1K iteration count being performed. Commit migrated from https://github.com/dotnet/corefx/commit/2a75aefbe2cd8c951ac3cfb8ab2ea324847ae90c