Sources of Java Performance Problems
Frequent use of “expensive” language constructs:
- synchronizing methods and blocks can slow down execution by a factor of 100
- throw…catch clauses, throwing exceptions (assuming allocation of exception object)
- type casting
- + operator for Strings
Frequent use of “expensive” API classes and methods:
- frequent object (re)allocation and copy operations in API calls