Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 732378 - sys-apps/portage: Use lru_cache for use_reduce, vercmp, and catpkgsplit
Summary: sys-apps/portage: Use lru_cache for use_reduce, vercmp, and catpkgsplit
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 603994 (view as bug list)
Depends on:
Blocks: 835380 733180
  Show dependency tree
 
Reported: 2020-07-12 19:59 UTC by Zac Medico
Modified: 2023-05-20 05:10 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 2020-07-12 19:59:47 UTC
We've got a patch which enables lru_cache for use_reduce, vercmp, and catpkgsplit:

https://archives.gentoo.org/gentoo-portage-dev/message/a4db905a64e3c1f6d88c4876e8291a65
Comment 1 Larry the Git Cow gentoo-dev 2020-07-13 17:26:07 UTC
The bug has been referenced in the following commit(s):

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

commit d9ee5b09664ab2255b62c1d52d554721ef8b716a
Author:     Chun-Yu Shei <cshei@google.com>
AuthorDate: 2020-07-13 06:30:20 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-07-13 07:14:29 +0000

    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).
    
    Bug: https://bugs.gentoo.org/732378
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/dep/__init__.py | 107 ++++++++++++++++++++++++++------------------
 lib/portage/versions.py     |   3 ++
 2 files changed, 67 insertions(+), 43 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2020-07-19 05:45:24 UTC
The bug has been referenced in the following commit(s):

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

commit bb3180edb5d310d5382bb3c0772c06be0b354806
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-07-19 05:18:41 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-07-19 05:37:48 +0000

    sys-apps/portage: Bump to version 3.0.0
    
     #703698 Improve repos.conf handling of boolean settings
     #721516 ecompress complains about compressed files that have
             been excluded by docompress -x
     #729852 Set XTerm titles for konsole
     #731114 Drop support for python2.7
     #731246 man ebuild(5) has incorrect example of $P and $PN
     #732378 Use lru_cache for use_reduce, vercmp, and catpkgsplit
     #733154 List of ignored warnings in .desktop files should be
             updated for compatibility with >=desktop-file-utils-0.25
    
    Bug: https://bugs.gentoo.org/733180
    Bug: https://bugs.gentoo.org/703698
    Bug: https://bugs.gentoo.org/721516
    Bug: https://bugs.gentoo.org/729852
    Bug: https://bugs.gentoo.org/731114
    Bug: https://bugs.gentoo.org/731246
    Bug: https://bugs.gentoo.org/732378
    Bug: https://bugs.gentoo.org/733154
    Package-Manager: Portage-3.0.0, Repoman-2.3.23
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest             |   1 +
 sys-apps/portage/portage-3.0.0.ebuild | 263 ++++++++++++++++++++++++++++++++++
 2 files changed, 264 insertions(+)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-05 03:28:50 UTC
*** Bug 603994 has been marked as a duplicate of this bug. ***