Will hacking on qfile, i've seen that reading the CONTENTS files from the vdb is much slower than it used to be, because of the following change introduced a few months ago: http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?r1=1.124&r2=1.125 On my ~1600 pkgs vdb (~440000 lines of CONTENTS), this code takes ~4.5 seconds of CPU time, meaning that a simple "qfile /one/file" is now 10 times slower with 0.1.22 than it was with 0.1.21 (5 sec vs. 0.5 sec). This will also matter for performances of big queries done with the --from-file option, because the vdb may be walked through several times (see the benchs i will soon attach to bug #158829). I will attach a patch which speeds this up. It is not equivalent to the current code though: instead of replacing any space character, it only takes care of tabs. But according to the comment about ferringb plans, i think it should be enough. With this patch, there is still a ~0.6 second penalty compared to dropping this chunk completly, but i think that's acceptable.
Created attachment 105841 [details, diff] optimize-vdb-contents-reading.patch
/var/cvsroot/gentoo-projects/portage-utils/main.c,v <-- main.c new revision: 1.131; previous revision: 1.130