- Reference indicators for performance
- Execution time-from the time the code starts running to the end
- CPU time--the time that a function or thread consumes the CPU
- Memory allocation-a scenario in which a program consumes memory at run time
- Disk throughput--Describe the use of IO
- Network throughput--describe the use of the network
- Response time-The response time that the system makes to a user's behavior or time
- The bottleneck resources for performance may be:
- Disk IO
- Network operation
- Cpu
- Exception--For Java applications, abnormal replenishment and processing is very resource-intensive, if the program high frequency of exception handling will affect the overall performance
- Database
- Lock contention-increases the cost of context switching
- Memory
- Level of performance tuning
- Design tuning-macro tuning, design a reasonable plan before development, directly determine product quality, can avoid problems in advance. Design optimization, designers should be familiar with design methods, design patterns, basic performance components and common optimization ideas.
- Code Tuning-micro-tuning, focusing on performance differences in implementation
- JVM tuning-the memory of a late development requires a certain understanding of how the JVM works and the basic memory structure. If the structure of the heap memory, the type of GC, etc.
- Database tuning
- Application layer optimization of SQL statements--optimization of SQL statements
- Optimize your database-a well-designed table structure
- Optimize database software-for example, set up a reasonably sized shared pool, cache buffer, or PGA, etc.
- Operating system tuning-such as shared memory segments in Unix, semaphores, shared memory maximums, etc.
Java Performance Tuning Learning notes (1)