Azure / go-amqp

AMQP 1.0 client library for Go.
https://github.com/Azure/go-amqp
MIT License
104 stars 56 forks source link

Fixing a bug where we were bottlenecking on frames that had bodies smaller than 8 bytes #320

Closed richardpark-msft closed 6 months ago

richardpark-msft commented 6 months ago

The frame parsing code parses in two stages - headers, which tells you the body length, and the body itself. If the body was < 8 bytes (the standard frame header size) we'd end up skipping the body parse until we accumulated at least 8 bytes worth of material.

The fix is simple - move the "frame header size" check into the frame header portion of the parsing code.