This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: lessons learned optimizing Range.foreach, and yes, another (promising) attempt

No replies
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

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.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland