You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Markus Schlegel <ma...@gmx.ch> on 2005/01/21 09:55:50 UTC

[JXPath] Performance penalty with DynamicPropertyHandler.getPropertyNames(Object)

I have written an Implementation of the DynamicPropertyHandler interface to
allow our ObjectModel (kind of an in-memory Objectstore 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.

Thanks 
Markus

-- 
Sparen beginnt mit GMX DSL: http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org