python-trio / trio-websocket

WebSocket client and server implementation for Python Trio
MIT License
70 stars 25 forks source link

Don't explicitly pass a default (small) receive size, let trio choose. #185

Open palkeo opened 7 months ago

palkeo commented 7 months ago

The default size of 4 KiB is very small, and caused a lot of loops receiving buffers, that were clearly visible in benchmarks.

Also, it's not needed: Optional; if omitted, then the stream object is free to pick a reasonable default. So maybe let's not invent a redundant default here?

By passing None, it currently means we end up with 64 KiB instead, which sounds more appropriate: https://github.com/python-trio/trio/blob/master/src/trio/_highlevel_socket.py#L21-L25 And it can be hoped that later this will automagically become more intelligent if they implement the TODO.