nim-libp2p/tests
Jacek Sieka e285d8bbf4
mem usage cleanups for pubsub (#564)
In `async` functions, a closure environment is created for variables
that cross an await boundary - this closure environment is kept in
memory for the lifetime of the associated future - this means that
although _some_ variables are no longer used, they still take up memory
for a long time.

In Nimbus, message validation is processed in batches meaning the future
of an incoming gossip message stays around for quite a while - this
leads to memory consumption peaks of 100-200 mb when there are many
attestations in the pipeline.

To avoid excessive memory usage, it's generally better to move non-async
code into proc's such that the variables therein can be released earlier
- this includes the many hidden variables introduced by macro and
template expansion (ie chronicles that does expensive exception
handling)

* move seen table salt to floodsub, use there as well
* shorten seen table salt to size of hash
* avoid unnecessary memory allocations and copies in a few places
* factor out message scoring
* avoid reencoding outgoing message for every peer
* keep checking validators until reject (in case there's both reject and
ignore)
* `readOnce` avoids `readExactly` overhead for single-byte read
* genericAssign -> assign2
2021-04-18 10:08:33 +02:00
..
pubsub mem usage cleanups for pubsub (#564) 2021-04-18 10:08:33 +02:00
helpers.nim make switch tests less sensitive to time (#501) 2021-01-12 10:26:48 +09:00
nim.cfg Tests are now testing with --threads:on. 2019-11-06 13:01:16 +02:00
testbufferstream.nim Don't allow concurrent pushdata (#444) 2020-11-23 09:07:11 -06:00
testcid.nim first pass, use results for Cid module (#480) 2020-12-15 14:19:18 +01:00
testconnection.nim Cleanup tests (#435) 2020-11-12 21:44:02 -06:00
testconnmngr.nim Connection limits tests (#509) 2021-01-27 21:27:33 -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 Allow custom identify agent string (#451) 2020-11-25 07:42:02 -06:00
testinterop.nim use a builder pattern to build the switch (#551) 2021-04-02 10:20:51 +09: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 Race in connection setup (#464) 2020-12-02 19:24:48 -06: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 Rework transport to use chronos accept (#420) 2020-11-18 20:06:42 -06:00
testnative.nim Concurrent upgrades (#489) 2021-01-04 12:59:05 -06:00
testnoise.nim Rework transport to use chronos accept (#420) 2020-11-18 20:06:42 -06:00
testpeerid.nim clean up peerid (#470) 2020-12-03 13:53:16 -06:00
testpeerinfo.nim peer hooks -> events (#320) 2020-08-08 08:52:20 +02:00
testpeerstore.nim Merge unstable (#518) 2021-02-08 15:16:23 -06: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
testsemaphore.nim Semaphore cancellations (#503) 2021-01-14 10:11:12 +01:00
teststreamseq.nim remove readLoop in secure protocols (#162) 2020-05-07 14:37:46 -06:00
testswitch.nim use a builder pattern to build the switch (#551) 2021-04-02 10:20:51 +09:00
testtransport.nim Connection limits (#384) 2021-01-20 22:00:24 -06:00
testvarint.nim Fixing range error introduces in v1.2.8 (#485) 2020-12-15 06:58:38 +01:00