On 11/23/2014 05:50 PM, Andrew Savchenko wrote: > I've done some profiling with this both patches (from bugs 529660 > and 530010) applied. See *p530010*.pdf files for both hosts here: > ftp://brunestud.info/gentoo/portage-v4.tar.xz > > For performance enhancement I get the following data for > normal (that is unprofiled) runs: > time calls > desktop 13% 62% > hitomi 6% 62% > > where time — is % less real time for emerge run and calls stands > for % less _select_pkg_highest_available_imp calls. > > While testing --verbose-conflicts I found that if tree contains > unresolved conflict, it takes much longer time for emerge to > proceed: +36% on desktop and +44% on hitomi. > > Unresolved conflict was created by adding apt-text/dvipdfmx to the > @world: it blocks latex-2014 update. (Actually I just reverted one > of fixes I made earlier in order to run -DNupv @world without > errors .) Looks like emerge tries to build more depgraps to solves > this issue.
This is controlled by the --backtrack option (10 is default). That means it can create up to 10 depgraphs before it aborts. On a slow computer, you might consider putting --backtrack=1 in EMERGE_DEFAULT_OPTS. That way, it won't waist so mush time searching for a solution before it ultimately fails. Note that you need at least --backtrack=1 for EAPI 5 sub-slot rebuilds to work. > I'm not sure if this may be a subject for optimization. Yes, there are many possible ways to optimize it. Heuristics can be used to recognize various kinds of solvable conflicts and solve them more efficiently. For example, the code in this commit added support for solving some slot conflicts without backtracking: https://github.com/gentoo/portage/commit/a862cc5dd1a56114fa579c5fb01b518b243666d9 > Graps are also present in the tarball in "*@world_with_blocks*.pdf" > files. Unfortunately, I don't see anything else that's easily optimized by memoization. Further optimization will require more heuristics as mentioned above. > And thank your for optimizations! They really give a new breath to > my old boxes. Awaiting for them upstream :) You're welcome. Thanks for collecting the data. -- Thanks, Zac