typelevel / scalac-compat

Lightweight tools for tackling Scalac version incompatibilities
Apache License 2.0
6 stars 3 forks source link

Add `@threadUnsafe3` #72

Closed armanbilge closed 1 year ago

armanbilge commented 1 year ago

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.

armanbilge commented 1 year ago

Thanks for the review 🙂