Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 54518 invoked from network); 17 Feb 2005 20:54:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Feb 2005 20:54:22 -0000 Received: (qmail 75820 invoked by uid 500); 17 Feb 2005 20:54:17 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 75716 invoked by uid 500); 17 Feb 2005 20:54:16 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 68904 invoked by uid 99); 17 Feb 2005 20:51:53 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of markus.schlegel@gmx.ch designates 213.165.64.20 as permitted sender) Date: Thu, 17 Feb 2005 21:51:47 +0100 (MET) From: "Markus Schlegel" To: commons-user@jakarta.apache.org MIME-Version: 1.0 Subject: [JXPath] Performance penalty with DynamicPropertyHandler.getPropertyNames(Object) X-Priority: 3 (Normal) X-Authenticated: #1338320 Message-ID: <13755.1108673507@www2.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I have written an Implementation of the DynamicPropertyHandler interface to allow our ObjectModel (kind of an inmemory Object store based on a Metamodel) to be accessible with JXPath. As so I have implemented the Method getPropertyNames(Object o):String[] to return all properties accessible under the given Object "o". The size of the returned Array is usually around 250. With searches in small ObjectModels (up to 2000 Objects) this worked ok. But with larger Models (30'000 Objects) we encountered poorest performance (seems to be a non linear algorithm). After looking at it with OptimizeIt, we changed the getPropertyNames(Object o):String[] method to return an empty array always. With this change it works with linear performance. My Question: What is this DynamicPropertyHandler.getPropertyNames(Object) for? I mean it works without it and with it, it shows poor performance. Do we have any disadvantages with returning an empty array always? Maybe you should take this into the Documentation/UsersGuide. It would have saved us a lot of time. Oh, I have to mention, that we use JXPath in lenient mode. This could be the reason why getPropertyNames(Object) is not useful in our case. If so, JXPath should be changed to not use getPropertyNames(Object) in lenient mode per default. Thanks Markus -- Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org