Hi Rustaceans !
I have refactored my learning project. It was originally two rs files compiled and linked together. After refactoring, I have one library, and several binaries. All is cleaner now, but I noticed very lower performance on my binaries. After digging, I noticed that :
[profile.release]
lto = true
This flags previously gave me almost 20% speedup, but now, with a library, I don't observe performance change (improvement) with or without the lto = true flag.
Here is a copy of my Cargo.toml file if it can help:
[package]
name = "bigint"
version = "0.1.0"
authors = ["Bruno"]
edition = "2018"
[profile.release]
lto = true
[lib]
name = "bigint"
path = "src/libsrc/bigint.rs"
[[bin]]
name = "main"
path = "src/main.rs"
[[bin]]
name = "pollard_rho"
path = "src/bin/pollard_rho.rs"
[[bin]]
name = "pollard_rho_brent"
path = "src/bin/pollard_rho_brent.rs"
[[bin]]
name = "pollard_rho_p_minus_1"
path = "src/bin/pollard_rho_p_minus_1.rs"
[dependencies]
Is there a logical reason for this like 'LTO optimisation that can't be applied on such libs' ?
Does anyone already encounter such a beahvior ?
Regards