[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30701.1185347660@turing-police.cc.vt.edu>
Date: Wed, 25 Jul 2007 03:14:20 -0400
From: Valdis.Kletnieks@...edu
To: Rene Herman <rene.herman@...il.com>
Cc: david@...g.hm, Nick Piggin <nickpiggin@...oo.com.au>,
Ray Lee <ray-lk@...rabbit.org>,
Jesper Juhl <jesper.juhl@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
ck list <ck@....kolivas.org>, Ingo Molnar <mingo@...e.hu>,
Paul Jackson <pj@....com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: -mm merge plans for 2.6.23
On Wed, 25 Jul 2007 07:30:37 +0200, Rene Herman said:
> Yes, but what's locate's usage scenario? I've never, ever wanted to use it.
> When do you know the name of something but not where it's located, other
> than situations which "which" wouldn't cover and after just having
> installed/unpacked something meaning locate doesn't know about it yet either?
My favorite use - with 5 Fedora kernels and as many -mm kernels on my laptop,
doing a 'locate moby' finds all the moby.c and moby.o and moby.ko for
the various releases. For bonus points, something like:
ls -lt `locate iwl3945.ko`
to find all 19 copies that are on my system, and remind me which ones were
compiled when. Or just when you remember the name of some one-off 100-line
Perl program that you wrote 6 months ago, but not sure which directory you
left it in... ;)
You want hard numbers? Here you go - 'locate' versus 'find'
(/usr/src/ has about 290K files on it):
% strace locate iwl3945.ko >| /tmp/foo3 2>&1
% wc /tmp/foo3
96 592 6252 /tmp/foo3
% strace find /usr/src /lib -name iwl3945.ko >| /tmp/foo4 2>&1
% wc /tmp/foo4
328380 1550032 15708205 /tmp/foo4
# echo 1 > /proc/sys/vm/drop_caches (to empty the caches
% time locate iwl3945.ko > /dev/null
real 0m0.872s
user 0m0.867s
sys 0m0.008s
% time find /usr/src /lib -name iwl3945.ko > /dev/null
find: /usr/src/lost+found: Permission denied
real 1m12.241s
user 0m1.128s
sys 0m3.566s
So 96 system calls in 1 second, against 328K calls in a minute. There's your
use case, right there. Now if we can just find a way for that find/updatedb
to not be as painful to the rest of the system.....
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists