> Writing a native ancestor iterator didn't help me much, so I switched
> the profile on. Here's an excerpt of the top number of function calls in
> my application:
>
> count callee caller time
> 241550 java/util/ArrayList.RangeCheck(I)V
> java/util/ArrayList.get(I)Ljava/lang/Object; 0
> 232769 org/jaxen/dom/DocumentNavigator$NodeIterator.hasNext()Z
>
org/jaxen/expr/DefaultLocationPath.evaluate(Lorg/jaxen/Context;)Ljava/lang/O
bject; 0
> 222591
> org/apache/xerces/dom/ChildNode.getNextSibling()Lorg/w3c/dom/Node;
>
org/jaxen/dom/DocumentNavigator$1.getNextNode(Lorg/w3c/dom/Node;)Lorg/w3c/do
m/Node; 0
> 222588
>
org/jaxen/dom/DocumentNavigator$1.getNextNode(Lorg/w3c/dom/Node;)Lorg/w3c/do
m/Node;
org/jaxen/dom/DocumentNavigator$NodeIterator.next()Ljava/lang/Object; 0
> 179553
>
org/jaxen/expr/DefaultNameStep.matches(Ljava/lang/Object;Lorg/jaxen/ContextS
upport;)Z
org/jaxen/expr/DefaultLocationPath.evaluate(Lorg/jaxen/Context;)Ljava/lang/O
bject; 0
>
> do we really need a range-checked ArrayList in all the classes? What
> will happen if I change all the new ArrayList() calls to new Vector()
> instead ? (Vector implements the List interface).

But Vector is pretty similar to ArrayList in behaviour, its just that Vector
is synchronized everywhere, so its probably even slower isn't it?

FWIW Dennis Sosnoski found that sometimes using an Iterator with Lists were
sometimes quicker than using index lookups, on some HotSpot JVMs. It depends
on which platform & hotspot JVM though.

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to