On 12 Dec 2001, Christian Nentwich wrote:

> 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/Object; 0
> 222591
> org/apache/xerces/dom/ChildNode.getNextSibling()Lorg/w3c/dom/Node;
> org/jaxen/dom/DocumentNavigator$1.getNextNode(Lorg/w3c/dom/Node;)Lorg/w3c/dom/Node; 0
> 222588
> org/jaxen/dom/DocumentNavigator$1.getNextNode(Lorg/w3c/dom/Node;)Lorg/w3c/dom/Node; 
>org/jaxen/dom/DocumentNavigator$NodeIterator.next()Ljava/lang/Object; 0
> 179553
> 
>org/jaxen/expr/DefaultNameStep.matches(Ljava/lang/Object;Lorg/jaxen/ContextSupport;)Z 
>org/jaxen/expr/DefaultLocationPath.evaluate(Lorg/jaxen/Context;)Ljava/lang/Object; 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).
> 
> Any concerns?

It was my understanding that Vector was a jdk-1.1 collection which has
synchronization overhead, so you're acquiring and releasing locks left
and right.

ArrayList, I thought, was simply the non-synchronized version made
available through the Java-2 Collections API.  

Though, if a Vector is more efficient than an ArrayList, then by all
means, that's fine by me.  I'm not too picky about my collections.

        -bob



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

Reply via email to