1
"bzr update" performance analysis
2
=================================
4
There are 5 different slightly different situations in which bzr update
10
* heavy checkout w/ local changes
11
* bzr update could work on "bound branch" w/no wt
15
Should be O(1) to determine
16
Tree base is up to date
17
wt.last-rev == wt.b.last-rev
19
No local changes, only new revisions
20
====================================
21
1) Need to move wt.last_rev (O(1))
22
2) apply delta from base to new rev (O(changes))
23
applying changes to files is approx (O(lines-in-files ^ 2))
24
3) update meta-info (executable bits, etc) about modified files (O(changes))
26
2/3 could be concurrent (but that may not necessarily be faster)
28
potential issue w/ serialized is having 50k files in limbo/
30
the limbo/ directory could be avoided in some cases, for example when
31
adding new files in new directories.
33
modifying in place: reduces fragmentation of fs, not atomic
34
w/ local modification, potential of data loss
37
"local mod" is diff between disk and last commit, not merge base
39
Detecting name conflicts should be O(siblings). Alternatively, conflicts
40
with existing files can be detected using stat() and conflicts with new files
41
can be detected by examining the pending transform. This changes
42
complexity to O(changes).
44
out of date heavyweight checkout, out of date w/master
45
=======================================================
46
1) open working tree, check latest revision
47
2) open working tree branch, check latest revision
48
3) mismatch => update wt => wt.b.lastrev
49
apply delta to tree O(changed file size)
52
stop always -> inform user they need to repeat (why not?, GFD)
53
4) pull new revs M => L O(newrevs)
55
local committed changes become a pending merge
56
local uncommitted stay uncommitted
57
local pending merges are retained (should be gc'd)
60
should bzr update report where the source is ?
61
should bzr update handle both cases (local tree out-of-date w/local branch, checkout out-of-date w/master) ?
63
if updating would diverge, give opportuniuty to branch/unbind instead
64
local ahead, "push to master"
67
1) can this be done as a single logical step?
68
2) can this be done w/o modifying working tree until end? possible performance improvements
69
3) if the pulling revision step could deliver full texts, that may help for the merge (same thing as "bzr pull")