On Fri, Apr 17, 2009 at 11:47:20AM +0200, James Youngman wrote:
> On Thu, Apr 16, 2009 at 8:09 PM, Ondrej Bilka <nel...@seznam.cz> 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


Reply via email to