Reasonable Use of operator priority, performance optimization and improvement details, and operator performance optimization

Source: Internet
Author: User

Reasonable Use of operator priority, performance optimization and improvement details, and operator performance optimization

In JAVA programs, most of the reason for performance problems is not the JAVA language, but the program itself. Developing good coding habits is very important and can significantly improve program performance.
1. Use the singleton whenever possible
2. Avoid using static variables whenever possible
3. Avoid creating too many Java objects.
4. Try to use the final Modifier
5. Use local variables whenever possible
6. Try to handle the places of use of the packaging type and basic type
7. Use synchronized with caution to minimize synchronize.
9. Try not to use the finalize method
......
N. Use shift as much as possible to replace 'a/B 'operations

Reasonable Use of the operator priority can improve the program performance to a certain extent, to achieve some performance optimization.


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.