Quaver.API
Quaver.API copied to clipboard
Optimise bin selection in difficulty calculation
Importing Force! Full Album now takes 10s than 2 minutes.
...
var valuesInBin = StrainSolverData.Where(s => s.StartTime >= i && s.StartTime < i + binSize).ToList();
...
This line is very inefficient.
My PR optimises it so that CalculateOverallDifficulty() is now $O(n)$ instead of $O(n^2)$, where n is StrainSolverData.Count.
The following patch lets you better check if there's any bug with this change.