Skip to content

Commit f58b87e

Browse files
committed
Inline protocol parser for improved throughput
Replace the modular parse() function with chunk-based inline parsing in _read_loop. Reading 64KB chunks and parsing multiple messages per buffer avoids function call overhead on the hot path. Handler signatures now accept bytes instead of str to defer decoding until necessary. Subscriber throughput improves ~63% (295k to 480k msg/sec). Signed-off-by: Casper Beyer <[email protected]>
1 parent cab67df commit f58b87e

File tree

1 file changed

+313
-49
lines changed

1 file changed

+313
-49
lines changed

0 commit comments

Comments
 (0)