Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
We noticed that the `slave.available()` function in the allocator is expensive and gets called many times in each allocation cycle. In one of our profiling results, this function accounts for more than 80% of the allocation time, drags down the allocator performance significantly.
One simple way to reduce the overhead is to "denormalize" the available resource field--instead of calculating it each time on the fly, we could cache the value and only update it when the agent's allocations or total resources change.