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
|
|
@ -1,7 +1,7 @@
|
|||
import asyncdispatch, os, times
|
||||
|
||||
proc doubleSleep(hardSleep: int) {.async.} =
|
||||
await sleepAsync(100)
|
||||
await sleepAsync(50)
|
||||
sleep(hardSleep)
|
||||
|
||||
template assertTime(target, timeTook: float): untyped {.dirty.} =
|
||||
|
|
@ -16,37 +16,25 @@ var
|
|||
|
||||
# NOTE: this uses poll(3000) to limit timing error potential.
|
||||
start = epochTime()
|
||||
fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(40)
|
||||
fut = sleepAsync(40) and sleepAsync(100) and doubleSleep(20)
|
||||
while not fut.finished:
|
||||
poll(3000)
|
||||
poll(1000)
|
||||
assertTime(150, epochTime() - start)
|
||||
|
||||
start = epochTime()
|
||||
fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(100)
|
||||
fut = sleepAsync(40) and sleepAsync(100) and doubleSleep(50)
|
||||
while not fut.finished:
|
||||
poll(3000)
|
||||
poll(1000)
|
||||
assertTime(200, epochTime() - start)
|
||||
|
||||
start = epochTime()
|
||||
fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(40) and sleepAsync(300)
|
||||
fut = sleepAsync(40) and sleepAsync(100) and doubleSleep(20) and sleepAsync(200)
|
||||
while not fut.finished:
|
||||
poll(3000)
|
||||
poll(1000)
|
||||
assertTime(300, epochTime() - start)
|
||||
|
||||
start = epochTime()
|
||||
fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(100) and sleepAsync(300)
|
||||
fut = (sleepAsync(40) and sleepAsync(100) and doubleSleep(20)) or sleepAsync(300)
|
||||
while not fut.finished:
|
||||
poll(3000)
|
||||
assertTime(300, epochTime() - start)
|
||||
|
||||
start = epochTime()
|
||||
fut = (sleepAsync(50) and sleepAsync(150) and doubleSleep(40)) or sleepAsync(700)
|
||||
while not fut.finished:
|
||||
poll(3000)
|
||||
poll(1000)
|
||||
assertTime(150, epochTime() - start)
|
||||
|
||||
start = epochTime()
|
||||
fut = (sleepAsync(50) and sleepAsync(150) and doubleSleep(100)) or sleepAsync(700)
|
||||
while not fut.finished:
|
||||
poll(3000)
|
||||
assertTime(200, epochTime() - start)
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ proc main() =
|
|||
|
||||
doAssert counter <= 4
|
||||
|
||||
for i in 0 .. 10: main()
|
||||
for i in 0 .. 4: main()
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ block: #6100
|
|||
done.complete(1)
|
||||
|
||||
proc asyncSum: Future[int] {.async.} =
|
||||
for _ in 1..10_000_000:
|
||||
for _ in 1..1_000_000:
|
||||
result += await done
|
||||
|
||||
let res = waitFor asyncSum()
|
||||
doAssert(res == 10000000)
|
||||
doAssert(res == 1_000_000)
|
||||
|
||||
block: #7985
|
||||
proc getData(): Future[JsonNode] {.async.} =
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
discard """
|
||||
output: "5000"
|
||||
output: "2000"
|
||||
"""
|
||||
import asyncdispatch, asyncnet, nativesockets, net, strutils, os
|
||||
|
||||
var msgCount = 0
|
||||
|
||||
const
|
||||
swarmSize = 50
|
||||
messagesToSend = 100
|
||||
swarmSize = 40
|
||||
messagesToSend = 50
|
||||
|
||||
var clientCount = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
output: "50000"
|
||||
output: "20000"
|
||||
cmd: "nim c -d:nimTypeNames -d:nimCycleBreaker $file"
|
||||
"""
|
||||
import asyncdispatch, asyncnet, nativesockets, net, strutils, os
|
||||
|
|
@ -7,8 +7,8 @@ import asyncdispatch, asyncnet, nativesockets, net, strutils, os
|
|||
var msgCount = 0
|
||||
|
||||
const
|
||||
swarmSize = 500
|
||||
messagesToSend = 100
|
||||
swarmSize = 400
|
||||
messagesToSend = 50
|
||||
|
||||
var clientCount = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -99,4 +99,3 @@ proc server() {.async.} =
|
|||
|
||||
when isMainModule:
|
||||
waitFor server()
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ var fs = newFutureStream[int]()
|
|||
proc alpha() {.async.} =
|
||||
for i in 0 .. 5:
|
||||
await fs.write(i)
|
||||
await sleepAsync(200)
|
||||
await sleepAsync(100)
|
||||
|
||||
echo("Done")
|
||||
fs.complete()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ else:
|
|||
proc foo() {.async.} =
|
||||
echo "hi"
|
||||
var s = epochTime()
|
||||
await sleepAsync(500)
|
||||
await sleepAsync(200)
|
||||
var e = epochTime()
|
||||
doAssert(e - s > 0.1)
|
||||
echo "bye"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import asyncdispatch
|
|||
doAssert(not hasPendingOperations())
|
||||
|
||||
proc test() {.async.} =
|
||||
await sleepAsync(100)
|
||||
await sleepAsync(50)
|
||||
|
||||
var f = test()
|
||||
while not f.finished:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue