Commit 01433e96 authored by Kirill Smelkov's avatar Kirill Smelkov

X rebuild: tests: Don't compute keyCover in trackSet

63s -> 61s
parent a87cc6de
...@@ -333,17 +333,26 @@ func (rbs RBucketSet) coverage() string { ...@@ -333,17 +333,26 @@ func (rbs RBucketSet) coverage() string {
// trackSet returns what should be ΔBtail.trackSet coverage for specified tracked key set. // trackSet returns what should be ΔBtail.trackSet coverage for specified tracked key set.
func (rbs RBucketSet) trackSet(tracked SetKey) PPTreeSubSet { func (rbs RBucketSet) trackSet(tracked SetKey) PPTreeSubSet {
trackSet, _ := rbs.trackSetWithCov(tracked) // nil = don't compute keyCover
// (trackSet is called from inside hot inner loop of rebuild test)
trackSet := rbs._trackSetWithCov(tracked, nil)
return trackSet return trackSet
} }
// trackSetWithCov returns what should be ΔBtail.trackSet and its key coverage for specified tracked key set. // trackSetWithCov returns what should be ΔBtail.trackSet and its key coverage for specified tracked key set.
func (rbs RBucketSet) trackSetWithCov(tracked SetKey) (trackSet PPTreeSubSet, keyCover *RangedKeySet) { func (rbs RBucketSet) trackSetWithCov(tracked SetKey) (trackSet PPTreeSubSet, keyCover *RangedKeySet) {
trackSet = PPTreeSubSet{}
keyCover = &RangedKeySet{} keyCover = &RangedKeySet{}
trackSet = rbs._trackSetWithCov(tracked, keyCover)
return trackSet, keyCover
}
func (rbs RBucketSet) _trackSetWithCov(tracked SetKey, outKeyCover *RangedKeySet) (trackSet PPTreeSubSet) {
trackSet = PPTreeSubSet{}
for k := range tracked { for k := range tracked {
kb := rbs.Get(k) kb := rbs.Get(k)
keyCover.AddRange(KeyRange{kb.lo, kb.hi_}) if outKeyCover != nil {
outKeyCover.AddRange(KeyRange{kb.lo, kb.hi_})
}
// trackSet explicitly records only regular buckets. // trackSet explicitly records only regular buckets.
// embedded buckets all have oid=zodb.InvalidOid and would lead to z // embedded buckets all have oid=zodb.InvalidOid and would lead to z
newNode := false newNode := false
...@@ -384,7 +393,7 @@ func (rbs RBucketSet) trackSetWithCov(tracked SetKey) (trackSet PPTreeSubSet, ke ...@@ -384,7 +393,7 @@ func (rbs RBucketSet) trackSetWithCov(tracked SetKey) (trackSet PPTreeSubSet, ke
p = p.parent p = p.parent
} }
} }
return trackSet, keyCover return trackSet
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment