I have a program I ported from C to Java. Both apps use quicksort to order some partitioned data (genomic coordinates).
The Java version runs fast, but I\'d like to get
do not try to outsmart the jvm.
in particular:
don't try to avoid object creation for the sake of performance
use immutable objects where applicable.
use the scope of your objects correctly, so that the GC can do its job.
use primitives where you mean primitives (e.g. non-nullable int compared to nullable Integer)
use the built-in algorithms and data structures
when handing concurrency use java.util.concurrent package.
correctness over performance. first get it right, then measure, then measure with a profiler then optimize.