Skip to content

SSEClient v2.1.0

Latest

Choose a tag to compare

@mpetazzoni mpetazzoni released this 15 Nov 21:02
1872fd4

SSEClient 2.1.0

Faster event assembly without changing the parsing API or stream behavior.

  • Buffer fragmented events with a bytearray instead of repeatedly copying accumulated bytes.
  • Collect multiline data: values and join once instead of repeatedly copying the growing string.
  • Add pytest benchmarks for large single-line/multiline payloads, small events, and comments. Normal tests run benchmark cases once for correctness; timing is opt-in.

Local Python 3.12 measurements: an 8 MiB event split into 128-byte chunks improved from 8.74 s to 32 ms (~275×); an event with 8,192 × 1 KiB data lines improved from 1.394 s to 21 ms (~66×). Results vary by machine and workload.

Python 3.11 or newer is required. Install with pip install --upgrade sseclient-py.

Full changes: #38.