[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: faster fnmatch
From: |
Ondrej Bilka |
Subject: |
Re: faster fnmatch |
Date: |
Fri, 17 Apr 2009 18:02:21 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Fri, Apr 17, 2009 at 11:47:20AM +0200, James Youngman wrote:
> On Thu, Apr 16, 2009 at 8:09 PM, Ondrej Bilka <address@hidden> wrote:
> > Hello. I am writing partial fnmatch to speed up locate et al.
>
> >
> > Here is list what provided speedup and can be applied to original source
> >
> > FOLD causes worst performance slowdown.
> > From what I tried is best convert in buffer to uppercase when needed.
>
> This seems like an attractive option but I'm a little concerned about
> whether this will produce the correct result with characters like ß or
> Ï and ï.
I do not quite understand fnmatch source. Can you point me out description of
extended wildcards?
Could somebody more familiar write patch doing following?
to FOLD
quick way here is include fnmatch_loop twice with uppercase and normal version.
This will save lot if's.
>
> > Other optimalizations are based on preprocessing pattern
> >
> > 1. For each * we compute minimal size of rest and we have smaller for
> > cycles.
> > 2. We can replace *? by ?*
> > 3. If * is followed by letter we check it at for cycle of *
> > 4. If pattern contains four consecutive letters we compare them as int
without preprocesing only viable optimalization is look if after * is letter
and then check this letter at for loop. This saves lot function calls.
--
Melting hard drives