lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Vector -> LinkedList for performance reasons...
Date Wed, 21 Jan 2004 15:38:16 GMT
Francesco Bellomi wrote:
> I agree that synchronization in Vector is a waste of time if it isn't
> required,

It would be interesting to see if such synchronization actually impairs 
overall performance significantly.  This would be fairly simple to test.

> but I'm not sure if LinkedList is a better (faster) choice than ArrayList.

Correct.  ArrayList is the substitute for Vector.  One could also try 
replacing Hashtable with HashMap in many places.

 > I think only a profiler could tell.

I wouldn't trust a profiler for this.  Rather, I'd perform benchmarks 
before and after the change will best show real performance.  A 
substantial indexing benchmark and some search benchmarks, searching 
fairly large indexes would be good.

My hunch is that the speedup will not be significant.  Synchronization 
costs in modern JVMs are very small when there is no contention.  But 
only measurement can say for sure.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message