From: Willy Tarreau Date: Mon, 11 Aug 2025 15:31:08 +0000 (+0200) Subject: OPTIM: buffers: align the buffer pool to 64 X-Git-Tag: v3.3-dev7~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77335f52fca6c3cdf740baebc145d998f836fd6d;p=thirdparty%2Fhaproxy.git OPTIM: buffers: align the buffer pool to 64 This struct is used by memcpy() and friends, particularly during the early recv() and send(). By keeping it 64-byte aligned, we let the underlying libs/kernel use optimal operations (e.g. AVX512) for memory copies while right now it's just random (buffers are found to be equally aligned to 32 and 64 in practice). --- diff --git a/src/dynbuf.c b/src/dynbuf.c index 336e40d1d..12dac1a58 100644 --- a/src/dynbuf.c +++ b/src/dynbuf.c @@ -32,7 +32,7 @@ int init_buffer() int done; int i; - pool_head_buffer = create_pool("buffer", global.tune.bufsize, MEM_F_SHARED|MEM_F_EXACT); + pool_head_buffer = create_aligned_pool("buffer", global.tune.bufsize, 64, MEM_F_SHARED|MEM_F_EXACT); if (!pool_head_buffer) return 0;