Description
openedon Aug 6, 2024
I've encountered an unexpected and significant performance degradation in my application when changing a module's visibility from private to public. This behavior seems counterintuitive and potentially indicates a compiler optimization issue or an unexpected interaction between module visibility and performance.
my code:
mod black:
source: https://github.com/hayden4r4/blackscholes-rust/blob/master/src/lets_be_rational/mod.rs#L8
benches: https://github.com/hayden4r4/blackscholes-rust/blob/master/benches/black.rs
Current behavior
When the black module is made public, the overall application performance degrades by approximately 50%.
Expected
Changing a module's visibility should not have a significant impact on the application's overall performance. We would expect minimal to no performance change when modifying module visibility.
Environment
Rust version
: 1.80.0 (051478957 2024-07-21)
Cargo version
: 1.80.0 (376290515 2024-07-16)
os
: macos m1 max
Anyone may know where is the bug/problem/challange?