forked from quic-go/quic-go
wire: optimize parsing logic for STREAM, DATAGRAM and ACK frames (#5227)
ParseOtherFrames-16 148ns ± 4% 150ns ± 3% ~ (p=0.223 n=8+8) ParseAckFrame-16 302ns ± 2% 298ns ± 3% ~ (p=0.246 n=8+8) ParseStreamFrame-16 262ns ± 3% 213ns ± 2% -18.61% (p=0.000 n=8+8) ParseDatagramFrame-16 561ns ± 5% 547ns ± 4% ~ (p=0.105 n=8+8)
This commit is contained in:
@@ -77,7 +77,7 @@ func TestWriteResetStream(t *testing.T) {
|
||||
}
|
||||
b, err := frame.Append(nil, protocol.Version1)
|
||||
require.NoError(t, err)
|
||||
expected := []byte{resetStreamFrameType}
|
||||
expected := []byte{byte(FrameTypeResetStream)}
|
||||
expected = append(expected, encodeVarInt(0x1337)...)
|
||||
expected = append(expected, encodeVarInt(0xcafe)...)
|
||||
expected = append(expected, encodeVarInt(0x11223344decafbad)...)
|
||||
@@ -94,7 +94,7 @@ func TestWriteResetStreamAt(t *testing.T) {
|
||||
}
|
||||
b, err := frame.Append(nil, protocol.Version1)
|
||||
require.NoError(t, err)
|
||||
expected := []byte{resetStreamAtFrameType}
|
||||
expected := []byte{byte(FrameTypeResetStreamAt)}
|
||||
expected = append(expected, encodeVarInt(1337)...)
|
||||
expected = append(expected, encodeVarInt(0xcafe)...)
|
||||
expected = append(expected, encodeVarInt(42)...)
|
||||
|
||||
Reference in New Issue
Block a user