Skip to content

Instantly share code, notes, and snippets.

@SethTisue
Last active October 13, 2015 22:34
Show Gist options
  • Save SethTisue/ec5baae7c534e18fcf55 to your computer and use it in GitHub Desktop.
Save SethTisue/ec5baae7c534e18fcf55 to your computer and use it in GitHub Desktop.

Ichoran
Anyway, point being that all lazy vals have a bit of performance overhead, local and nonlocal. Hand-coding will generally be better if you can keep everything on the stack.

viktorklang Oct 12 19:32
IMHO lazy val should be non-thread safe and @volatile lazy val should be thread safe...

Ichoran Oct 12 19:40
@viktorklang - Yeah, that'd be nice. Or at least allow a @nonvolatile annotation to opt-in to the thread-unsafe version.

DarkDimius 10:40

IMHO lazy val should be non-thread safe and @volatile lazy val should be thread safe...

this is the current state in Dotty for non-local lazy vals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment