Writing High Performance Java Code #1849
-
|
Question: |
Beta Was this translation helpful? Give feedback.
Answered by
shivrajcodez
Mar 21, 2026
Replies: 1 comment
-
|
Use primitives > wrappers (avoid boxing) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use primitives > wrappers (avoid boxing)
Avoid unnecessary objects (reduce GC)
Prefer StringBuilder over String concat
Use efficient collections (ArrayList > LinkedList)
Tune GC → G1 Garbage Collector / Z Garbage Collector
Minimize synchronization (use concurrent utils)
Use streams carefully (avoid in hot paths)
Reuse objects / pooling (when needed)
Lazy initialization (load only when required)
Profile first (JMH, VisualVM)