Meaningless Drivel is fun!
The moose likes Performance and the fly likes Performance of ArrayList and Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Performance of ArrayList and Vector" Watch "Performance of ArrayList and Vector" New topic

Performance of ArrayList and Vector

Erik Hu

Joined: Dec 05, 2001
Posts: 6
Hi, all
I've done some test, but can not see the difference of ArrayList and Vector, anyone who has some better suggestion?
dan moore
Ranch Hand

Joined: Nov 04, 2001
Posts: 68
compared on performance (not behaviour)? what were your results?

dan moore, infomatiq ltd.<br />email<br /><a href="" target="_blank" rel="nofollow"></a>
kumud sharma

Joined: Jan 31, 2001
Posts: 4
Vectors are always the prefered data structure as internally it implements arrays.
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
(Copy of an answer I posted in a different forum)
The simple answer: ArrayList is faster
Why? Vector has been around longer and developed into a sort of be-all do-all class with synchronization and support for many different API. ArrayList is a straitforward implementation of a List with no whistles or bells.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879
here are some good discussions on this topic
Consider Paul's rocket mass heater.
subject: Performance of ArrayList and Vector
It's not a secret anymore!