[RFC] speed up walk of working dir by 20-25%

Vadim Gelfer vadim.gelfer at gmail.com
Tue Jun 13 16:45:10 CDT 2006


On 6/13/06, Matt Mackall <mpm at selenic.com> wrote:

> Not an unreasonable thing to do. But is this portable to anything but Linux?

comes from bsd, portable to linux and macos.

i have rewritten listdir extension in pure c. will use dirent.d_type
if available, else lstat.

here are performances of "hg --time add" on kernel repo:

pure python: 2.25 seconds
lstat in c: 1.83 seconds (19% faster)
d_type in c: 1.63 seconds (37% faster)

and "hg --time status":

pure python: 1.91 seconds
lstat in c: 1.49 seconds (32% faster)
d_type in c: 1.57 seconds (18% faster)

i have attached more portable c code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listdir.c
Type: text/x-csrc
Size: 6395 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial/attachments/20060613/5cea5fbc/listdir.c


More information about the Mercurial mailing list