Description
Compared to 1.9.0, HierarchicalAllocations_BENCHMARK_Test.PersistentVolumes ran on 1.10.x branch/current master shows a regression (up to 50 times in some cases) and exhibits a quadratic dependence of allocation time versus the number of agents in the few-framework cases.
This regression was introduced by
https://reviews.apache.org/r/71460
which employed a single `Resources` object to track offered/allocated resources of all agents on the cluster
and exacerbated by https://reviews.apache.org/r/71488 that followed a similar approach.
In the case when resources of agents are non-addable (for example, each agent has an unique persistent volume), this results in O(N^2) asymptotic time complexity versus the number of agents due to the addition/subtraction of Resources being O(X*Y) where X and Y are number of individual `Resource`s on the left and on the right side.
Moreover, the approach taken in those PRs violates the convention that `Resources` belonging to different agents should not be added/subtracted.