Fast lazy properties

This is the first time I’ve heard of lazy being slow. What exactly do you mean? If you’re talking about object creation–have you measured it? There’s a lot of misconceptions when it comes to the JVM and performance (like the misconception that object allocation/deallocation is always bad).

The effect of an extra null check and extra instances on performance could in some cases be zero. Maybe someone who knows the JVM better could shed some light on the subject?

1 Like