Name Description Size
parse_frames.py Benchark parsing WebSocket frames. 3228
parse_handshake.py Benchark parsing WebSocket handshake requests. 3181
streams.py Benchmark two possible implementations of a stream reader. The difference lies in the data structure that buffers incoming data: * ``ByteArrayStreamReader`` uses a ``bytearray``; * ``BytesDequeStreamReader`` uses a ``deque[bytes]``. ``ByteArrayStreamReader`` is faster for streaming small frames, which is the standard use case of websockets, likely due to its simple implementation and to ``bytearray`` being fast at appending data and removing data at the front (https://hg.python.org/cpython/rev/499a96611baa). ``BytesDequeStreamReader`` is faster for large frames and for bursts, likely because it copies payloads only once, while ``ByteArrayStreamReader`` copies them twice. 8924