Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.0.0
-
None
Description
TaskSchedulerImpl.resourceOffer takes in a Seq[WorkerOffer]. however, later on it indexes into this by position. If you don't pass in an IndexedSeq, this turns an O operation in an O(n^2) operation.
In practice, this isn't an issue, since just by chance the important places this is called, the datastructures happen to already be IndexedSeq s. But we ought to tighten up the types to make this more clear. I ran into this while doing some performance tests on the scheduler, and performance was terrible when I passed in a Seq and even a few hundred offers were scheduled very slowly.