- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: lessons learned optimizing Range.foreach, and yes, another (promising) attempt
Fri, 2011-12-16, 16:55
On Fri, Dec 16, 2011 at 7:51 AM, Paul Phillips wrote:
> I have observed the same thing. If there is a lazy val anywhere, good
> luck not seeing that minimum 2x difference between while and foreach.
Intuitively this is related to the fact that a lazy val involves going
through a monitor - that optimizations are precluded if something
downstream from the method requires coordination - but that's pure
speculation on my part.