Performance implications of the lambda draft specification
Neal Gafter
neal at gafter.com
Fri Feb 19 09:18:50 PST 2010
On Fri, Feb 19, 2010 at 8:26 AM, Marcelo Fukushima <takeshi10 at gmail.com> wrote:
> are these concerns problematic in practice, though? i was under the
> impression that almost all the use cases for converting a function to a SAM
> would be optimized by hotspot anyway (stack allocation and method inlining),
> no?
> on the other hand, convertion at compile time seens feasible in the current
> (draft) spec, right?
These concerns are real. Optimizing two levels of nested object
creation away is less likely than optimizing one level of object
creation away. Conversion at compile-time can only be done in very
restricted circumstances (for example, debugging disabled, no
reference to "this", etc) and would be the only nontrivial
optimization in javac. I think we're much better off not starting
with a factor of two handicap.
Cheers,
Neal
More information about the lambda-dev
mailing list