From 96ff33120e844fa3554f3baba742bba0f6d2b828 Mon Sep 17 00:00:00 2001 From: cui Date: Mon, 5 Jan 2026 21:53:17 +0800 Subject: [PATCH] perf: prealloc vec (#20721) Co-authored-by: weixie.cui --- crates/storage/provider/src/providers/database/provider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 6e04cc9c18..e95360fb35 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -680,7 +680,7 @@ impl DatabaseProvider { .zip(headers) .collect::>(); - let mut inputs = Vec::new(); + let mut inputs = Vec::with_capacity(present_headers.len()); for (tx_range, header) in &present_headers { let transactions = if tx_range.is_empty() { Vec::new()