RFC: the old readdir question again

John Arbash Meinel john at arbash-meinel.com
Tue Aug 19 15:25:13 BST 2008


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

Robert Collins wrote:
> So I've been poking at status a little, and I recall one thing that was
> noted about git, that it stats/reads in sorted inode order. We can do
> that if we use readdir directly (ignoring the kind field as we're going
> to stat anyway).
> 
> I'm not sure where it would get exposed, probably it would be internal
> to walkdirs.
> 
> How well will that fit with your recent windows work John?
> 
> -Rob

So I would imagine it would just be another "_walkdirs_utf8" implementation.
The api is a little bit different from the "walkdirs()" one, because it
returns a UTF-8 path as well as the path-on disk (for UTF-8 filesystems these
are the same, for Windows one is a Unicode path the other UTF-8, etc.)

_walkdirs_utf8 returns the stat value, etc back to the user.

I would imagine the big wins might be:

1) Using something other than 'os.lstat'. I'm not 100% positive, but I think
its stat object is trying to be too flexible, causing a bit more overhead (you
can access it via attributes or offsets, but the bzrlib code only accesses
attributes.)

2) statting in inode order, I don't strictly know the win/loss of this. But as
we need to have sorted order anyway, you can certainly readdir(), sort by
inode, stat, sort by name, return.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIqtfJJdeBCYSNAAMRAo8GAKDRoTBZ+/sqqKcDK5QNvHQCUO9pXwCfYEbz
iXzk2jrLjmbRGk7bDGyqtq4=
=miiF
-----END PGP SIGNATURE-----



More information about the bazaar mailing list