From b3ca76eac1a81e3ee57cd510c27fb3d71ce91f62 Mon Sep 17 00:00:00 2001 From: baycore <45189032+dxasu@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:58:06 +0800 Subject: [PATCH] perf: Memory alignment to improve operatorCache memory efficiency (#366) --- fd_operator_cache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fd_operator_cache.go b/fd_operator_cache.go index 0e37ddeb..e98f9966 100644 --- a/fd_operator_cache.go +++ b/fd_operator_cache.go @@ -28,13 +28,13 @@ func newOperatorCache() *operatorCache { } type operatorCache struct { - locked int32 first *FDOperator cache []*FDOperator + locked int32 // freelist store the freeable operator // to reduce GC pressure, we only store op index here - freelist []int32 freelocked int32 + freelist []int32 } func (c *operatorCache) alloc() *FDOperator {