Re:Overhead of Returning Optional Values in Java and Rust
by nqzero on Saturday October 16, 2021 @01:42PM
(#28889700)
JMH intentionally disables many optimizations that hotspot would otherwise perform, so comparing the (optimized) rust performance with the (de-optimized) jmh performance doesn't make any sense
[ Parent
| on HN ]
Re:Overhead of Returning Optional Values in Java and Rust
by aw1621107 on Saturday October 16, 2021 @01:50PM
(#28889811)
Really? That's a surprise to me, considering the supposed purpose of JMH, though to be fair I'm not hugely experienced in it.
Do you know what optimizations are disabled? Are they disabled automatically, or only if certain parameters/functions are used (e.g., BlackHole)?
Re:Overhead of Returning Optional Values in Java and Rust
by nqzero on Sunday October 17, 2021 @07:38PM
(#28900721)
for the official oracle view, see: https://www.oracle.com/technical-resources/articles/java/arc...
"JMH provides a [snip] foundation for writing and running benchmarks whose results are not erroneous due to unwanted virtual machine optimizations"
unsolicited personal opinion: they're almost always erroneous for other reasons
i'm not sure which optimizations are currently disabled
Re:Overhead of Returning Optional Values in Java and Rust
by aw1621107 on Wednesday October 20, 2021 @10:19PM
(#28939508)
Hmmm. Wonderfully vague. Suppose I'd need to dig into the source to figure it out.
To be fair, now that I think about it I suppose some deoptimizations make sense (e.g., preventing replacement of loops).
Thanks for pointing me to that article!