Rev 2071: (John Arbash Meinel) use lazy importing to improve startup time in /home/pqm/archives/thelove/bzr/+trunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Oct 11 10:26:59 BST 2006


------------------------------------------------------------
revno: 2071
revision-id: pqm at pqm.ubuntu.com-20061011092657-e42bec6ef14c036c
parent: pqm at pqm.ubuntu.com-20061010072307-037a6f63da8a1bdd
parent: john at arbash-meinel.com-20061011011715-cead1acd0ee04372
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2006-10-11 10:26:57 +0100
message:
  (John Arbash Meinel) use lazy importing to improve startup time
modified:
  HACKING                        HACKING-20050805200004-2a5dc975d870f78c
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  TODO                           TODO-20050426050852-44d2ad9048dafbe9
  bzrlib/atomicfile.py           atomicfile.py-20050509044450-dbd24e6c564f7c66
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/bundle/__init__.py      changeset.py-20050513021216-b02ab57fb9738913
  bzrlib/bundle/commands.py      __init__.py-20050617152058-1b6530d9ab85c11c
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/cmd_version_info.py     __init__.py-20051228204928-697d01fdca29c99b
  bzrlib/commands.py             bzr.py-20050309040720-d10f4714595cf8c3
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/conflicts.py            conflicts.py-20051001061850-78ef952ba63d2b42
  bzrlib/diff.py                 diff.py-20050309040759-26944fbbf2ebbf36
  bzrlib/doc/api/branch.txt      branch.txt-20060130010728-d96c35d50b205aed
  bzrlib/gpg.py                  gpg.py-20051017065112-8654536d415dacc6
  bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
  bzrlib/lazy_import.py          lazy_import.py-20060910203832-f77c54gf3n232za0-1
  bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
  bzrlib/option.py               option.py-20051014052914-661fb36e76e7362f
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
  bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
  bzrlib/progress.py             progress.py-20050610070202-df9faaab791964c0
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/sign_my_commits.py      sign_my_commits.py-20060215152201-5a6363365180e671
  bzrlib/store/revision/__init__.py __init__.py-20060303014707-305238f06ae20dae
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/blackbox/test_ignore.py test_ignore.py-20060703063225-4tm8dc2pa7wwg2t3-1
  bzrlib/tests/blackbox/test_too_much.py blackbox.py-20050620052131-a7370d756399f615
  bzrlib/tests/test_bundle.py    test.py-20050630184834-092aa401ab9f039c
  bzrlib/tests/test_merge_core.py test_merge_core.py-20050824132511-eb99b23a0eec641b
  bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
  bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
  bzrlib/tests/test_whitebox.py  whitebox.py-20050530064534-a063aafb4a0a3a04
  bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
  bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
  bzrlib/transport/local.py      local_transport.py-20050711165921-9b1f142bfe480c24
  bzrlib/ui/__init__.py          ui.py-20050824083933-8cf663c763ba53a9
  bzrlib/ui/text.py              text.py-20051130153916-2e438cffc8afc478
  bzrlib/urlutils.py             urlutils.py-20060502195429-e8a161ecf8fac004
  bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
  profile_imports.py             profile_imports.py-20060618020306-k5uw80achysrokj9-1
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061011011715-cead1acd0ee04372
    parent: john at arbash-meinel.com-20061011002323-82ba88c293d7caff
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Wed 2006-10-11 11:17:15 +1000
    message:
      Update HACKING and TODO
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061011002323-82ba88c293d7caff
    parent: john at arbash-meinel.com-20061006075043-c6a5c1e0bfd001bb
    parent: pqm at pqm.ubuntu.com-20061010072307-037a6f63da8a1bdd
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Wed 2006-10-11 10:23:23 +1000
    message:
      [merge] bzr.dev 2070
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006075043-c6a5c1e0bfd001bb
    parent: john at arbash-meinel.com-20061006074457-c2ab0b4e243899bf
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:50:43 +1000
    message:
      more lazy importing gets bzr rocks down to 116ms
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006074457-c2ab0b4e243899bf
    parent: john at arbash-meinel.com-20061006073616-c9a36866b39fce47
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:44:57 +1000
    message:
      Update builtins to use errors.foo. Now errors can be avoided entirely for a bzr rocks run
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006073616-c9a36866b39fce47
    parent: john at arbash-meinel.com-20061006072917-b4cae3e6fe80f712
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:36:16 +1000
    message:
      make bzrlib/conflicts.py lazy
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006072917-b4cae3e6fe80f712
    parent: john at arbash-meinel.com-20061006072555-b41c9a6f481fd1d6
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:29:17 +1000
    message:
      from bzrlib.ui lazy import progress, and make progress import lazily
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006072555-b41c9a6f481fd1d6
    parent: john at arbash-meinel.com-20061006072218-930b322b5d303872
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:25:55 +1000
    message:
      Make bzrlib.config use lazy importing
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006072218-930b322b5d303872
    parent: john at arbash-meinel.com-20061006071431-90c2cbe88302e462
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:22:18 +1000
    message:
      Don't import 'bzrlib.tree' directly in bzrlib.builtins
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006071431-90c2cbe88302e462
    parent: john at arbash-meinel.com-20061006071351-e3fdd47eed1c3e7e
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:14:31 +1000
    message:
      don't import errors, and try to lazy import logging in bzrlib.trace
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006071351-e3fdd47eed1c3e7e
    parent: john at arbash-meinel.com-20061006070355-c8b1a246df0c0933
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:13:51 +1000
    message:
      lazy import revisionspec and errors for bzrlib.options
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006070355-c8b1a246df0c0933
    parent: john at arbash-meinel.com-20061006070057-d09e21288bcd371c
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:03:55 +1000
    message:
      lazy import getpass in bzrlib.ui.text
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006070057-d09e21288bcd371c
    parent: john at arbash-meinel.com-20061006070031-1206bad6a645029c
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:00:57 +1000
    message:
      Make cmd_version_info.py lazy import most other modules
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006070031-1206bad6a645029c
    parent: john at arbash-meinel.com-20061006064134-0716158c26306b4d
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 17:00:31 +1000
    message:
      Make importing errors lazy for osutils
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006064134-0716158c26306b4d
    parent: john at arbash-meinel.com-20061006063211-389ac4db0ce7167c
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 16:41:34 +1000
    message:
      NEWS about even better rocks time
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006063211-389ac4db0ce7167c
    parent: john at arbash-meinel.com-20061006062706-e84640cea080b6e9
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 01:32:11 -0500
    message:
      also avoid importing WorkingTree before it is needed
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006062706-e84640cea080b6e9
    parent: john at arbash-meinel.com-20061006062402-bd9aa74abbcdfe67
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 01:27:06 -0500
    message:
      shave off another 10ms by avoiding importing merge from working tree
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006062402-bd9aa74abbcdfe67
    parent: john at arbash-meinel.com-20061006055344-e73b97b7c6ca6e72
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 16:24:02 +1000
    message:
      NEWS about improved startup times
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006055344-e73b97b7c6ca6e72
    parent: john at arbash-meinel.com-20061006003846-b447b3dda0c17ce2
    parent: pqm at pqm.ubuntu.com-20061005041829-4f10f01c0c5ba3ac
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 15:53:44 +1000
    message:
      [merge] bzr.dev 2063
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061006003846-b447b3dda0c17ce2
    parent: john at arbash-meinel.com-20061005224209-6847d92c751c2dc1
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 10:38:46 +1000
    message:
      make lazy_import lazily import errors
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20061005224209-6847d92c751c2dc1
    parent: john at arbash-meinel.com-20060913032103-c2ad6ab606f96839
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Fri 2006-10-06 08:42:09 +1000
    message:
      Now that mkdtemp and rmtree are lazy, they should not be directly improted.
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060913032103-c2ad6ab606f96839
    parent: john at arbash-meinel.com-20060913032041-593053ae0d35b0d5
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 22:21:03 -0500
    message:
      lazy_import plugin and transport/local
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060913032041-593053ae0d35b0d5
    parent: john at arbash-meinel.com-20060913025149-ecee20a9ca6fc4a6
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 22:20:41 -0500
    message:
      Update output of --profile-imports to understand from foo import bar time
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060913025149-ecee20a9ca6fc4a6
    parent: john at arbash-meinel.com-20060913024423-2f0729076ddd4e31
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 21:51:49 -0500
    message:
      lazy_import AtomicFile
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060913024423-2f0729076ddd4e31
    parent: john at arbash-meinel.com-20060912231716-b46abd2325a03c0d
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 21:44:23 -0500
    message:
      lazy_import osutils and sign_my_commits
      Move doc tests into test_osutils, since lazy_import doesn't play nicely
      with DocTest
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912231716-b46abd2325a03c0d
    parent: john at arbash-meinel.com-20060912225953-6d8567932927b1e3
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 18:17:16 -0500
    message:
      Fix the inventory doc tests
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912225953-6d8567932927b1e3
    parent: john at arbash-meinel.com-20060912223718-b605523794911ca9
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 17:59:53 -0500
    message:
      Change how 'revision' is imported to avoid problems later
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912223718-b605523794911ca9
    parent: john at arbash-meinel.com-20060912222528-309c74df59ea80b6
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 17:37:18 -0500
    message:
      Hack around loading 'copy' to make startup much faster
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912222528-309c74df59ea80b6
    parent: john at arbash-meinel.com-20060912221638-bf11ba3e3f498106
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 17:25:28 -0500
    message:
      lazy_import inventory.py, avoids importing tarfile
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912221638-bf11ba3e3f498106
    parent: john at arbash-meinel.com-20060912221230-d3980a26890a32e3
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 17:16:38 -0500
    message:
      lazy_import diff.py
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912221230-d3980a26890a32e3
    parent: john at arbash-meinel.com-20060912220329-0683bcd6066fc117
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 17:12:30 -0500
    message:
      lazy_import bundle and bundle.commands
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912220329-0683bcd6066fc117
    parent: john at arbash-meinel.com-20060912211954-3d8074cfb66e1139
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 17:03:29 -0500
    message:
      lazy import versionedfile, late-load bzrlib.merge
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912211954-3d8074cfb66e1139
    parent: john at arbash-meinel.com-20060912204642-91599869cc863f07
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 16:19:54 -0500
    message:
      Find a few places that weren't importing their dependencies.
      Demandload a few more places.
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912204642-91599869cc863f07
    parent: john at arbash-meinel.com-20060912202803-3bcdde1ff7245c8f
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 15:46:42 -0500
    message:
      Cleanup, deprecated, and get the tests passing again.
      
      bzrlib.builtins.merge is heavily used by the test suite, though it is
      really the wrong place for a function like that.
      lazy imports work badly with doctests, but so far none of the doc tested
      modules had anything worth testing in that fashion.
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912202803-3bcdde1ff7245c8f
    parent: john at arbash-meinel.com-20060912201643-66a32bc419a28c6f
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 15:28:03 -0500
    message:
      lazy_import bzrlib/repository.py
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912201643-66a32bc419a28c6f
    parent: john at arbash-meinel.com-20060912201032-0bd76e7736ebf2f1
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 15:16:43 -0500
    message:
      Shave off another 40ms by demand loading branch and bzrdir
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912201032-0bd76e7736ebf2f1
    parent: john at arbash-meinel.com-20060912200229-4a1c12aead0f0b30
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 15:10:32 -0500
    message:
      Make profile_imports aware of lazy_import stuff
    ------------------------------------------------------------
    merged: john at arbash-meinel.com-20060912200229-4a1c12aead0f0b30
    parent: john at arbash-meinel.com-20060912193702-22c752299731a663
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: use_lazy_importer
    timestamp: Tue 2006-09-12 15:02:29 -0500
    message:
      Demandloading builtins.py drops our load time from 350ms to 291ms



More information about the bazaar-commits mailing list