From a6a1d8382a7aadbd8393191cb241827b290888cf Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 13 Jan 2017 00:09:47 +0100 Subject: [PATCH] Enable codegen-units=4 in debug mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We previously had this and removed it because it caused runtime slowdowns (discussion in #11102), but that was in release mode. Debug mode is already very slow at runtime. In my opinion, debug mode is mostly for the edit-compile-test cycle which is currently dominated by compile times, so sacrificing runtime for compile time makes sense. I’ve observed a ~30% improvement of compile times with this. This figure is consistent between a very fast desktop with 4 cores / 8 threads and a not-as-fast laptop with 2 cores / 4 threads. --- Cargo.toml | 9 +++++++++ ports/servo/Cargo.toml | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0def226925f..a6862731aea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,12 @@ members = [ "ports/servo", "support/android/build-apk", ] + +[profile.dev] +codegen-units = 4 + +[profile.release] +opt-level = 3 +# Uncomment to profile on Linux: +# debug = true +# lto = false diff --git a/ports/servo/Cargo.toml b/ports/servo/Cargo.toml index 23f12909766..cfaaa2faf1d 100644 --- a/ports/servo/Cargo.toml +++ b/ports/servo/Cargo.toml @@ -35,12 +35,6 @@ testing = ["libservo/testing"] clippy = ["libservo/clippy"] debugmozjs = ["libservo/debugmozjs"] -[profile.release] -opt-level = 3 -# Uncomment to profile on Linux: -# debug = true -# lto = false - [dependencies] backtrace = "0.2" browserhtml = {git = "https://github.com/browserhtml/browserhtml", branch = "crate"}