Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33984

Re: Lambda reference?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Lambda reference?
Date 2016-03-16 08:38 -0400
Organization A noiseless patient Spider
Message-ID <ncbjv3$h6s$1@dont-email.me> (permalink)
References <nc770d$u97$1@dont-email.me> <nc79gr$9e6$1@dont-email.me> <8bd6f2b0-75b2-43fe-93ba-650ebffc940e@googlegroups.com>

Show all headers | View raw


On 3/16/2016 7:53 AM, Eric Douglas wrote:
> On Monday, March 14, 2016 at 5:16:17 PM UTC-4, Eric Sosman wrote:
> ...
>
> Do lambdas make code execute faster or just do the same thing with fewer characters?

     "Yes."  :)

     Sorry I can't offer details, but quite some time ago I saw a
video of an Oracle guy explaining how lambdas were implemented
under the hood.  In some cases the compiler simply generates an
anonymous inner class and the lambda just turns out to be shorthand.
But if the lambda expression is entirely self-contained -- refers
only to its own arguments and not to variables belonging to the
caller -- some kind of JVM trickery can be employed that eliminates
a good deal of the ordinary overhead.

     Sorry for the sketchy response; wish I could still find the
video.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Lambda reference? Rhino <no_offline_contact@example.com> - 2016-03-14 16:32 -0400
  Re: Lambda reference? Sebastian <news@seyweiler.dyndns.org> - 2016-03-14 21:50 +0100
  Re: Lambda reference? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-03-14 17:16 -0400
    Re: Lambda reference? Rhino <no_offline_contact@example.com> - 2016-03-14 18:29 -0400
    Re: Lambda reference? Eric Douglas <e.d.programmer@gmail.com> - 2016-03-16 04:53 -0700
      Re: Lambda reference? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-03-16 08:38 -0400
        Re: Lambda reference? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-03-16 08:45 -0400
          Re: Lambda reference? Sebastian <news@seyweiler.dyndns.org> - 2016-03-16 21:33 +0100
          Re: Lambda reference? Robert Klemme <shortcutter@googlemail.com> - 2016-03-25 18:35 +0100
            Re: Lambda reference? Eric Douglas <e.d.programmer@gmail.com> - 2016-03-28 07:06 -0700
              Re: Lambda reference? Robert Klemme <shortcutter@googlemail.com> - 2016-03-31 00:09 +0200
                Re: Lambda reference? Eric Douglas <e.d.programmer@gmail.com> - 2016-03-31 04:42 -0700
                Re: Lambda reference? Robert Klemme <shortcutter@googlemail.com> - 2016-03-31 18:35 +0200
                Re: Lambda reference? Eric Douglas <e.d.programmer@gmail.com> - 2016-03-31 11:21 -0700
  Re: Lambda reference? Rhino <no_offline_contact@example.com> - 2016-03-14 21:55 -0400

csiph-web