Pages

Tuesday, October 29, 2013

Handling collections in java

Recently I was wondering about how java handles collections and the existing opensource java libraries to handle this scenario. Common alternatives to java collections framework are
  1. Apache commons
  2. Guava
  3. PCJ
  4. Trove
Number 1 and 2 alternatives are more popular among developers while 3 and 4 are not mentioned frequently (They are for primitives).  3 and 4 provide more performance compared to Java collections framework. Guava can be used in most cases while it seems like using this library is bit complex but at the same time it reduces many bottlenecks present in the collections operations.

Having mentioned all these libraries, one should also note that if your app does not demand handling complex collection operation, lots of data to be stored in a collection, java collections framework itself is more than adequate.

Below is a nice article that analyze the above topic in detail

http://stackoverflow.com/questions/629804/what-is-the-most-efficient-java-collections-library


No comments:

Post a Comment