Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
While posting the code of an example would be the most helpful to work this out, if you can't or won't do that I'd suggest you check the difference in code generation in the two cases. You can use cargo-show-asm, godbolt, or just cargo to output assembly or LLVM IR for a relevant part of your hot loop. That should give you some clues.
That sounds weird, the calls should produce identical machine code if all other factors are equal. You can compare the generated assembly code at Compiler Explorer. And yes, be sure to build with optimizations turned on.
cargo asm might be useful here (if you can't use godbolt).