3 ms·
In all seriousness, what's the point of having the best JIT in the world if it can't reliably transform this antipattern into an iterator?
by morelisp 3y ago
In all seriousness, what's the point of having the best JIT in the world if it can't reliably transform this antipattern into an iterator?
- PhilipRoman 3y agoOpenJDK seems pretty averse to including special case optimizations, otherwise I'm sure we would have intrinsics at least for ArrayList/HashMap containing boxed primitives. AFAIK they are still noticeably slower than plain arrays or manually inlined implementations. For the most basic case you wouldn't even need JIT support - just keep a cache field of the last index accessed and where it ended and decode based on that.