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 AF295200C8F for ; Fri, 9 Jun 2017 21:41:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AD8B1160BCA; Fri, 9 Jun 2017 19:41:50 +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 3D778160BB6 for ; Fri, 9 Jun 2017 21:41:49 +0200 (CEST) Received: (qmail 88453 invoked by uid 500); 9 Jun 2017 19:41:48 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 88439 invoked by uid 99); 9 Jun 2017 19:41:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jun 2017 19:41:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0D10D18097B for ; Fri, 9 Jun 2017 19:41:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=objectstyle.org header.b=BCoYe+8L; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=QOoQqBw2 Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id MtWnNkXZ0FJO for ; Fri, 9 Jun 2017 19:41:44 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A7FF65F6BE for ; Fri, 9 Jun 2017 19:41:44 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 75F5D20BF9 for ; Fri, 9 Jun 2017 15:41:44 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 09 Jun 2017 15:41:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=objectstyle.org; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=/St2XIvzQKd/OMW R9F93sXo2q2vux/rrygvA9xbGG+w=; b=BCoYe+8LLXasycvmAAy57Y5vsBQ2DFp JbEeWc1GNU60CvDqh3USvnOc4fGnyrkhcCPlZePwl2xoYzMCwXLsNSeTlHjw3AWf BzpSrhXcPLWxcQYDgR8WoqekdYxteg4YGHBYeyn2kzK9D7phbXW/ZNVyraYZbTL2 abbAPB4P/pfQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=/St2XIvzQKd/OMWR9F93sXo2q2vux/rrygvA9xbGG+w=; b=QOoQqBw2 e60x22KYPHwTEF19KkLeiGnUFUrJY16ecIhsMxJJZJZIa7RO4lT62t5YvFcYBfPO HXp0dgZPubGGz54XMuTyZi3JrkQb+ZO50JsOOmZBWuKiWXaZXludEZVMCStruwu5 2pNM3kpKw9kqzMNsbsxdHodVF5cjVaJPk/Ja9VZ19Hprfb400djopHGUYK7iYGgZ Fpb22KlHF81im+w5M0rUfE0mswH9Zoq9oA7jdPJFB8XU2qrzYXO9IIzwr3E8FDaw rg2Dv2UyAAxutwPQ3mWTWWgo88lOAguLr6uOjiQ1nKwAKVHnMV969s64qSwb6k0u HE6hlEgm2NyD3A== X-ME-Sender: X-Sasl-enc: 0ESgu6IqgZfkEgV2WUK4f7VczOYKKMFYn7D+tVCCdGJG 1497037304 Received: from [192.168.2.105] (unknown [93.125.61.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 001737E7AA for ; Fri, 9 Jun 2017 15:41:43 -0400 (EDT) From: Andrus Adamchik Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Cayenne object storage / memory usage Date: Fri, 9 Jun 2017 22:41:41 +0300 References: <189FE6CA-66F9-4FA1-8415-6A90D52C3748@objectstyle.org> To: dev@cayenne.apache.org In-Reply-To: Message-Id: <4A015B64-C396-45F4-975A-DA01F6CF554A@objectstyle.org> X-Mailer: Apple Mail (2.3273) archived-at: Fri, 09 Jun 2017 19:41:50 -0000 > On Jun 9, 2017, at 9:29 PM, John Huss wrote: >=20 >>> I can't imagine a more efficient representation that fields. >>=20 >> True, but fields also require reflection to be accessed "from below" = (by >> Cayenne). >=20 >=20 > It doesn't have to use reflection. With Java 7 and newer you can use > strings in switch statements with a single jump, which is what I'm = doing. > The class template generates the readPropertyDirectly method with the > switch statement in it. This is both fast and simple. Also, using = fields > makes it much easier to inspect your objects in the debugger, which is > handy. Yeah, using fields would be great. It is certainly much more = developer-friendly. I'd like to run some benchmarks on "switch", but = this may be a quick way for us to improve the framework without = rewriting the stack. The only potential advantage of an Object[] approach would be the = ability to replace object state atomically. Maybe someday we'll be able = to take advantage of that. But at the moment what you are suggesting = looks very promising and also "easy". Andrus