Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Mesosphere Sprint 2018-24, Mesosphere Sprint 2018-25
-
3
Description
Based on the profiling result of MESOS-8989, the range subtraction operation is about 2~3 times more expensive than that of addition. It's not obvious that this has to be the case.
The current range subtraction implementation relies on boost IntervalSet, the construction cost of the IntervalSet could be the culprit:
https://github.com/apache/mesos/blob/9147283171d761a4d38710f24ba654f8a96e325c/src/common/values.cpp#L378-L387
I think we could do better by writing a one-pass (with sorting) algorithm like that of addition.