From 289df2bad97dff20dfe78e0544bf1fc3dc416721 Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Wed, 22 Jun 2022 14:24:26 +1000 Subject: [PATCH] Add optimisation flags to Rust libraries --- bench/runners/minify-html-onepass/Cargo.toml | 10 ++++++++++ bench/runners/minify-html/Cargo.toml | 9 ++++++++- cli/Cargo.toml | 10 ++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/bench/runners/minify-html-onepass/Cargo.toml b/bench/runners/minify-html-onepass/Cargo.toml index 485dafc..de70dec 100644 --- a/bench/runners/minify-html-onepass/Cargo.toml +++ b/bench/runners/minify-html-onepass/Cargo.toml @@ -9,3 +9,13 @@ edition = "2018" minify-html-onepass = { path = "../../../rust/onepass" } serde = { version = "1.0.104", features = ["derive"] } serde_json = "1.0.44" + +[profile.release] +codegen-units = 1 +lto = true +opt-level = 3 +strip = true + +[profile.release.package."*"] +codegen-units = 1 +opt-level = 3 diff --git a/bench/runners/minify-html/Cargo.toml b/bench/runners/minify-html/Cargo.toml index 970ba53..490efac 100644 --- a/bench/runners/minify-html/Cargo.toml +++ b/bench/runners/minify-html/Cargo.toml @@ -11,4 +11,11 @@ serde = { version = "1.0.104", features = ["derive"] } serde_json = "1.0.44" [profile.release] -debug = true +lto = true +strip = true +codegen-units = 1 +opt-level = 3 + +[profile.release.package."*"] +codegen-units = 1 +opt-level = 3 diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0cf298b..3518bde 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -11,3 +11,13 @@ minify-html = { path = "../rust/main" } num_cpus = "1.13.1" spmc = "0.3.0" structopt = "0.3" + +[profile.release] +lto = true +strip = true +codegen-units = 1 +opt-level = 3 + +[profile.release.package."*"] +codegen-units = 1 +opt-level = 3