commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Schlegel" <markus.schle...@gmx.ch>
Subject [JXPath] Performance penalty with DynamicPropertyHandler.getPropertyNames(Object)
Date Thu, 17 Feb 2005 20:51:47 GMT
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


Mime
View raw message