Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > primitive collections....which is best?

Thread Tools

primitive collections....which is best?

Posts: n/a
Hi all,

We are revamping some packages that use one of the primitive
collections out there ( but we know there are
others, for example, the Trove library).

Any recommendations or insights? Is it worth switching? Any clear
preferred package?

Also, we did think about replacing the primitive collections with the
5.0 boxin/unboxing + generics, but from all we've seen the performance
penalties are too great. So we stick with the primitives...

Thanks for any insights


Reply With Quote
Ralf Wiebicke
Posts: n/a


I do use pcj for my project. Some time ago I tried to switch to trove, but
it lacked some of the less often used methods (retainAll), which I needed.

Currently I really miss the equivalent of LinkedHashMap for primitives,
which pcj and trove (AFAIK) do not implement.

One of bigger performance advantages of pcj and trove is the use of open
hashing instead of chained hashing. See the docs of pcj for an explanation.
pcj offers both open and chained hashing, trove offers open hashing only,
JCF (java.util.*) offers chained hashing only.

And trove offers generics (for instance for Integer-Object maps), pcj does

Best regards,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default primitive values from primitive Class<?> object. Daniel Pitts Java 7 10-23-2008 04:30 PM
How to cast object to primitive array? ASP .Net 3 04-08-2006 07:33 PM
Primitive vs. non-primitive l-value C++ 7 05-09-2005 02:52 PM
ObjectDataSource non-primitive data fields DoesDotNet ASP .Net 2 04-22-2005 05:33 PM
How to pass other than a primitive type as a property of a custom control? Henri ASP .Net 0 05-17-2004 02:41 PM