Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Lambda reference? Date: Wed, 16 Mar 2016 08:45:58 -0400 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: <8bd6f2b0-75b2-43fe-93ba-650ebffc940e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 16 Mar 2016 12:42:52 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="2d081e2f7155c28005d4472f67c2f43d"; logging-data="18892"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/E1OND9lWcFALheWimlSGD" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: Cancel-Lock: sha1:2PGaJ7MBekV9iHB1mleIAi3xYMc= Xref: csiph.com comp.lang.java.programmer:33985 On 3/16/2016 8:38 AM, Eric Sosman wrote: > 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. Hah! "This just in:" http://medianetwork.oracle.com/video/player/1785479333001 ... and this one, more specifically about peformance: http://medianetwork.oracle.com/video/player/2623576348001 -- esosman@comcast-dot-net.invalid "Don't be afraid of work. Make work afraid of you." -- TLM