Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 61CE1200C5F for ; Sun, 9 Apr 2017 01:49:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 605DE160B96; Sat, 8 Apr 2017 23:49:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A783E160B93 for ; Sun, 9 Apr 2017 01:49:46 +0200 (CEST) Received: (qmail 94641 invoked by uid 500); 8 Apr 2017 23:49:45 -0000 Mailing-List: contact dev-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list dev@polygene.apache.org Received: (qmail 94627 invoked by uid 99); 8 Apr 2017 23:49:45 -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; Sat, 08 Apr 2017 23:49:45 +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 3D5B81A054C for ; Sat, 8 Apr 2017 23:49:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.98 X-Spam-Level: * X-Spam-Status: No, score=1.98 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id QtC9uOrbsSkJ for ; Sat, 8 Apr 2017 23:49:44 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 93DBD5FBC1 for ; Sat, 8 Apr 2017 23:49:43 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id h125so56207052lfe.0 for ; Sat, 08 Apr 2017 16:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=UZh/ODMLz0YkvK12S0RkRlRbzFtiU5oVXao9pjpG55U=; b=n391lQlzWKQm4tdB9a0TCJnd4/qeOO0vgsZMVSPIL0e1oDvmMpOk646aTtxI1AiyjY og7eMN6ivhY4d0ZpAnMnRS1j6GFVkwbMrGDSdMuWmuAfJl9XZlyat3gR4j2djyRmWQRH BCGgwhSrggrz1ApfunhSpfPscPv0+mUpweInnMWZbE1UZZ9ze8gtZR3YyRuE9mpS3PtK RC6RPXXILCrRBWrG3Gsn9ve8lWQcxScKYaPkZsBQzGDKId59uCuD2/iSW6VYEboAdApl QGpy3BkF7razUk92rPN6z2hz7USSC3AFg59LrfapkEeXYdwMFW6rug4YwEqLpdCXUeje 6llA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=UZh/ODMLz0YkvK12S0RkRlRbzFtiU5oVXao9pjpG55U=; b=QEJjI9Eevnk3xaKE/gA3e5fP59I3GwXEUMTfqkfaGrG5/CL0dkHIP9cgeJ5Vm07pzV foqKIRj6Gzvo0gpyPMYRAUrD/ayD4/MexlDWzq+8BljD8V+miHXlUIKaldnNTTJTibMZ 5RlereHqI1/vkOKAUZvZS/GmnhvlOC3yVlzMILmUKbqYjYYp3FWb1B+UGNJuPDNRviQ7 jvFlobUtx641dmPB8CWuoo7+hp8fMZI9AHpQ27Q5r4vkqAAQCv5R+512IXioRUPUwryR 0WfCj7rHemw9l+CDR9phxz7C5sHWmrkUSfVSvJ1i1aKm8R8bj9Nb6RZlUR6WaQ12aLBm uyPA== X-Gm-Message-State: AFeK/H2k3cOU+iEX7kFtVSrOjDyuv/9dnVsOXNfHKyEOa2rWY6DUUxK4hp/IpcE4uw3cGi26vT2dIW9L3zt7TQ== X-Received: by 10.46.87.13 with SMTP id l13mr12724811ljb.85.1491695382326; Sat, 08 Apr 2017 16:49:42 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.46.22.27 with HTTP; Sat, 8 Apr 2017 16:49:21 -0700 (PDT) In-Reply-To: <58E909E9.5080209@apache.org> References: <58E909E9.5080209@apache.org> From: Niclas Hedhman Date: Sun, 9 Apr 2017 07:49:21 +0800 X-Google-Sender-Auth: xK4Shf-TA0h4KjD929ayQiWYd8Y Message-ID: Subject: Re: setAccessible( true ) To: dev@polygene.apache.org Content-Type: multipart/alternative; boundary=f403045f7fc8607cfa054cb06558 archived-at: Sat, 08 Apr 2017 23:49:47 -0000 --f403045f7fc8607cfa054cb06558 Content-Type: text/plain; charset=UTF-8 Yeah, already pre-1.0 we were fighting to move all setAccessible() to model creation where they belong and ensure none were executed in runtime. IF they have snuck back into runtime, then yes they should be pushed back. IF they are simply called too many times in bootstrap, then I don't worry too much about it and wouldn't spend time locate them. Cheers Niclas On Sun, Apr 9, 2017 at 12:03 AM, Paul Merlin wrote: > Gang, > > We use accessibleObject.setAccessible( true ) a bit too agressively. > This is a performance killer because of the JVM security checks it implies. > Some profiling showed me that's it's often on the critical path, Well > that's because I profiled the bootstrap phase for most of the cases. > > BTW, the new serialization subsystem is way faster than the previous one > \o/ > JSONEntityState still is a hotspot, but that's another topic. > > There are places where setAccessible( true ) is simply not needed and I > will remove them. > > Unfortunately, o.isAccessible() does not check if it is actually > accessible but simply if setAccessible( true ) was called on it to > forcibly make it accessible. We have some of these checks here and > there, I'll verify if they are legitimate. > > There are places where it supports e.g. using private classes as mixins, > and injection to private fields. For some types of > composites/fragments/etc.. calls to setAccessible() are made when > creating the model, for some others they are made during runtime > repeatedly. I'll move all these at bootstrap time so we don't pay that > cost at runtime. > > /Paul > > -- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java --f403045f7fc8607cfa054cb06558--