From dev-return-4931-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sun May 27 20:35:23 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5A8EE180663 for ; Sun, 27 May 2018 20:35:23 +0200 (CEST) Received: (qmail 5044 invoked by uid 500); 27 May 2018 18:35:22 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 5034 invoked by uid 99); 27 May 2018 18:35:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 May 2018 18:35:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C2B291A433A for ; Sun, 27 May 2018 18:35:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=selskabet-org.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 4kIco23BUQvM for ; Sun, 27 May 2018 18:35:19 +0000 (UTC) Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 0F8AB5F24C for ; Sun, 27 May 2018 18:35:19 +0000 (UTC) Received: by mail-wr0-f179.google.com with SMTP id w7-v6so4876558wrn.6 for ; Sun, 27 May 2018 11:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selskabet-org.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=/bZYFOhBYMl6vpNytdr3WadIeZdH2PC8IBUzKMZRTpg=; b=gNRv6dZZn5A1nxxdR2YWFH9Ikk4hlBKntoIWQ264LA2gckaZCGKQavCi81GqLYjCRY rd3L1YTNkQJLN22YnnjdAhIU2a9rhHdvM4gc1CV9CJu2FqnvY2U4CzoTN/qTUCqS0qL4 bwT2SMiVb8/pzxUXhsGGLCt3k6U8sb2d8o712tEEDPX91ledKUa8xue8j5NdPEljJG7a zq2yKpwvWNY58QQiw9OChvLMzRxvkgt39vdxrWg2lXLc1WpBj0R8G/5dRqaCaMpHNb/H lXnQcasBkphefip8jYl9qpngn8fYT0XedbNYgr86dBcgx5Tsd1w0IEKimvKnnCufDL3B m50A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=/bZYFOhBYMl6vpNytdr3WadIeZdH2PC8IBUzKMZRTpg=; b=suQyw9C3CtOUyfBvwnjfHdAK69e39lO9jRk7Lw7uzvkJVDTX0NLJN+yGFJ9b5svW5d 5UC6VEWO0sv9UnnC/Vbf27adO84jDF54hUA7eQtvGaBiheZsQFR7X1GDzoeL/8YacxYW PjPLuMycjGpIYuXzPq2g8aNo58c5MRRpabm704MeMCgz3brfCRWGu26pd6Hm0PD8CDGb HSCSOawoZXVZVfCvwXmw88VX74itXiAAb3nc9dLP56WwCEJZYuB6xvEE1OCsrRTnsed2 nDkJgptcjs8IErgyXwzb/R3gctfyEDOE7ALu2pDuSFgxHjB79FBFgtoEDYMMngpt11Ak aUig== X-Gm-Message-State: ALKqPwf0tNc+Ds3a5xzrkxWpnbm8V2O0+n+7EQTYJsMAM9Otgv3MXFRz eRcmGLk1MwDgB9GQYauib27dULDP3zI= X-Google-Smtp-Source: ADUXVKLWa18SMXgrEPIz7C4dvzeH4mwRRMRddagou+JiRNxC9JotmnAFHL81bnyoJ1tpgQk3g2OavQ== X-Received: by 2002:a19:6a08:: with SMTP id u8-v6mr5539037lfu.31.1527446118433; Sun, 27 May 2018 11:35:18 -0700 (PDT) Received: from [192.168.0.19] (83-95-188-15-cable.dk.customer.tdc.net. [83.95.188.15]) by smtp.gmail.com with ESMTPSA id l202-v6sm2001242lfb.75.2018.05.27.11.35.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 May 2018 11:35:17 -0700 (PDT) From: =?utf-8?Q?Jesper_Steen_M=C3=B8ller?= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Groovy 3 release Date: Sun, 27 May 2018 20:35:15 +0200 References: <54edd56eadaa8508d9b7989cd1227bc0cf41d85e.camel@winder.org.uk> <21BEA352-96C1-4B6A-B07A-46D0FC30B9CE@selskabet.org> <1527421033164-0.post@n5.nabble.com> <710AD0C4-BA73-4C7F-A37A-FA7EC92A812F@selskabet.org> <1527425079378-0.post@n5.nabble.com> <3A048511-18B6-470B-8834-326A8495EDB3@selskabet.org> To: dev@groovy.apache.org In-Reply-To: <3A048511-18B6-470B-8834-326A8495EDB3@selskabet.org> Message-Id: <4B085211-F6E1-452A-BA15-B632B4AE3AA6@selskabet.org> X-Mailer: Apple Mail (2.3273) > On 27 May 2018, at 20.25, Jesper Steen M=C3=B8ller = wrote: >=20 > On 27 May 2018, at 14.44, Daniel.Sun wrote: >>=20 >> Native lambda is only available on master branch, and it is only be = enabled >> under static compilation. >>=20 >=20 > I had a chance to examine the current implementation. It uses a = LambdaMetafactory to bootstrap (i.e. generate inner class) access to the = doCall of the generated lambda/closure object. That means TWO classes = per lambda definition (in use), and two objects generated at every = lambda use. I haven't made any benchmarks, but we should be able to do = better: > 1) Don't distinguish between lambdas and closures. > 2) If the closure's instantiation is targeting a functional interface, = add the expected identified functional interface to the closure class, = and implement that in the closure class (bridging the single interface = method into the doClass) call. > 3) If using compilestatic, we don't need any type conversions to match = the callee. 4) Added bonus: Even if using dynamic, sometimes we may use our = "invested" bridge method so we could avoid creating a proxy. After all, even a lot of dynamic Groovy ends up calling something which = is well known in advance. -Jesper