Uses the old 20% rule up to 300 markers and then always does the built-in (n log n) sort.
This is a big performance win for large datasets when eg. 19000 new markers could trigger an
insertionSort on a 100k dataset.
Measured on a real application: sorting time during app startup dropped from 70seconds(!!) to <200ms.
Both sorts are also now wrapped in the if (_nbChanges) check to avoid redundant sorts (even if they're fast and stable, I think this logic is simpler).
Uses the old 20% rule up to 300 markers and then always does the built-in (n log n) sort.
This is a big performance win for large datasets when eg. 19000 new markers could trigger an insertionSort on a 100k dataset.
Measured on a real application: sorting time during app startup dropped from 70seconds(!!) to <200ms.
Both sorts are also now wrapped in the
if (_nbChanges)
check to avoid redundant sorts (even if they're fast and stable, I think this logic is simpler).