mirror of
https://github.com/soypat/lneto.git
synced 2026-08-17 21:24:04 +00:00
explicit header key/value alloc and add ExchangeConfig
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user