[MERGE] log|less 590% to 727% faster
John Arbash Meinel
john at arbash-meinel.com
Sat Jun 17 23:14:00 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>
>>> I like it. It is nice and simple, and the whole point is wanting to get
>>> the first screenfull up as soon as possible.
>>>
>>> Did you ever look into creating a long-live (1000+ revs) branch with
>>> actual changes?
>
> No, I haven't looked at that. Thanks for the reminder. log FILENAME
> and log -v haven't really been at the top of my mind. Worth looking at.
>
> I think I'm happy with 44 milliseconds for the first screenfull. Merges
> shouldn't affect that very much. Now if only we can pull down that
> startup time...
>
> Aaron
Not really before we change our dirstate format, so that we don't have
to load cElementTree.
Either that, or we hack up ElementTree and copy, and pre-install them.
Actually, we could just mess with the import of 'inspect' for 'copy'.
I just played with something, and I found a way that 'demandload()' can
actually hack-into sys.modules so that other modules actually load a
demandload version.
This semi-evil hack is available from here:
http://bzr.arbash-meinel.com/misc/demandload_through_sys/
Basically, you can do:
demandload(globals(), 'inspect foo bar')
sys.modules['inspect'] = inspect
sys.modules['foo'] = foo
sys.modules['bar'] = bar
And then anyone else who tries to do 'import foo' actually gets the
demandload object until they access an attribute.
If you look at my demandload branch of bzr, I played with it, and I now
have the time for 'bzr --no-plugins root' down to 240 ms
These are the overall timings:
rocks root
original 493 504
demandload 148 281
And that is even without '--no-aliases' now that we aren't loading
validate.py. (It still takes 35ms to load configobj, but that is down
from 135ms).
So now that I've played with it some, we might actually want to
considered adding demandload into the core.
I realize it is a little evil to do my monkeypatching demandload, but it
can shave off as much as 100ms from the startup time. Which can be 1/2
the time we spend.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFElH6nJdeBCYSNAAMRAm05AKDO7/0ukulYqbAyXJmhdEZaqqQC1QCgpPV5
Edzz3CmMQVrU8ndFaYAOGCA=
=maFD
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list