faster CIs (#13803)
* ttables: smaller table, 5x speedup * thavlak: less iterations, less loops; 30% speedup * tasyncclosestall: shorter timeout; 35% speedup * gcleak4: less iterations, 2x speedup * ttimes: remove deprecated stuff * tdangerisrelease: remove cpp backend, 3x speedup * tfrexp1: smaller range, 2x speedup * trtree: fix warnings, less iterations, 6x speedup * tasyncawait_cyclebreaker: smaller swarm size; 2x speedup * trealloc: smaller number of iterations; 10x speedup * towned_binary_tree: less iterations, 4x speedup * tclosure: remove unused code, less iterations; 2x speedup * twaitany: less durations; 1.4x speedup * tasync_misc: less iterations, 2x speedup * t8535: smaller sleep, 1.5x speedup * tmanyjoin: smaller sleep, 2x speedup * t12221: shorter sleeps, removed two slower tests; 1.6x speedup * tfuturestream: smaller sleep; 1.5x speedup * growobjcrash: less iterations; 2x speedup * ttryrecv: smaller sleep; 1.5x speedup * treusetvar: less threads; 2x speedup * delete tthreadanalysis2, basically a duplicate of tthreadanalysis * t7758: less iterations, 1.5x speedup * tasyncawait: smaller swarm, less messages; 1.5x speedup * tjsandnativeasync: smaller sleep, 1.5x speedup * tpendingcheck: smaller sleep, 1.5x speedup * remove rodfiles test category * move tseq from its own category to 'collections' category * remove unneeded tests and helpers from 'assert' category * stdlib: merge tbitops2 into tbitops * remove 'trepr2' from 'stdlib' cat * merge 'tstreams' into one file * remove 'tinefficient_const_table' from 'ccbugs' cat * merge 'tcollections_to_string' into 'tcollections' * tblocking_channel: smaller sleep, small speedup * tconvexhull: less iterartions; 1.2x speedup * merge 'tdeepcopy2' into 'tdeepcopy' * merge 'tdisjoint_slice2' into 'tdisjoint_slice1' * tmissing_deepcopy: smaller sequence * tsendtwice: smaller arrays; 5x speedup * remove 'tindexerrorformatbounds' * disable multimethod tests * remove 'gc:none' and 'refc' without 'd:useRealtimeGC' from gc tests * koch.nim: bootstrap just with '-d:release', no need for 'csource' * add github workflow for documentation * testament: no need for 8 sub-second decimals
This commit is contained in:
parent
2a278f6eba
commit
8088633250
72 changed files with 532 additions and 1082 deletions
|
|
@ -72,20 +72,20 @@ proc newRStarTree*[M, D: Dim; RT, LT](minFill: range[30 .. 50] = 40): RStarTree[
|
|||
result.root = newLeaf[M, D, RT, LT]()
|
||||
|
||||
proc center(r: Box): auto =#BoxCenter[r.len, type(r[0].a)] =
|
||||
var result: BoxCenter[r.len, type(r[0].a)]
|
||||
var res: BoxCenter[r.len, type(r[0].a)]
|
||||
for i in 0 .. r.high:
|
||||
when r[0].a is SomeInteger:
|
||||
result[i] = (r[i].a + r[i].b) div 2
|
||||
res[i] = (r[i].a + r[i].b) div 2
|
||||
elif r[0].a is SomeFloat:
|
||||
result[i] = (r[i].a + r[i].b) / 2
|
||||
res[i] = (r[i].a + r[i].b) / 2
|
||||
else: assert false
|
||||
return result
|
||||
return res
|
||||
|
||||
proc distance(c1, c2: BoxCenter): auto =
|
||||
var result: type(c1[0])
|
||||
var res: type(c1[0])
|
||||
for i in 0 .. c1.high:
|
||||
result += (c1[i] - c2[i]) * (c1[i] - c2[i])
|
||||
return result
|
||||
res += (c1[i] - c2[i]) * (c1[i] - c2[i])
|
||||
return res
|
||||
|
||||
proc overlap(r1, r2: Box): auto =
|
||||
result = type(r1[0].a)(1)
|
||||
|
|
@ -177,21 +177,6 @@ proc chooseSubtree[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; b: Box[D, RT]; lev
|
|||
n = nn.a[i0].n
|
||||
return n
|
||||
|
||||
proc chooseLeaf[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; b: Box[D, RT]; level: int): H[M, D, RT, LT] =
|
||||
assert level >= 0
|
||||
var n = t.root
|
||||
while n.level > level:
|
||||
var j = -1 # selected index
|
||||
var x: type(b[0].a)
|
||||
let nn = Node[M, D, RT, LT](n)
|
||||
for i in 0 ..< n.numEntries:
|
||||
let h = enlargement(nn.a[i].b, b)
|
||||
if j < 0 or h < x or (x == h and area(nn.a[i].b) < area(nn.a[j].b)):
|
||||
x = h
|
||||
j = i
|
||||
n = nn.a[j].n
|
||||
return n
|
||||
|
||||
proc pickSeeds[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; n: Node[M, D, RT, LT] | Leaf[M, D, RT, LT]; bx: Box[D, RT]): (int, int) =
|
||||
var i0, j0: int
|
||||
var bi, bj: type(bx)
|
||||
|
|
@ -412,12 +397,7 @@ proc adjustTree[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; l, ll: H[M, D, RT, LT
|
|||
nn = nil
|
||||
else:
|
||||
let h: N[M, D, RT, LT] = (b, nn)
|
||||
if t of RStarTree[M, D, RT, LT]:
|
||||
nn = overflowTreatment(RStarTree[M, D, RT, LT](t), p, h)
|
||||
elif t of RTree[M, D, RT, LT]:
|
||||
nn = quadraticSplit(RTree[M, D, RT, LT](t), p, h)
|
||||
else:
|
||||
assert false
|
||||
nn = quadraticSplit(t, p, h)
|
||||
assert n == H[M, D, RT, LT](p)
|
||||
assert n != nil
|
||||
assert t.root != nil
|
||||
|
|
@ -567,18 +547,16 @@ proc condenseTree[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; leaf: Leaf[M, D, RT
|
|||
rsinsert(RStarTree[M, D, RT, LT](t), Node[M, D, RT, LT](n).a[i], n.level)
|
||||
else:
|
||||
assert false
|
||||
elif t of RTree[M, D, RT, LT]:
|
||||
else:
|
||||
for n in q:
|
||||
if n of Leaf[M, D, RT, LT]:
|
||||
for i in 0 ..< n.numEntries:
|
||||
insert(RTree[M, D, RT, LT](t), Leaf[M, D, RT, LT](n).a[i])
|
||||
insert(t, Leaf[M, D, RT, LT](n).a[i])
|
||||
elif n of Node[M, D, RT, LT]:
|
||||
for i in 0 ..< n.numEntries:
|
||||
insert(RTree[M, D, RT, LT](t), Node[M, D, RT, LT](n).a[i], n.level)
|
||||
insert(t, Node[M, D, RT, LT](n).a[i], n.level)
|
||||
else:
|
||||
assert false
|
||||
else:
|
||||
assert false
|
||||
|
||||
proc delete*[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; leaf: L[D, RT, LT]): bool {.discardable.} =
|
||||
let l = findLeaf(t, leaf)
|
||||
|
|
@ -659,6 +637,4 @@ proc test(n: int) =
|
|||
assert r.len == r2.len
|
||||
assert r.sorted(system.cmp) == r2.sorted(system.cmp)
|
||||
|
||||
test(1500)
|
||||
|
||||
# 651 lines
|
||||
test(500)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue