The Value, Modes, and Practices of Performance Optimization
This article explains the benefits and drawbacks of performance optimization, distinguishes between single‑application and structural optimization approaches, outlines common steps, tools, and techniques for each, and presents case studies illustrating architectural evolution for improved scalability and stability.
Value of Performance Optimization
From the diagram above, the advantages are cost reduction, improved stability, and enhanced user experience.
Cost reduction
Stability improvement
User experience enhancement
The drawbacks include increased maintenance cost, more complex code and architecture, and a potentially more complicated technology stack.
Two Modes of Performance Optimization
In summary, performance optimization can be divided into two categories: single‑application optimization and structural optimization.
Single‑application optimization : focuses on the bottleneck of an individual system and improves performance by addressing that bottleneck.
Structural optimization : improves overall performance by redesigning the link structure and allocation.
Common Steps for Single‑Application Optimization
Basic optimization loop (closed‑loop):
Identify performance bottlenecks/hotspots.
Determine optimization方案 (solutions).
Implement and feedback the optimization results.
Common methods to identify bottlenecks/hotspots:
Performance load testing: quantify runtime performance using tools or manual methods.
Business/code review: read code to find resource‑consuming hotspots; quantify resource usage (e.g., number of database calls per business operation, number of service computations, etc.).
Typical load‑testing observations and tools (example for Java applications):
Load‑testing tool: JMeter;
Memory usage: MAT, GC logs, vmstat;
IO status: iostat;
Network status: netstat;
Hotspot code: JProfile, BTrace, jstack, jstat;
CPU usage: top.
Common optimization techniques or patterns:
Staticization: separate dynamic and static data.
Asynchronization: move non‑critical business logic out of the main flow.
Parallelization: use multithreading to shorten response time.
Memory optimization: reduce object size, minimize object creation, optimize data models.
Deduplication: improve business logic or use caching.
Reduce database operations: data redundancy, caching, etc.
Shorten database transactions: short transactions, async, eventual consistency.
Simplify code logic: remove redundant code and over‑engineered checks.
Streamline logging: control log size to avoid IO bottlenecks and excessive string generation that adds GC pressure.
Common Steps for Structural Optimization
This part has been covered in many articles about website architecture evolution; the following images illustrate the concept.
Each stage has a suitable software architecture, and based on cost, construction complexity, and maintenance considerations, it is unnecessary to build a complete technical system from the start.
Performance is a key driver for application architecture research, as shown by the evolution of application structures below.
1. In the single‑application era, the common bottleneck first appears in the database.
2. The first solution in the single‑application era is to use caching (application‑level cache).
3. The next solution is an independent cache service (centralized cache such as Memcached).
4. Centralized deployment of a single application increases cluster processing capacity.
5. After centralized deployment, database bottlenecks reappear.
6. Solutions for database bottlenecks include sharding and read/write separation.
7. Service‑oriented decomposition handles larger request volumes.
8. Service‑oriented cluster deployment pattern.
Two Structural Optimization Cases
Approaches to handling single‑point/network bottlenecks
Methods to address database connection‑pool bottlenecks
Summary: Trends in Performance/Application Optimization
Author Introduction
Chen Xianming (Ant Financial Technical Expert, stage name "Shanqiu") Focused on coding for seven years, enjoys building bricks and swinging hammers (the "King of Shanqiu" comes from Icecrown). Active in the mid‑generation tech community, specializing in high availability, distributed systems, performance optimization, stability, and efficient operations. Self‑assessment: not famous, but has a slight technical sentiment, loves networking, and welcomes technical discussions.
Long‑press the QR code to open in a browser.
Download the "Big Lecture Hall" online course app instantly.
Supports Android and iOS.
Qunar's latest and hottest video courses are all here!
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.