From 1a93653c84baa3a676eb454073f217d9aefc2344 Mon Sep 17 00:00:00 2001 From: Florian Valeye Date: Tue, 28 Oct 2025 19:17:05 +0100 Subject: [PATCH 1/2] perf(snapshot): use std::mem:take to reduce memory allocation and comsumption without cloning Signed-off-by: Florian Valeye --- Cargo.toml | 2 +- crates/core/src/kernel/snapshot/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0c54f9cfa..1cd20063c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,4 +116,4 @@ inherits = "release" opt-level = 3 codegen-units = 1 lto = "fat" -strip = true +strip = "debuginfo" diff --git a/crates/core/src/kernel/snapshot/mod.rs b/crates/core/src/kernel/snapshot/mod.rs index 810b899af..08fe32088 100644 --- a/crates/core/src/kernel/snapshot/mod.rs +++ b/crates/core/src/kernel/snapshot/mod.rs @@ -544,7 +544,7 @@ impl EagerSnapshot { log_store, None, current_version, - Box::new(self.files.clone().into_iter()), + Box::new(std::mem::take(&mut self.files).into_iter()), None, ) .try_collect() From 3bff8007462ebac9df27466005365943f50376d5 Mon Sep 17 00:00:00 2001 From: Florian Valeye Date: Tue, 28 Oct 2025 19:17:05 +0100 Subject: [PATCH 2/2] perf(snapshot): use std::mem:take to reduce memory allocation and comsumption without cloning Signed-off-by: Florian Valeye --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1cd20063c..a95ada62b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,4 +116,3 @@ inherits = "release" opt-level = 3 codegen-units = 1 lto = "fat" -strip = "debuginfo"