explicit header key/value alloc and add ExchangeConfig

This commit is contained in:
Patricio Whittingslow
2026-07-27 11:51:02 -03:00
parent 75d2c0c46d
commit 0e2f487e9f
10 changed files with 319 additions and 90 deletions
+2 -1
View File
@@ -41,8 +41,9 @@ var benchBody = []byte("hello world")
func benchExchange(b *testing.B, conn conn) *Exchange {
b.Helper()
const bufferSize = 1024
const numHeaderCap = 2
exch := new(Exchange)
exch.Configure(make([]byte, 2*bufferSize), bufferSize, false)
exch.Configure(make([]byte, 2*bufferSize), bufferSize, numHeaderCap, false)
if !exch.Acquire(conn) {
b.Fatal("fresh exchange failed to acquire connection")
}