Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686376 - sys-kernel/linux-firmware-99999999 : Very slow code in src_prepare
Summary: sys-kernel/linux-firmware-99999999 : Very slow code in src_prepare
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-05-20 09:18 UTC by Ulrich Müller
Modified: 2019-06-07 16:53 UTC (History)
2 users (show)

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


Attachments
sys-kernel/linux-firmware: Speed up src_prepare code. (0001-sys-kernel-linux-firmware-Speed-up-src_prepare-code.patch,2.75 KB, patch)
2019-05-20 09:18 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2019-05-20 09:18:08 UTC
Created attachment 577376 [details, diff]
sys-kernel/linux-firmware: Speed up src_prepare code.

Building the list of files to remove in src_prepare() takes up to one minute on recent hardware, especially when the savedconfig file is fully populated. With more than 1800 files in the package, using a quadratic algorithm in bash is not such a good idea any more.

I am attaching a patch for the live ebuild, but the snapshot should be updated as well, e.g., with the next version bump.
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2019-05-20 14:59:34 UTC
Just cosmetic, and related to the previous commit to this package for bug 686288, but would

ebegin
find [...] || die
eend 0

not mess up output formatting?

ebegin
find [...]
eend $? || die

might preserve the output layout better.

Either way it looks good to me. Feel free to commit.
Comment 2 Larry the Git Cow gentoo-dev 2019-05-20 21:36:53 UTC
The bug has been closed via the following commit(s):

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

commit 83510840c1dfde65e806e405c64abec44b9095f4
Author:     Ulrich Müller <ulm@kph.uni-mainz.de>
AuthorDate: 2019-05-20 08:53:39 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-05-20 21:31:15 +0000

    sys-kernel/linux-firmware: Speed up src_prepare code.
    
    Building the list of files to remove could take up to one minute
    on recent hardware, because it used a quadratic algorithm in bash.
    Call grep instead, which is way faster.
    
    Acked-by: Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
    Closes: https://bugs.gentoo.org/686376
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 .../linux-firmware/linux-firmware-99999999.ebuild  | 33 ++++++++--------------
 1 file changed, 11 insertions(+), 22 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2019-06-07 16:53:05 UTC
The bug has been referenced in the following commit(s):

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

commit 3f8617e27179037fda7c9e11fce910be165feccb
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-06-07 16:23:33 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-06-07 16:52:52 +0000

    sys-kernel/linux-firmware: New snapshot.
    
    Update src_prepare to use the faster code from the live ebuild.
    
    Bug: https://bugs.gentoo.org/686376
    Acked-by: Rick Farina <zerochaos@gentoo.org>
    Package-Manager: Portage-2.3.67, Repoman-2.3.14
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 sys-kernel/linux-firmware/Manifest                 |   1 +
 .../linux-firmware/linux-firmware-20190603.ebuild  | 301 +++++++++++++++++++++
 2 files changed, 302 insertions(+)