There are a number of Java programming practices that I commonly see in use that can be optimized to provide significant speedups.
Example: For lot's of +
operations on String
s, use StringBuilder
instead.
What are some simple, useful optimizations one can make to potentially improve your program's performance by a significant amount?
EDIT: I'm not looking for trivial premature optimizations. This is not my intention in asking this question. Instead I would like to learn common constructs/mistakes that do constitute a significant performance hit.