skywalking-java/apm-sniffer/apm-agent
Gong Dewei db54c65d09
Optimize bytebuddy type description performance (#637)
### Improve the performance of type description of byte-buddy
The goal is to get the original class description at re-transform, so as to generate consistent results when the Skywalking agent is enhanced again (including implementing the EnhancedInstance interface, auxiliary fields and methods, etc.)

The previous type description used the `AgentBuilder.DescriptionStrategy.Default.POOL_FIRST` policy to get origin type description, which slows down the application startup, due to heavy I/O operations and parsing bytecode. 

New way is to remove dynamic fields, methods and interfaces generated by SkyWalking Agent from `TypeDescription`, and **make it as origin type descripton**.

**Key feature** :  
* No need to cache `TypeDescription` objects, less memory used.
* It only applies to the re-transform class processing flow and does not affect the startup process.

**Process flow:**
1. Find `TypeDescription` from commonly used type cache, such as primitive class.
2. Delegate to `AgentBuilder.DescriptionStrategy.Default.HYBRID`
3. Wrap `TypeDescription` by `SWTypeDescriptionWrapper` , remove fields, methods, interface generated by SkyWalking. 

**Relative Issue:**  https://github.com/apache/skywalking/issues/11460
2023-11-03 09:45:28 +08:00
..
src/main/java/org/apache/skywalking/apm/agent Optimize bytebuddy type description performance (#637) 2023-11-03 09:45:28 +08:00
pom.xml Release 9.0.0 and set 9.1.0-SNAPSHOT for next iteration (#600) 2023-08-29 11:57:56 +08:00