Obsolete Java Optimization Tips

前端 未结 8 1946
鱼传尺愫
鱼传尺愫 2020-12-12 14:57

There are number of performance tips made obsolete by Java compiler and especially Profile-guided optimization. For example, these platform-provided optimizations can drasti

8条回答
  •  温柔的废话
    2020-12-12 15:42

    1. Don't manually call the garbage collector, it hurts performance on modern JVM implementations.
    2. Integer instead of Long will not save much space, but will limit the range of the numbers.
    3. Avoid hand generated Enum classes and use the built in Enum instead. Java 1.5 introduced real Enums, use them.

提交回复
热议问题