3 ms·
> In this case they're realizing that NULL makes optimization difficult How so? Null checks are mostly “free” on the JVM, they trap on the zero page and get co
by saagarjha 4y ago
> In this case they're realizing that NULL makes optimization difficult
How so? Null checks are mostly “free” on the JVM, they trap on the zero page and get converted to an exception via a signal handler.
- Someone 4y agoIt’s not only the checks, but allotted storage. An Integer that’s guaranteed not to be null can be stored in 4 bytes, a “Point” class with two “int” fields that is guaranteed to be not null can be loaded in a 64-bit register, etc. That makes it easier for the compiler to generate good code.
- pjmlp 4y agoEiffel was already doing this with expanded classes and non void references, but yeah, who would have thought such details are relevant. :)