From 563f1b5b78ff86c8717cd81d1ec822b27fdaee76 Mon Sep 17 00:00:00 2001 From: qcrao Date: Wed, 11 Dec 2024 22:35:33 +0800 Subject: [PATCH] opt: pre-allocate chunk blocks slice in chunk proposer --- common/version/version.go | 2 +- rollup/internal/controller/watcher/chunk_proposer.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/version/version.go b/common/version/version.go index 1e467875b..b3edea871 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.4.81" +var tag = "v4.4.82" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/rollup/internal/controller/watcher/chunk_proposer.go b/rollup/internal/controller/watcher/chunk_proposer.go index 87056e646..72757513d 100644 --- a/rollup/internal/controller/watcher/chunk_proposer.go +++ b/rollup/internal/controller/watcher/chunk_proposer.go @@ -295,6 +295,7 @@ func (p *ChunkProposer) proposeChunk() error { } var chunk encoding.Chunk + chunk.Blocks = make([]*encoding.Block, 0, len(blocks)) for i, block := range blocks { chunk.Blocks = append(chunk.Blocks, block)