[MERGE] Various hackery to reduce startup time.

John Arbash Meinel john at arbash-meinel.com
Sun Sep 14 14:37:45 BST 2008


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


...

>> For now, I'd rather leave "bzrlib.user_encoding" alone, as we haven't
>> deprecated it, and I think 3rd-party tools will use it. I *really* wish
>> we had a way to issue a proper deprecation warning for accessing a
>> module member. If it was a class we can use a property. Any ideas of
>> what we could do here? (I worked on the ones for a DeprecatedList, etc.
>> The problem is we don't use an *attribute* of user_encoding, we just use
>> it as a string.)
> 
> Maybe we can make it be an object other than a str that warns when its __str__
> is invoked?

I thought about that, but I figured the typical use is:

foo.decode(bzrlib.user_encoding)

And I don't think that invokes str() at any time (I'm not positive about
that, and if we *could* find something, that would be great.)

> 

...

> Oops.  Fixed.  (There's probably other improvements that could be made to the
> imports in this module, but then bzrlib/weave.py isn't really that important.)

It isn't specifically important, but it may get pulled in when probing
for disk formats. (Because we have a MetaWeave, etc.) We'll have to
check for that sort of thing. I would guess it shows up with "bzr
status" in a subdirectory. Because we probe "breadth first" across all
formats per directory before chdir().

We *might* want to consider probing the default format across many
directories, but I don't know if that will be a big win. (I *do* seem to
remember that Branch.open() is far more expensive than I would expect it
to be.) Testing here shows "Branch.open()" at about 4.4ms, and open +
lock/unlock is 6.0ms, which didn't seem as bad as I thought.

...

> 
> All times are best of 5 runs (using “for i in `seq 5` ; do time $command ;
> done”.  I set my laptop cpufreq governor to “performance” as well.
> 

...

> I'd expect there to be a noticeable improvement for cold-cache times too, but I
> haven't checked.
> 
> -Andrew.
> 
> 

Good to see.

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

iEYEARECAAYFAkjNE6kACgkQJdeBCYSNAAPiBwCcCzVIEoIhXEbzyE87q0QUmEvX
/qQAoIJLMcvJ4hWhnmk7UWqaoCROKXSf
=sTKs
-----END PGP SIGNATURE-----



More information about the bazaar mailing list