From eecf5bdea16581f201d674a9079a888858ec84bc Mon Sep 17 00:00:00 2001 From: Delan Azabani Date: Thu, 19 Sep 2024 20:07:15 +0800 Subject: [PATCH] Add a profiling build profile in Cargo (#33432) * Add a profiling build profile in Cargo Signed-off-by: Delan Azabani * Redefine the profiling profile in terms of release Signed-off-by: Delan Azabani * Remove the other profiles added for testing Signed-off-by: Delan Azabani * Enable ThinLTO, like we do in production profiles Signed-off-by: Delan Azabani --------- Signed-off-by: Delan Azabani --- Cargo.toml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0d3d999ad36..bbac1d79f7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,9 +152,6 @@ xml5ever = "0.20" [profile.release] opt-level = 3 debug-assertions = true -# Uncomment to profile on Linux: -# debug = true -# lto = false [profile.production] inherits = "release" @@ -166,6 +163,13 @@ codegen-units = 1 inherits = "production" strip = true +[profile.profiling] +inherits = "release" +debug-assertions = false +debug = true +lto = "thin" +codegen-units = 1 + [patch.crates-io] # If you need to temporarily test Servo with a local fork of some upstream # crate, add that here. Use the form: