this is REALLY worth checking out.

-sv


-------- Forwarded Message --------
From: Patrick Reynolds <[EMAIL PROTECTED]>
To: seth vidal <[EMAIL PROTECTED]>
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

_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to