Three levels of performance optimization

Source: Internet
Author: User

Editor's note: Performance optimization, in short, is to make it run faster, without affecting the correctness of the system's operation, and to accomplish a specific function in less time. This article is the first in a series of performance optimization articles, mainly on three aspects of performance optimization.

There are three levels of performance optimization:

◇ System Level

◇ Algorithm Level

◇ Code Hierarchy

The system level is concerned with the control process and data flow of the system, and the optimization mainly considers how to reduce the number of messages, how to make the load of the system more balanced, how to make full use of the hardware performance and facilities, and how to reduce the system overhead (such as context switching).

The algorithm hierarchy focuses on the choice of algorithms (replacing existing algorithms with more efficient algorithms without altering their interfaces), optimization of existing algorithms (Time and space optimization), Concurrency and lock optimization (increasing parallelism of tasks, reducing the cost of locks), data structure design (such as lock-free and algorithms).

The code hierarchy focuses on code optimization, primarily cache-related optimizations (I-cache, D-cache-related optimizations), code execution sequence adjustments, compilation optimization options, language-related optimization techniques, and so on.

Performance optimization requires relevant tooling support, including compiler support; CPU support, as well as measurement tools integrated into the code, and so on. The main purpose of these tools is to measure the execution time of code and related data such as cache miss, Cache hit, which can help developers locate and analyze problems.

Performance optimization and performance design are different. Performance design throughout the design, coding, testing the entire process is the first phase of the product life cycle, and performance optimization, usually based on existing systems and code improvements, is the product life cycle of the next several stages (assuming the product has multiple life cycle). Performance optimization is not a redesign, and performance optimization is based on existing products and code, rather than reinventing it. Performance optimization methods and techniques can guide performance design, but the methods and techniques of the two cannot be equated. The two objects of interest are different. Performance design is a positive consideration: how to design an efficient, high-performance system; Performance optimization is a reverse consideration: how to position and optimize performance in the event of a performance problem. Performance is designed to test developers ' ability to build, while performance optimization tests the developer's ability to reverse repair. Both can be complementary.

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.