Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C42218F47 for ; Tue, 8 Dec 2015 08:02:20 +0000 (UTC) Received: (qmail 76727 invoked by uid 500); 8 Dec 2015 08:02:20 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 76660 invoked by uid 500); 8 Dec 2015 08:02:20 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 76650 invoked by uid 99); 8 Dec 2015 08:02:20 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2015 08:02:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A24E5C946D for ; Tue, 8 Dec 2015 08:02:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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=[RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id XLhsUO0OSVgr for ; Tue, 8 Dec 2015 08:02:12 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 9CC63428ED for ; Tue, 8 Dec 2015 08:02:11 +0000 (UTC) Received: from [195.141.68.118] by 3capp-gmx-bs40.server.lan (via HTTP); Tue, 8 Dec 2015 08:57:10 +0100 MIME-Version: 1.0 Message-ID: From: "Jochen Theodorou" To: users@groovy.apache.org Subject: Aw: CompileStatic closure accessing "this object" private variable via setGroovyObjectProperty Content-Type: text/plain; charset=UTF-8 Date: Tue, 8 Dec 2015 08:57:10 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <5C676E6359909E478C7B811BDB48CA35433FB4@CWWAPP478.windstream.com> References: <5C676E6359909E478C7B811BDB48CA35433FB4@CWWAPP478.windstream.com> Content-Transfer-Encoding: quoted-printable X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K0:xLI356X1KlXIDokk4gPog215cWGf3EVfrSxL1qh0kuU Em8sDegVW+ZgW01pOs7TjPTMo1Z9xxC8b/VD3txXt27HKmzb8x okTyMBVqBxxC6BRtj6GI4ShRIrMOzDu28H2qElGenlHTaD/umX ohtLwPyE88JlBL3dyTsPiFi2n2vwUVkoaqxHgb0w0rEgGHiVY0 Vm5i0d4Eh3M+xKZIxDImUSRI14Ghsgk0bT5Up+GR09iPwVqySj rXgar2euBrBHbFABzfmRxKDc5mIbs4kSqEx3sXRjIT1pSX9EX3 /dPO48= X-UI-Out-Filterresults: notjunk:1;V01:K0:fs5maXwtkc4=:gxwY2VEzvIr1t/PKhozt2Y jBjGdFWYxywiw3sIUc4LFHkhPj8q2bT5UwzkUzkIz5yu4Ae5WMyWIf6UVLRn3kawO+c8Fc/MH EDsOMhpL6HrceFe1MEcizikeNZEgOZ6j9Nsl0BRr9kQY6l31IEBBahKfivwbTN20POONrr+5y 8Nw0fNdEIfTQuL+vTNBkMBBoUfSpSdjcTlEHchLrR2Uf+ds9qTS4/GOxVredZs4SQW4MdgMXq g696Y+RsyFFB30FVTNR3q2aWYyblKS24StzdjDA7VxTpK/is4LgEkrFogwvR8du2aIVcdnP/c efsN8nt/1AJt3As0jUoAKDJcHVqoD1TxOa+07CN6Ib4TLPBdNqBGDfgVmfMyOn7vfhKR/ghAE y6toUGKOxa3weEdvyoglYCEWtbPbWh8rxdU2foDUBaA6XLh0D+oy8iabfKK+9lHMO0uMBobDZ 1FFxdNDhDw== Gesendet:=C2=A0Montag, 07=2E Dezember 2015 um 18:12 Uhr Von:=C2=A0"Winnebeck, Jason" An:=C2=A0"users@groovy=2Eapache=2Eorg" Betreff:=C2=A0CompileStatic closure accessing "this object" private variab= le via setGroovyObjectProperty I have code with performance issues using closures accessing private field= s: =C2=A0 @CompileStatic class X { =C2=A0 private Y a,b,c =C2=A0 =C2=A0 void blah() { =C2=A0=C2=A0=C2=A0 doClosureThing { //This gets run in a loop, 1000s of ti= mes =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 a =3D =E2=80=A6 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 b =3D =E2=80=A6 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 c =3D =E2=80=A6 }}} =C2=A0 When profiling, I see the majority of time is spent in ScriptBytecodeAdapt= er=2EsetGroovyObjectProperty=2E [=2E=2E=2E] Is this expected behavior for static compiler? =C2=A0 Since the compiler checks the assignments to a/b/c, it should also create = a direct access to the variables imho=2E So my answer would be no bye Jochen