HPPC:
Frequently Asked Questions
Why yet another collections package?
The Java Collections Framework is in many ways excellent, but it cannot be
directly used for primitive types and autoboxing introduced in Java 1.5
results in increased memory usage and lowered performance due to excessive
garbage collection.
There are a few projects implementing collections over primitive types, including
fastutil,
PCJ,
GNU Trove,
Apache Mahout (ported COLT collections),
Apache Primitive Collections.
Some of them are released under the LGPL license, which many commercial
companies tend to avoid at all costs; other are no longer maintained or
complete. Most of the projects tend to write tightly encapsulated code
with no access to private internals, implement the API of standard Java packages and
strive
for fast error-recovery. While these are all good programming practices,
they are not always practical. In many computationally-intensive
applications, access to the collection class' internals is crucial for
writing highest-performance application code.
When to use HPPC?
-
You write high-performance low-level routines and need
a small, focused primitive collections library.
-
You need to access collections' internal data storage
for application-specific optimisations.
- You need a commercial-friendly software license.
When not to use HPPC?
-
Your software uses data collections in non-critical code sections,
with low-volumes of data. If so, stick with JCF, performance gain of
nanoseconds is not worth the overhead.
-
You need the flexibility of Java Collections and are
prepared to sacrifice runtime performance for easier coding.
In that case, stick with JCF, perhaps enhanced with
Google Collections.
-
You're not confident enough that your unit- and regression tests will
catch invalid parameters or states; you would like to have the
validation done also in production.
-
You cannot bear with occasional compatibility-breaking API refactorings that may
happen while HPPC is in alpha stage.
-
You write mission-critical software and would feel uneasy
about including an early version of HPPC in it. Please watch
the mailing list for a stable release announcement.