nim-libp2p/tests
Jacek Sieka 96d4c44fec
refactor bufferstream to use a queue (#346)
This change modifies how the backpressure algorithm in bufferstream
works - in particular, instead of working byte-by-byte, it will now work
seq-by-seq.

When data arrives, it usually does so in packets - in the current
bufferstream, the packet is read then split into bytes which are fed one
by one to the bufferstream. On the reading side, the bytes are popped of
the bufferstream, again byte by byte, to satisfy `readOnce` requests -
this introduces a lot of synchronization traffic because the checks for
full buffer and for async event handling must be done for every byte.

In this PR, a queue of length 1 is used instead - this means there will
at most exist one "packet" in `pushTo`, one in the queue and one in the
slush buffer that is used to store incomplete reads.

* avoid byte-by-byte copy to buffer, with synchronization in-between
* reuse AsyncQueue synchronization logic instead of rolling own
* avoid writeHandler callback - implement `write` method instead
* simplify EOF signalling by only setting EOF flag in queue reader (and
reset)
* remove BufferStream pipes (unused)
* fixes drainBuffer deadlock when drain is called from within read loop
and thus blocks draining
* fix lpchannel init order
2020-09-10 08:19:13 +02:00
..
pubsub fix poor performance in LRU cache (#360) 2020-09-09 18:28:46 +02:00
helpers.nim refactor bufferstream to use a queue (#346) 2020-09-10 08:19:13 +02:00
nim.cfg Tests are now testing with --threads:on. 2019-11-06 13:01:16 +02:00
testbufferstream.nim refactor bufferstream to use a queue (#346) 2020-09-10 08:19:13 +02:00
testcid.nim Crypto utilities resultification (#150) 2020-05-18 07:25:55 +02:00
testconnection.nim Cleanup lpstream, Connection and BufferStream (#228) 2020-06-19 11:29:43 -06:00
testconnmngr.nim Connection manager (#277) 2020-07-17 09:36:48 -06:00
testcrypto.nim Audit curve fixes part2 (#298) 2020-08-04 18:19:26 +09:00
testdaemon.nim Peer resultification and defect only (#245) 2020-07-01 08:25:09 +02:00
testecnist.nim reuse single RNG instance for all crypto key generation (#249) 2020-07-07 13:14:11 +02:00
tested25519.nim reuse single RNG instance for all crypto key generation (#249) 2020-07-07 13:14:11 +02:00
testidentify.nim reuse single RNG instance for all crypto key generation (#249) 2020-07-07 13:14:11 +02:00
testinterop.nim Rework pubsub (#322) 2020-08-11 18:05:49 -06:00
testminasn1.nim Refactor minasn1 and fix security issues. (#323) 2020-08-11 16:58:51 -06:00
testminprotobuf.nim Minprotobuf refactoring 2 (#269) 2020-07-15 10:25:39 +02:00
testmplex.nim refactor bufferstream to use a queue (#346) 2020-09-10 08:19:13 +02:00
testmultiaddress.nim Less exceptions more results (#188) 2020-05-31 16:22:49 +02:00
testmultibase.nim Less exceptions more results (#188) 2020-05-31 16:22:49 +02:00
testmultihash.nim Crypto utilities resultification (#150) 2020-05-18 07:25:55 +02:00
testmultistream.nim pubsub timeouts tuning (#295) 2020-08-02 23:20:11 -06:00
testnative.nim Refactor minasn1 and fix security issues. (#323) 2020-08-11 16:58:51 -06:00
testnoise.nim Channel timeout (#278) 2020-07-17 12:44:41 -06:00
testpeer.nim simplify and unify logging (#353) 2020-09-06 10:31:47 +02:00
testpeerinfo.nim peer hooks -> events (#320) 2020-08-08 08:52:20 +02:00
testpkifilter.nim Public key infrastructure filters. (#272) 2020-07-21 14:10:21 -06:00
testrsa.nim Fix #266. (#270) 2020-07-15 10:24:04 +02:00
testsecp256k1.nim reuse single RNG instance for all crypto key generation (#249) 2020-07-07 13:14:11 +02:00
teststreamseq.nim remove readLoop in secure protocols (#162) 2020-05-07 14:37:46 -06:00
testswitch.nim Rework pubsub (#322) 2020-08-11 18:05:49 -06:00
testtransport.nim consolidate reading in lpstream (#241) 2020-06-27 11:33:34 -06:00
testvarint.nim Less exceptions more results (#188) 2020-05-31 16:22:49 +02:00