I've identified the problem.  It does eventually produce some output,
but it takes ages.

bash while read loops really suck when it comes to performance, so 
when it has to read every line (egrep for '.') in 40K+ line file,
it takes far too long.

in the long run, i'll be re-writing dlocate in perl.  in the short
term, i'll try knocking up a quick awk script to replace the current
ugly while/read loop.


[ a little later ]

hmmm.  that was easier than i thought.


dpkg:

# time dpkg -l \* > /dev/null

real    0m4.179s
user    0m0.847s
sys     0m0.140s


original dlocate using a bash while/read loop:

# time dlocate -l . > /dev/null

real    1m11.527s
user    0m20.705s
sys     0m53.480s


fixed dlocate using awk:

# time ./dlocate -l . > /dev/null

real    0m1.342s
user    0m1.210s
sys     0m0.217s



problem solved.  and dlocate is faster than dpkg again.

will upload updated dlocate package soon.


craig

-- 
craig sanders <[EMAIL PROTECTED]>

BOFH excuse #290:

The CPU has shifted, and become decentralized.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to