Overhead of Returning Optional Values in Java and Rust
well, this is a little disappointing; even recent JVMs perform poorly in hotspots when Optional values are in use. Even nulls are not too good. tl;dr: primitives with “magic values” where needed are faster.
(tags: java rust optimization performance hotspots benchmarks optional null)