From 6dbc7a4db0262d60655e102884bd2b5e80757778 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 1 Apr 2020 21:16:14 -0400 Subject: [PATCH] Enable more release optimizations --- Cargo.toml | 4 ++++ ci/enable-lld.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 07de563bac..31fdd7503a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,3 +24,7 @@ members = [ "cli" ] +# Optimizations based on https://deterministic.space/high-performance-rust.html +[profile.release] +lto = "fat" +codegen-units = 1 diff --git a/ci/enable-lld.sh b/ci/enable-lld.sh index bcdcd43849..a70301f8dc 100755 --- a/ci/enable-lld.sh +++ b/ci/enable-lld.sh @@ -1,6 +1,6 @@ #!/bin/bash mkdir -p $HOME/.cargo -echo -e "[build]\nrustflags = [\"-C\", \"link-arg=-fuse-ld=lld\"]" > $HOME/.cargo/config +echo -e "[build]\nrustflags = [\"-C\", \"link-arg=-fuse-ld=lld\", \"-C\", \"target-cpu=native\"]" > $HOME/.cargo/config ln -s /usr/bin/lld-8 /usr/local/bin/ld.lld