Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
8f0e37f2
Commit
8f0e37f2
authored
Jun 25, 2021
by
Kirill Smelkov
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X rebuild: tests: Precompute kadj10·kadj21
82s -> 75s.
parent
2c0b4793
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
wcfs/internal/xbtree/δbtail_test.go
wcfs/internal/xbtree/δbtail_test.go
+22
-2
No files found.
wcfs/internal/xbtree/δbtail_test.go
View file @
8f0e37f2
...
...
@@ -542,6 +542,23 @@ func (kadj KAdjMatrix) Map(keys SetKey) SetKey {
return
res
}
// Mul returns kadjA·kadjB .
//
// (kadjA·kadjB).Map(keys) = kadjA.Map(kadjB.Map(keys))
func
(
kadjA
KAdjMatrix
)
Mul
(
kadjB
KAdjMatrix
)
KAdjMatrix
{
// ~ assert kadjA.keys == kadjB.keys
// check only len here; the rest will be asserted by Map
if
len
(
kadjA
)
!=
len
(
kadjB
)
{
panicf
(
"kadj.Mul: different keys:
\n\n
kadjA: %v
\n
kadjB: %v"
,
kadjA
,
kadjB
)
}
kadj
:=
make
(
KAdjMatrix
,
len
(
kadjB
))
for
k
,
tob
:=
range
kadjB
{
kadj
[
k
]
=
kadjA
.
Map
(
tob
)
}
return
kadj
}
// KAdj computes adjacency matrix for t1 -> t2 transition.
//
// The set of keys for which kadj matrix is computed can be optionally provided.
...
...
@@ -962,6 +979,9 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
kadj21
:=
KAdj
(
t2
,
t1
,
allTestKeys
(
t0
,
t1
,
t2
))
kadj12
:=
KAdj
(
t1
,
t2
,
allTestKeys
(
t0
,
t1
,
t2
))
// kadj210 = kadj10·kadj21
kadj210
:=
kadj10
.
Mul
(
kadj21
)
ø
:=
PPTreeSubSet
{}
// verify t0 -> t1 Track(keys1) Rebuild -> t2 Track(keys2) Rebuild
...
...
@@ -1008,7 +1028,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
// Update() (which includes rebuild)
keys1R2
:=
kadj12
.
Map
(
keys1
)
for
{
keys1R2_
:=
kadj
10
.
Map
(
kadj21
.
Map
(
keys1R2
)
)
keys1R2_
:=
kadj
210
.
Map
(
keys1R2
)
if
keys1R2
.
Equal
(
keys1R2_
)
{
break
}
...
...
@@ -1046,7 +1066,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
// Track(keys2) + rebuild
keys12R2
:=
keys1R2
.
Union
(
keys2
)
for
{
keys12R2_
:=
kadj
10
.
Map
(
kadj21
.
Map
(
keys12R2
)
)
keys12R2_
:=
kadj
210
.
Map
(
keys12R2
)
if
keys12R2
.
Equal
(
keys12R2_
)
{
break
}
...
...
Kirill Smelkov
@kirr
mentioned in commit
305d897b
·
Oct 27, 2021
mentioned in commit
305d897b
mentioned in commit 305d897b15ac0866de464de36b34c1fe1de90a63
Toggle commit list
Kirill Smelkov
@kirr
mentioned in commit
2ab4be93
·
Oct 28, 2021
mentioned in commit
2ab4be93
mentioned in commit 2ab4be938541c61bf881216bdffc5376241ccc30
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment