You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a slice here is problematic, as for every packet we send (assuming it contains one STREAM frame), we consume and append one element to the slice. It therefore leads to regular allocations in the data send path.
This allocation is responsible for more than 10% of the runtime of AppendStreamFrames:
Instead, we should use a ring buffer. It can start with a fairly small capacity (4 maybe?) and double that capacity once this is not enough. In this case, the maximum capacity is limited by the number of concurrent streams, so the ring buffer would not have to deal with this.
I imagine that it would make sense to implement a generic ring buffer and use that one in the framer.
The text was updated successfully, but these errors were encountered:
The framer uses a slice of stream IDs, containing an (ordered) list of the streams that have data to send:
quic-go/framer.go
Line 31 in e9fea08
Using a slice here is problematic, as for every packet we send (assuming it contains one STREAM frame), we consume and append one element to the slice. It therefore leads to regular allocations in the data send path.
This allocation is responsible for more than 10% of the runtime of
AppendStreamFrames
:Instead, we should use a ring buffer. It can start with a fairly small capacity (4 maybe?) and double that capacity once this is not enough. In this case, the maximum capacity is limited by the number of concurrent streams, so the ring buffer would not have to deal with this.
I imagine that it would make sense to implement a generic ring buffer and use that one in the framer.
The text was updated successfully, but these errors were encountered: