[MERGE] Fast _walkdirs for win32
John Arbash Meinel
john at arbash-meinel.com
Thu Jul 17 05:50:41 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
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.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the bazaar