File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ class PaddedRSTransport(RSTransport):
2424
2525 MIN_PACKET_SIZE = 1024
2626 WAIT_FOR_BUFFER_GROWTH_SECONDS = 1.0
27+ # amount of (unpadded) bytes sent instantly before beginning with polling.
28+ # This makes the initial handshake where a few small messages are exchanged faster.
29+ WARMUP_BUDGET_SIZE = 1024
2730
2831 session : Optional ['RPCSessionWithTaskGroup' ]
2932
@@ -57,6 +60,7 @@ def _maybe_consume_sbuffer(self) -> None:
5760 self ._force_send
5861 or len (buf ) >= self .MIN_PACKET_SIZE
5962 or self ._last_send + self .WAIT_FOR_BUFFER_GROWTH_SECONDS < time .monotonic ()
63+ or self .session .send_size < self .WARMUP_BUDGET_SIZE
6064 ):
6165 return
6266 assert buf [- 2 :] in (b"}\n " , b"]\n " ), f"unexpected json-rpc terminator: { buf [- 2 :]= !r} "
You can’t perform that action at this time.
0 commit comments