From eec1730449cd50920e8421a4bcb50381d0459638 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Mon, 28 Feb 2022 13:13:24 +0100 Subject: [PATCH] Add profiling build profile and symbol strip (#4630) * Add profiling build profile and symbol strip Stripping the symbols for the release build improves the size of the binary significantly Adds a custom build profile for performance profiling that includes all symbols for analysis. Can be used via ``` cargo build --profile profiling ``` * Retain a minimal backtrace --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a6bdf850a..ba1d0bca8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,6 +97,14 @@ dataframe = ["nu-command/dataframe"] [profile.release] opt-level = "s" # Optimize for size +strip = "debuginfo" + +# build with `cargo build --profile profiling` +# to analyze performance with tooling like linux perf +[profile.profiling] +inherits = "release" +strip = false +debug = true # Build plugins [[bin]]