Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649806 - sys-apps/portage: fix config class to cache profile.bashrc stat results
Summary: sys-apps/portage: fix config class to cache profile.bashrc stat results
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 835380 659322
  Show dependency tree
 
Reported: 2018-03-06 23:11 UTC by Zac Medico
Modified: 2023-05-20 05:11 UTC (History)
2 users (show)

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 2018-03-06 23:11:25 UTC
The profile.bashrc stat calls are repeated for every setcpv call here:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/package/ebuild/config.py?h=portage-2.3.24#n1614

We can easily perform the stat calls in the constructor, and save the results in an attribute, like when we initialize self._pbashrcdict.

Reported-by: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Comment 2 Larry the Git Cow gentoo-dev 2018-07-15 21:54:08 UTC
The bug has been referenced in the following commit(s):

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

commit 2de6ba26fd45fe942329ac928029e4edf603e125
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-07-15 04:54:45 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-07-15 21:47:33 +0000

    config: cache profile.bashrc stat results (bug 649806)
    
    Optimize config to stat profile.bashrc files once in the constructor,
    in order to avoid repeated stat calls in the setcpv method.
    
    Bug: https://bugs.gentoo.org/649806
    Reviewed-by: Brian Dolbec <dolsen@gentoo.org>

 pym/portage/package/ebuild/config.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)