If you think to hear something new … don’t wast your time reading this post
Just because I was interrested I tried the well-known ArrayLIst vs. Vector on a 4-way Power5 machine and it turned out that all the guys claming Vector is faster are fooled by the different resizing characteristics.
It did not more than adding 20.000.000 times the same string object to an initialized collection.
The Collections were created on own Thread so absolutly no contended locking:
Vector:
1 Thread: 2302ms/calculation
10 Threads 2151ms/calculation
50 Threads 2127ms/calc
ArrayList:
1 Thread: 2034ms/calc
10 Threads: 646ms/calc
50 Threads: 524ms/calc
as you can see, arraylist scales well with the number of processors, vector does not even scale a bit although no contended locks should appear. Another scaliability problem I found is Memory-Management which seems to scale not at all, too … however the test was run on an IBM-JVM so I cannot speak about hotspots parallel GCs.
lg Clemens