nim-chronos/tests
Jacek Sieka c25fa1f6cd
posix: fast path for write (#244)
When `write` is called on a `StreamTransport`, the current sequence of
operations is:

* copy data to queue
* register for "write" event notification
* return unfinished future to `write` caller
* wait for "write" notification (in `poll`)
* perform one `send`
* wait for notification again if there's more data to write
* complete the future

In this PR, we introduce a fast path for writing:

* If the queue is empty, try to send as much data as possible
  * If all data is sent, return completed future without `poll` round
  * If there's more data to send than can be sent in one go, add the
rest to queue
* If the queue is not empty, enqueue as above
* When notified that write is possible, keep writing until OS buffer is
full before waiting for event again

The fast path provides significant performance benefits when there are
many small writes, such as when sending gossip to many peers, by
avoiding the poll loop and data copy on each send.

Also fixes an issue where the socket would not be removed from the
writer set if there were pending writes on close.
2021-12-08 11:35:27 +01:00
..
config.nims Enable --threads:on testing. 2019-11-01 06:42:32 +02:00
testaddress.nim Refactor common.nim and add more resolve procedures. (#177) 2021-04-10 00:39:54 +03:00
testall.nim Httpclient (#182) 2021-05-10 10:26:36 +03:00
testasyncstream.nim Restore functionality of zero-sized bounded reader/writer streams. (#184) 2021-05-07 18:52:44 +03:00
testbugs.nim Fix unused warnings, result, asyncCheck and 80 cpl (#185) 2021-05-07 23:52:24 +03:00
testdatagram.nim Fix unused warnings, result, asyncCheck and 80 cpl (#185) 2021-05-07 23:52:24 +03:00
testfut.nim Change Future identifier type from `int` to `uint`. (#228) 2021-10-21 17:22:11 +03:00
testhttpclient.nim Basic authorization implementation for HTTP client. (#204) 2021-06-29 02:38:08 +03:00
testhttpserver.nim Server-side events implementation. (#222) 2021-09-14 20:32:58 +03:00
testmacro.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
testnet.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
testserver.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
testshttpserver.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
testsignal.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
testsoon.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
teststream.nim posix: fast path for write (#244) 2021-12-08 11:35:27 +01:00
testsync.nim Eventbus implementation (#214) 2021-09-15 16:55:15 +03:00
testtime.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
testutils.nim Fix identifiers to be `uint` instead of `uint64`. 2021-10-21 17:46:06 +03:00