From: Matt Corallo Date: Fri, 28 May 2021 14:16:20 +0000 (+0000) Subject: Add bench profiles to Cargo.toml to force codegen-units=1 X-Git-Tag: v0.0.98~9^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;ds=sidebyside;h=08ecb53915018b34b89e089d0517cadcd542522b;p=rust-lightning Add bench profiles to Cargo.toml to force codegen-units=1 This makes a small difference for NetworkGraph deserialization as it enables more inlining across different files, hopefully better matching user performance as well. As of this commit, on an Intel 2687W v3, the serialization benchmarks take: test routing::network_graph::benches::read_network_graph ... bench: 2,037,875,071 ns/iter (+/- 760,370) test routing::network_graph::benches::write_network_graph ... bench: 320,561,557 ns/iter (+/- 176,343) --- diff --git a/Cargo.toml b/Cargo.toml index 597d4efb..df32ac5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,8 @@ panic = "abort" opt-level = 3 lto = true panic = "abort" + +[profile.bench] +opt-level = 3 +codegen-units = 1 +lto = true