whats the downside of using `lazy` delegate?
# android
p
whats the downside of using
lazy
delegate?
stackoverflow 6
w
pawel.rybicki: Additional object allocation for lazy instance, second field for value, and overhead when getting value - basically what you see here https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/util/Lazy.kt
m
It is also thread safe, so the lock on the field helps with the overhead
p
thanks : )