Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529660 - sys-apps/portage: performance optimization: memoize use_reduce results for _slot_operator_update_probe
Summary: sys-apps/portage: performance optimization: memoize use_reduce results for _s...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 155723 835380
  Show dependency tree
Reported: 2014-11-18 06:41 UTC by Zac Medico
Modified: 2023-05-20 05:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2014-11-18 06:41:23 UTC
Profiling has shown that depgraph._slot_operator_update_probe is repeating the same use_reduce calls for the same package. I have a patch which implements memoization of use_reduce results for this function, and it significantly improves performance of dependency calculations. With memoization, 'emerge -puvDN @world' on one of my computers takes 22.4% less time, and results in 13.5% fewer use_reduce calls.
Comment 1 Zac Medico gentoo-dev 2014-11-18 06:59:49 UTC
My patch is in the following branch:

I've posted it for review here:
Comment 2 Zac Medico gentoo-dev 2014-11-24 08:23:15 UTC
This is in the master branch:
Comment 3 Andrew Savchenko gentoo-dev 2014-12-04 10:39:09 UTC
Apparently this patch is in 2.2.15.