On Sun, Feb 08, 2009 at 02:07:08PM +0900, Douglas Anderson wrote:
> Hi, does anyone use --category filtering in equery belongs? I want to
> get rid of it, or at least deprecate it. My reasoning:
> 
> * We use 'equery belongs' when don't know to what package a file
> belongs. Even if we have a suspicion, most users would have to look up
> the category of the package before typing it in.
> * Even if you happen to know the exact category of the package that
> installed the file (why are you using belongs?), typing
> --category=app-portage takes more time than is saved by filtering by
> category (about 5 seconds more by my unscientific test).
> 
> Even in a script setting, I see no use for this. The time saved is minuscule:
> 
> $ time equery belongs /usr/bin/equery --category app-portage
> [ Searching for file(s) /usr/bin/equery in app-portage... ]
> app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
> 
> real    0m4.002s
> user    0m3.680s
> sys     0m0.076s
> $ time equery belongs /usr/bin/equery
> [ Searching for file(s) /usr/bin/equery in *... ]
> app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
> 
> real    0m4.205s
> user    0m3.738s
> sys     0m0.102s

You should do profiling, and *verify* category actually works; it 
should be able to make a world of difference.  Case in point via 
pkgcore-

ferri...@beast ~ $ time pquery --owns /usr/bin/equery
app-portage/gentoolkit-0.2.4.2-r1

real    0m1.162s
user    0m1.142s
sys     0m0.020s
ferri...@beast ~ $ time pquery --owns /usr/bin/equery 'app-portage/*'
app-portage/gentoolkit-0.2.4.2-r1

real    0m0.168s
user    0m0.156s
sys     0m0.011s


Yes it's not equery, but I *know* pkgcores implementation works thus 
using it to point out the speed difference if implemented correctly.

It would probably help if the category support was enabled in the 
code, also (quick check of equery shows the cat filtering is 
disabled).

~harring

Attachment: pgpl7rBjX9iss.pgp
Description: PGP signature

Reply via email to