Merge lp:~spiv/bzr/faster-branch-open into lp:bzr

Proposed by Andrew Bennetts
Status: Merged
Approved by: Andrew Bennetts
Approved revision: no longer in the source branch.
Merged at revision: 5999
Proposed branch: lp:~spiv/bzr/faster-branch-open
Merge into: lp:bzr
Diff against target: 29 lines (+8/-1)
2 files modified
bzrlib/branch.py (+5/-1)
doc/en/release-notes/bzr-2.4.txt (+3/-0)
To merge this branch: bzr merge lp:~spiv/bzr/faster-branch-open
Reviewer Review Type Date Requested Status
Andrew Bennetts Approve
Review via email: mp+66165@code.launchpad.net

Commit message

Make Branch.open more than 3x faster.

Description of the change

This patch serves two purposes:

 1) It makes Branch.open over 3x faster (it drops from ~6.5ms to 2ms in my testing of opening a local copy of lp's trunk)
 2) It will make Vincent pull a funny face.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On 28/06/11 17:18, Andrew Bennetts wrote:
> For more details, see:
> https://code.launchpad.net/~spiv/bzr/faster-branch-open/+merge/66165
>
> This patch serves two purposes:
>
> 1) It makes Branch.open over 3x faster (it drops from ~6.5ms to 2ms in my testing of opening a local copy of lp's trunk)
> 2) It will make Vincent pull a funny face.
>
I'm not sure about 1), but 2) is definitely worthwhile.

Jelmer

Revision history for this message
Andrew Bennetts (spiv) wrote :

Vincent says this is okay, although he claims he didn't make any faces!

review: Approve
Revision history for this message
Andrew Bennetts (spiv) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/branch.py'
2--- bzrlib/branch.py 2011-06-20 11:04:42 +0000
3+++ bzrlib/branch.py 2011-06-28 15:30:38 +0000
4@@ -2942,7 +2942,11 @@
5 # you can always ask for the URL; but you might not be able to use it
6 # if the repo can't support stacking.
7 ## self._check_stackable_repo()
8- stacked_url = self._get_config_location('stacked_on_location')
9+ # stacked_on_location is only ever defined in branch.conf, so don't
10+ # waste effort reading the whole stack of config files.
11+ config = self.get_config()._get_branch_data_config()
12+ stacked_url = self._get_config_location('stacked_on_location',
13+ config=config)
14 if stacked_url is None:
15 raise errors.NotStacked(self)
16 return stacked_url
17
18=== modified file 'doc/en/release-notes/bzr-2.4.txt'
19--- doc/en/release-notes/bzr-2.4.txt 2011-06-28 13:55:39 +0000
20+++ doc/en/release-notes/bzr-2.4.txt 2011-06-28 15:30:38 +0000
21@@ -26,6 +26,9 @@
22 .. Improvements to existing commands, especially improved performance
23 or memory usage, or better results.
24
25+* ``Branch.open`` is now about 3x faster (about 2ms instead of 6.5ms).
26+ (Andrew Bennetts).
27+
28 Bug Fixes
29 *********
30