Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918682 - sys-apps/portage: find_smallest_cycle can be optimized to traverse fewer nodes
Summary: sys-apps/portage: find_smallest_cycle can be optimized to traverse fewer nodes
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 916977
Blocks:
  Show dependency tree
 
Reported: 2023-11-28 03:39 UTC by Zac Medico
Modified: 2023-12-01 03:03 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2023-11-28 03:39:51 UTC
while trying to find a fix for bug 917660, we found that find_smallest_cycle can be optimized to traverse fewer nodes.

On my laptop, this optimization brings the emerge -pe @world time down to 3m28.884s, compared to 10m44.268s with portage-3.0.55.
Comment 1 Larry the Git Cow gentoo-dev 2023-11-28 04:20:31 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=49e01d041c74680a81860b819daff812d83df02f

commit 49e01d041c74680a81860b819daff812d83df02f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-11-28 03:42:17 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-11-28 03:42:17 +0000

    find_smallest_cycle: Optimize to traverse fewer nodes
    
    If gather_deps is traversing a cycle that is greater than
    or equal to the size of the current smallest_cycle, then
    abort early. Also abort early if we traverse a node
    encountered in a previous cycle for the same ignore_priority,
    since that means the two cycles are identical.
    
    On my laptop, this brings the emerge -pe @world time down
    to 3m28.884s, compared to 10m44.268s with portage-3.0.55.
    
    Bug: https://bugs.gentoo.org/918682
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/depgraph.py                            | 36 ++++++++++++++++++++--
 .../tests/resolver/test_rebuild_ghostscript.py     |  2 +-
 .../resolver/test_runtime_cycle_merge_order.py     |  7 +++--
 3 files changed, 39 insertions(+), 6 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2023-12-01 03:03:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=baec60737ddc370dcf77ce1c797ff187357c4b14

commit baec60737ddc370dcf77ce1c797ff187357c4b14
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-12-01 02:54:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-01 02:54:29 +0000

    sys-apps/portage: add 3.0.56
    
    Closes: https://bugs.gentoo.org/760893
    Closes: https://bugs.gentoo.org/917033
    Closes: https://bugs.gentoo.org/917259
    Closes: https://bugs.gentoo.org/917315
    Closes: https://bugs.gentoo.org/918515
    Closes: https://bugs.gentoo.org/918682
    Closes: https://bugs.gentoo.org/918683
    Closes: https://bugs.gentoo.org/916977
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.56.ebuild | 238 +++++++++++++++++++++++++++++++++
 2 files changed, 239 insertions(+)