skywalking-java/oap-server/analyzer/meter-analyzer
kezhenxu94 84a7fe30c8
Perf: cache regex pattern and result, optimize string concatenation (#7199)
The possible metrics names are relatively fixed in an OAP run, we previously always escape the metrics names, building a new regex Pattern from scratch, which is cpu-consuming.

In this patch, I cache the escaped metrics names, and if it missed, use a pre-compiled regex Pattern to escape the metrics name.

This patch also replace string concatenation `+` with `StringBuilder` in generated classes, which won't get optimized by Java compiler

This may reduce 1~1.5 vCPU under 20K RPS environment.
2021-06-29 17:46:42 +08:00
..
src Perf: cache regex pattern and result, optimize string concatenation (#7199) 2021-06-29 17:46:42 +08:00
pom.xml Extract dependency management to a bom (#7136) 2021-06-20 20:57:26 +08:00