Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 160725 - app-portage/portage-utils: speed up vdb CONTENTS files reading
Summary: app-portage/portage-utils: speed up vdb CONTENTS files reading
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Portage Utils Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-07 16:32 UTC by TGL
Modified: 2010-01-24 21:32 UTC (History)
0 users

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


Attachments
optimize-vdb-contents-reading.patch (optimize-vdb-contents-reading.patch,740 bytes, patch)
2007-01-07 16:33 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TGL 2007-01-07 16:32:19 UTC
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.
Comment 1 TGL 2007-01-07 16:33:11 UTC
Created attachment 105841 [details, diff]
optimize-vdb-contents-reading.patch
Comment 2 solar (RETIRED) gentoo-dev 2007-01-07 17:48:48 UTC
/var/cvsroot/gentoo-projects/portage-utils/main.c,v  <--  main.c
new revision: 1.131; previous revision: 1.130