[Yum-devel] [Fwd: Re: [Dulug] Letter by ESR]

seth vidal skvidal at linux.duke.edu
Thu Feb 22 22:52:47 UTC 2007


this is REALLY worth checking out.

-sv


-------- Forwarded Message --------
From: Patrick Reynolds <reynolds at cs.duke.edu>
To: seth vidal <skvidal at linux.duke.edu>
Subject: Re: [Dulug] Letter by ESR
Date: Thu, 22 Feb 2007 17:41:58 -0500 (EST)

I've found what's probably the main culprit for yum search performance.
You're calling select 15000+ times.  Don't.  Even with an index, select is
kind of slow.  How about:
   executeSQL("select * from packages")
   for each result
     if regex.match(result.name) || regex.match(result.summary) ....
       callback(db2package(result))
Very rough pseudocode, but the idea should be clear.  Call select once.

I wrote a version with substring (not regex) support, and it runs even
faster than apt.  It assumes the presence of the SQLite caches.

paris:~{1009}$ time ./yum-search foo | wc -l
24

real    0m0.176s
user    0m0.116s
sys     0m0.064s

http://www.cs.duke.edu/~reynolds/projects/yum-search.tar.gz

--Patrick




More information about the Yum-devel mailing list