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

Bug 649806

Summary: sys-apps/portage: fix config class to cache profile.bashrc stat results
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement CC: joakim.tjernlund, tsmksubc
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=650814
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 835380, 659322    

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(-)