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>
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/c5441d4a9ca15352178e7fea85fb1c77 https://github.com/gentoo/portage/pull/340
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(-)