bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] Locate: Fold case once at most.


From: James Youngman
Subject: Re: [Patch] Locate: Fold case once at most.
Date: Mon, 6 Jun 2005 06:03:10 +0100
User-agent: Mutt/1.3.28i

On Mon, Jun 06, 2005 at 05:00:15AM +0200, Bas van Gompel wrote:
> Hallo James,
> 
> Op Tue, 31 May 2005 03:44:02 +0200 (MET DST) schreef ik
> in <address@hidden>:
> [...]
> :  Suggested ChangeLog entry:
> :
> :  2005-05-31  Bas van Gompel  <address@hidden>
> :
> :     * locate/locate.c: Fold case once, only when needed.
> 
> Could you please confirm receiving the above mail, and the patch
> it refers to?

Yes, I've received the patch.   Thanks for your help.

> Any comments?

When we discussed this functionality earlier, I mentioned that it used
to be the case that findutils would fold the case of each character
once (or never if not required).  It used to cope intelligently with
case-folding when dealing with LOCATE02 databases, too (that is, it
didn't repeatedly case-fold repeated prefixes).  I indicated that I
had sacrificed this optimisation when refactoring the tests.

I've since been thinking that the bits of code that read from the
database should be more decoupled.  That would also allow us to tell
the database backend whether we need it to do case folding.  That wold
bring us back to a situation where we can regain the optimisation, and
may also allow us to support additional database formats more neatly.
One that comes to mind is gzip, which should produce a locate database
less than half the size:-

$ /usr/local/bin/locate -d  /usr/local/var/locatedb  '?*'  | gzip -9 > 
filenames.gz
address@hidden:~$ ls -l filenames.gz /usr/local/var/locatedb -rw-r--r--  1 
james users 2188446 2005-06-06 05:54 filenames.gz
-rw-r--r--  1 root  staff 4792566 2005-06-05 06:28 /usr/local/var/locatedb

So, I'm thinking about reorganising "locate" to decouple the database
reading code a bit more, which is why I haven't applied the patch
(yet).

Regards,
James.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]