File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Performance
Bookmark "Performance of ArrayList and Vector" Watch "Performance of ArrayList and Vector" New topic
Author

Performance of ArrayList and Vector

Erik Hu
Greenhorn

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 dan@infomatiq.co.uk<br /><a href="http://www.infomatiq.co.uk" target="_blank" rel="nofollow">http://www.infomatiq.co.uk</a>
kumud sharma
Greenhorn

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

http://www.javaranch.com/ubb/Forum1/HTML/002196.html http://www.javaranch.com/ubb/Forum15/HTML/000285.html http://www.javaranch.com/ubb/Forum15/HTML/000039.html
here are some good discussions on this topic
Jamie
 
 
subject: Performance of ArrayList and Vector