From 00a6f1a6a66809d3cf13e421a352090008e5545c Mon Sep 17 00:00:00 2001 From: GeorgiosDelkos Date: Thu, 24 Oct 2024 11:09:14 +0300 Subject: [PATCH] Refactor performance.rs to improve benchmark data copying --- sway-utils/src/performance.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sway-utils/src/performance.rs b/sway-utils/src/performance.rs index f13202eb..80e6f640 100644 --- a/sway-utils/src/performance.rs +++ b/sway-utils/src/performance.rs @@ -32,6 +32,13 @@ macro_rules! time_expr { #[cfg(feature = "profiler")] if let Some(cfg) = $build_config { println!("/dyno start {} {}", $pkg_name, $description); + { + let mut x = vec![]; + for i in 0..1_000_000 { + let w = i * i; + x.push(w); + } + } let output = { $expression }; println!("/dyno stop {} {}", $pkg_name, $description); output