[PATCH] Take advantage of fstat calls clustering per directory if OS support it

Benoit Boissinot bboissin at gmail.com
Thu Oct 9 10:13:54 CDT 2008


On Thu, Oct 9, 2008 at 4:30 PM, Petr Kodl <petrkodl at gmail.com> wrote:
>
> The speedup on directory tree with 2k directories and 63k files is about
> factor of 1.8 (1.3s -> 0.8s for hg diff - hg startup overhead about .2s)

In your first mail you reported different numbers (3s without the patch, 0.7s
with) what is the difference ?

> +        visit = util.sort([f for f in dmap if f not in results and match(f)])
> +        for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
> +            if not st is None and not getkind(st.st_mode) in (regkind, lnkkind):

I find "st is not None" more natural, but maybe that's just me :)

> +        nf  = ncase(nf)
> +        pos = nf.rfind(sep)
> +        if pos == -1:
> +            dir, base = '.', nf
> +        else:
> +            dir, base = nf[:pos], nf[pos+1:]

what is the difference with os.path.split() ?

regards,

Benoit


More information about the Mercurial-devel mailing list