开发者

Java optimizations [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and po开发者_开发问答ssibly reopened, visit the help center for guidance. Closed 11 years ago.

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 Strings, 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.


  1. Spend at least an order of magnitude more time thinking hard about the most efficient algorithms and data structures for the problem as you do thinking about how to micro-optimize specific operators, control-flow constructs, etc.
  2. See (1)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜