Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26270 - revdep-rebuild ridiculously slow (easy to fix)
Summary: revdep-rebuild ridiculously slow (easy to fix)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-09 07:21 UTC by Georgi Georgiev
Modified: 2003-08-14 13:59 UTC (History)
1 user (show)

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


Attachments
revdep-rebuild.patch (revdep-rebuild.patch,659 bytes, patch)
2003-08-09 07:23 UTC, Georgi Georgiev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Georgi Georgiev 2003-08-09 07:21:48 UTC
The revdep-rebuild is ridiculously slow at the fourth step "Assigning files to
ebuilds" if there is nothing to rebuild. The code looks like this:

        cat $LLIST.3_rebuild | sed 's/^/obj /;s/$/ /' |
        (
            cd /var/db/pkg
            fgrep -l -f - */*/CONTENTS
        ) | sed s:/CONTENTS:: > $LLIST.4_ebuilds

I tried to test why and ran the following commands:

root@lion pkg # pwd
/var/db/pkg

root@lion pkg # echo "foo foo" | /bin/sh -c "time fgrep -l -f - */*/CONTENTS"

real    0m1.715s
user    0m1.690s
sys     0m0.030s

root@lion pkg # cat /dev/null | /bin/sh -c "time fgrep -l -f - */*/CONTENTS"

real    4m9.157s
user    4m5.340s
sys     0m0.350s

My suggestion for an enhancement would go in an attachment.
Comment 1 Georgi Georgiev 2003-08-09 07:23:45 UTC
Created attachment 15812 [details, diff]
revdep-rebuild.patch

Almost skips step 4 if there is nothing after step 3.
Comment 2 SpanKY gentoo-dev 2003-08-13 20:30:02 UTC
added to cvs, thanks for the research :)
Comment 3 Stanislav Brabec 2003-08-14 13:59:27 UTC
Yes, I have been thinking about adding the same check for the same reason. Thanks for fixing.

Evaluating of really */*/CONTENTS takes a long time.

OT: This search has still limitation to about 5000 installed packages (exactly 128 KiB of arguments; this is the reason, why cd /var/db/pkg - it saves 11 characters per entry).