[MERGE] Fast _walkdirs for win32

John Arbash Meinel john at arbash-meinel.com
Thu Jul 17 05:50:41 BST 2008

Hash: SHA1

Attached is a patch which follows up on my earlier work to use the
windows native FindFile APIs for walkdirs. It is a pretty good fit,
because walkdirs wants to return the stat information along with the
paths, and that is what FindFile* does. (In fact, it uses FindFile* for
each os.stat, and another one for the os.listdir.)

I decided to go directly to a Pyrex function, because win32file has some
issues with timestamp handling.

It seems that the overhead of creating a FindFirstFile for every stat is
pretty horrendous. Specifically, for a tree of 9k entries, --lsprof puts
3.5s/5s to nt.lstat().

With this patch, doing 'bzr status' in a mysql tree on Win32 changes
from: 4.2s => 0.64s, or about 6.5x faster. It is quite noticeable when
your command prompt hangs for 4s versus returning in < 1s.

Actually, it turns the time to 'bzr st' the MySQL working tree to be
faster than the old time to 'bzr st' the bzr.dev tree.

Anyway, this isn't urgent for 1.6, but it is a rather nice improvement,
so I'd like to get it in sooner rather than later. (Otherwise I'm going
to be tempted to run something other than bzr.dev as my primary 'bzr',
which I'm not keen on doing.)


Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32_find_files.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080716/ef2d4dd4/attachment-0001.diff 

More information about the bazaar mailing list