metrics
metrics copied to clipboard
Excessive memory allocation
The following flame graph shows the memory allocation is beyond expectation. We should optimize it.
This should be fixed previously. The major allocation comes from com.alibaba.metrics.common.filter.MetricNameSetFilter#matches. To avoid string allocation, using the following logic instead.
success = name.getKey().startsWith(nameToMatch) && nameToMatch.length() == lastIndexOfDot;