Overview
SHA1 Hash: | c2ad73ed9243ac9497046fa8eae19f904b56bc77 |
---|---|
Date: | 2008-02-21 05:13:14 |
User: | aku |
Comment: | Added high-level logging for memory tracing to the code breaking the preliminary changesets. First runs indicate that the DEPC array becomes so very large, caused by a high amount of indirect dependencies (several hundred). |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/cvs2fossil/lib/c2f_prev.tcl from [cc210d2578] to [c3cfc3bb4a].
@@ -203,11 +203,17 @@ # Data structures: # Map: POS revision id -> position in list. # CROSS position in list -> number of dependencies crossing it # DEPC dependency -> positions it crosses # List: RANGE Of the positions itself. + # Map: DELTA position in list -> time delta between its revision + # and the next, if any. # A dependency is a single-element map parent -> child + + # InitializeBreakState initializes their contents after + # upvar'ing them from this scope. It uses the information in + # DEPENDENCIES to do so. InitializeBreakState $myitems set fragments {} set new [list $range] @@ -799,10 +805,13 @@ dependencies dependencies # First we create a map of positions to make it easier to # determine whether a dependency crosses a particular index. + log write 14 csets {IBS: #rev [llength $revisions]} + log write 14 csets {IBS: pos map, cross counter} + array set pos {} array set cross {} array set depc {} set range {} set n 0 @@ -810,10 +819,12 @@ lappend range $n set pos($rev) $n set cross($n) 0 incr n } + + log write 14 csets {IBS: pos/[array size pos], cross/[array size cross]} # Secondly we count the crossings per position, by iterating # over the recorded internal dependencies. # Note: If the timestamps are badly out of order it is @@ -823,10 +834,12 @@ # # Note 2: start == end is not possible. It indicates a # self-dependency due to the uniqueness of positions, # and that is something we have ruled out already, see # 'rev internalsuccessors'. + + log write 14 csets {IBS: cross counter filling, pos/cross map} foreach {rid children} [array get dependencies] { foreach child $children { set dkey [list $rid $child] set start $pos($rid) @@ -848,11 +861,16 @@ } set depc($dkey) $crosses } } + log write 14 csets {IBS: pos/[array size pos], cross/[array size cross], depc/[array size depc] (for [llength $revisions])} + log write 14 csets {IBS: timestamps, deltas} + InitializeDeltas $revisions + + log write 14 csets {IBS: delta [array size delta]} return } proc InitializeDeltas {revisions} { upvar 1 delta delta @@ -869,10 +887,12 @@ FROM revision R WHERE R.rid IN $theset }]] { set stamp($rid) $time } + + log write 14 csets {IBS: stamp [array size stamp]} set n 0 foreach rid [lrange $revisions 0 end-1] rnext [lrange $revisions 1 end] { set delta($n) [expr {$stamp($rnext) - $stamp($rid)}] incr n @@ -1081,11 +1101,11 @@ # var(dv) = dict (revision -> list (revision)) typemethod internalsuccessors {dv revisions} { upvar 1 $dv dependencies set theset ('[join $revisions {','}]') - log write 14 cset internalsuccessors + log write 14 csets internalsuccessors # See 'successors' below for the main explanation of # the various cases. This piece is special in that it # restricts the successors we look for to the same set of # revisions we start from. Sensible as we are looking for @@ -1144,19 +1164,22 @@ # We allow revisions to be far apart in time in the same # changeset, but in turn need the pseudo-dependencies to # handle this. - log write 14 cset pseudo-internalsuccessors + log write 14 csets {internal [array size dep]} + log write 14 csets {collected [array size dependencies]} + log write 14 csets pseudo-internalsuccessors array set fids {} foreach {rid fid} [state run [subst -nocommands -nobackslashes { SELECT R.rid, R.fid FROM revision R WHERE R.rid IN $theset }]] { lappend fids($fid) $rid } + set groups {} foreach {fid rids} [array get fids] { if {[llength $rids] < 2} continue foreach a $rids { foreach b $rids { if {$a == $b} continue @@ -1165,13 +1188,18 @@ lappend dependencies($a) $b set dep($a,$b) . set dep($b,$a) . } } + set n [llength $rids] + lappend groups [list $n [expr {($n*$n-$n)/2}]] } - log write 14 cset complete + log write 14 csets {pseudo [array size fids] ([lsort -index 0 -decreasing -integer $groups])} + log write 14 csets {internal [array size dep]} + log write 14 csets {collected [array size dependencies]} + log write 14 csets complete return } # result = 4-list (itemtype itemid nextitemtype nextitemid ...) typemethod loops {revisions} {