[MERGE] Use win32file.FindFiles instead of os.lstat when available

John Arbash Meinel john at arbash-meinel.com
Thu Jun 26 17:52:36 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is an optional optimizer when running on windows. I was working
in a moderately sized tree (~9k files+dirs), and I noticed that "bzr
status" was a bit slower than I would have expected. When I did
- --lsprof, all the time was taken in "nt.lstat". I checked around and saw
that pywin32 exposes the FindFiles api, which will return the directory
entries and their stat info as you go.

In my testing, it makes things faster. Somewhere between 2-4x for the
time spent it walkdirs. It also seems to do interesting things with
caching. Because after I've run status with this code a couple of times,
it makes the plain "bzr status" faster, though still not as fast.

Anyway, abstractions are great, as this lets me slip in a more optimized
version for walking win32 paths. (And yes, this shouldn't be my primary
focus, but it was getting in my way and I wanted it to be better.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhjyVQACgkQJdeBCYSNAANpJwCeM8PpDrd5zcCIEjx4w5hRH0sh
lNIAnjmMf3K2DVJDfsatpDBto7uM7pCt
=/R5O
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32_find_files.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080626/e39f4ffd/attachment-0001.diff 


More information about the bazaar mailing list