skywalking-java/oap-server/analyzer/meter-analyzer/src
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
..
main/java/org/apache/skywalking/oap/meter/analyzer Perf: cache regex pattern and result, optimize string concatenation (#7199) 2021-06-29 17:46:42 +08:00
test/java/org/apache/skywalking/oap/meter/analyzer/dsl eliminate `now` error at a fixed rate schedule executor (#7145) 2021-06-24 09:24:48 +08:00