Add caching to use_reduce, vercmp, and catpkgsplit
Each of these functions is called repeatedly with the same arguments
many times. Cache sizes were selected to minimize memory use increase,
while still providing about the same speedup compared to a cache with
unbounded size. "emerge -uDvpU --with-bdeps=y @world" runtime decreases
from 44.32s -> 29.94s -- a 48% speedup, while the maximum value of the
RES column in htop increases from 280 MB -> 290 MB.
"emerge -ep @world" time slightly decreases from 18.77s -> 17.93, while
max observed RES value actually decreases from 228 MB -> 214 MB (similar
values observed across a few before/after runs).
Signed-off-by: Zac Medico <firstname.lastname@example.org>
(cherry picked from commit d9ee5b09664ab2255b62c1d52d554721ef8b716a)
Tested-by: Yi Chou <email@example.com>
Reviewed-by: Mike Frysinger <firstname.lastname@example.org>
Commit-Queue: Yi Chou <email@example.com>
2 files changed