This annotation is a nice optimization for the common case where a lazy val initializes a pure value and does not need to be synchronized.
Code that is performance sensitive on Scala 2 will still need to avoid lazy val, but for casual code that is already using it at least we can squeeze out some extra performance on Scala 3.
This annotation is a nice optimization for the common case where a
lazy val
initializes a pure value and does not need to be synchronized.Code that is performance sensitive on Scala 2 will still need to avoid
lazy val
, but for casual code that is already using it at least we can squeeze out some extra performance on Scala 3.