Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 529660

Summary: sys-apps/portage: performance optimization: memoize use_reduce results for _slot_operator_update_probe
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement CC: bircoph, pacho
Priority: Normal Keywords: InVCS
Version: 2.2   
Hardware: All   
OS: All   
URL: http://thread.gmane.org/gmane.linux.gentoo.devel/93603/focus=93816
See Also: https://bugs.gentoo.org/show_bug.cgi?id=732378
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 835380    

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:

	https://github.com/zmedico/portage/tree/bug_529660

I've posted it for review here:

	http://thread.gmane.org/gmane.linux.gentoo.portage.devel/4814
Comment 2 Zac Medico gentoo-dev 2014-11-24 08:23:15 UTC
This is in the master branch:

https://github.com/gentoo/portage/commit/9ba4f2aa6a2755a73fb652b4557919047d649fd1
Comment 3 Andrew Savchenko gentoo-dev 2014-12-04 10:39:09 UTC
Apparently this patch is in 2.2.15.
Thanks!