[MERGE] inode sorted stats in status

John Arbash Meinel john at arbash-meinel.com
Wed Aug 20 14:12:04 BST 2008


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

Robert Collins wrote:
> So, I've implemented inode sorting for stats. It doesn't make a huge
> difference that I can see, though I may just have trees where the disk
> alphabetical order and the inode order match.
> 
> Its also only doing inode-within-a-dir optimisation.
> 
> I don't know if this is truely needed - I would love some feedback and
> testing. Particularly *cold cache* testing.
> 
> In my testing, it shaves 2 seconds off cold-cache status of a mozilla
> tree:
> 
> :!time ./bzr st ../test-repos/mozilla/ 
> 
> real    0m36.818s
> user    0m3.552s
> sys     0m1.252s
> 
> :!time ./bzr st ../test-repos/mozilla/
> 
> real    0m38.199s
> user    0m3.640s
> sys     0m1.188s
> 
> It doesn't seem particularly different on hot-cache operations.
> 
> -Rob
> 

+    ctypedef struct dirent:
+        char d_name[256]

^- you declare 'dirent' as a typedef here, and then have to force one later.
Why not just do:

struct dirent:
?

Alternatively, you could do:

struct _dirent:
...

ctypedef _dirent dirent

I get the feeling you are running into typedef problems because you explicitly
declared it as a typedef when it is just a plain struct object.

+    ctypedef struct DIR
+    # should be DIR *, pyrex barfs.
+    DIR * opendir(char * name)

^- I don't understand the comment here.


+dot = ord('.')
+

^- I think what you are looking for is c'.' which is the pyrex way of saying
you are talking about a single character.

I would certainly recommend taking over the *whole* walkdir stack, like I did
with the _walkdirs_win32 extension. To do so, you have to create an iterator
class (that defines __next__), because pyrex doesn't support generators.

However, it ends up being very nice because you can have context and
functions. We should really consider changing the _walkdirs_utf8 api to be an
iterator class which allows you to call "skip(directory)" rather than the
current api. IIRC, you wanted this for handling the mixing of WT.walkdirs()
which had 2 iterators it needed to handle properly.

So in the end, I'd like to see a bigger improvement before we bring this in. I
think you are probably on the right track, but 2s out of 35s isn't really
worth it yet.

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

iD8DBQFIrBgkJdeBCYSNAAMRAoITAJ9KpAJxxL38hEfh6G4Xq3CMFtib4ACguVxW
B0820fMdcEYC21bkve/L0gs=
=olJp
-----END PGP SIGNATURE-----



More information about the bazaar mailing list