(Aug 01 2005 08:47) Brian Wilson wrote: > Grep is fast. Swup is slow. I do the same thing > Colin does to save time.
That's a bold statement. And bold statements should not go unanswered. ;) First a test with flushing cache (worst case): [EMAIL PROTECTED] ~$ swup --flush-cache; time swup --search-package ssh (...) Found 4 package(s) matching "ssh": openssh-3.9.0p1-3tr openssh-clients-3.9.0p1-3tr openssh-server-3.9.0p1-3tr openssh-server-config-3.9.0p1-3tr real 0m14.853s user 0m4.230s sys 0m0.370s [EMAIL PROTECTED] ~$ swup --flush-cache; time swup --list-latest | grep ssh openssh-3.9.0p1-3tr - OpenSSH free Secure Shell (SSH) implementation openssh-clients-3.9.0p1-3tr - OpenSSH Secure Shell protocol clients openssh-server-3.9.0p1-3tr - OpenSSH Secure Shell protocol server (sshd) openssh-server-config-3.9.0p1-3tr - OpenSSH Secure Shell protocol server config real 0m14.360s user 0m4.160s sys 0m0.430s Damn. That's close. Let's look at it in a best case scenario: Doing a test without flushing cache first: [EMAIL PROTECTED] ~$ time swup --search-package ssh Fetching upgrade info for site: mirror.230780.net Community contrib Fetching upgrade info for site: Community contrib Fetching upgrade info for site: mirror.230780.net Fetching upgrade info for site: Trustix http Fetching upgrade info for site: Trustix ftp Found 4 package(s) matching "ssh": openssh-3.9.0p1-3tr openssh-clients-3.9.0p1-3tr openssh-server-3.9.0p1-3tr openssh-server-config-3.9.0p1-3tr real 0m4.788s user 0m1.180s sys 0m0.200s [EMAIL PROTECTED] ~$ time swup --list-latest | grep ssh openssh-3.9.0p1-3tr - OpenSSH free Secure Shell (SSH) implementation openssh-clients-3.9.0p1-3tr - OpenSSH Secure Shell protocol clients openssh-server-3.9.0p1-3tr - OpenSSH Secure Shell protocol server (sshd) openssh-server-config-3.9.0p1-3tr - OpenSSH Secure Shell protocol server config real 0m5.067s user 0m1.230s sys 0m0.170s I'm stunned! ;) I tried several times and pasted the best result for both of them. It's not an accurate science, but my point is that you really don't save much by piping to grep, remember that you have loading time of the grep binary, seektime of the harddisk etc that is costly, while the internal swup searching is done by instructions already in memory. The actual regular expression search algorithms in python are quite fast, and probably just as optimized as the ones in grep anyway. kind regards c -- Christian H. Toldnes Trustix Developer _______________________________________________ tsl-discuss mailing list [email protected] http://lists.trustix.org/mailman/listinfo/tsl-discuss
