Improve performance of merging two Tags
/KeyValues
instances
#5140
Labels
enhancement
A general enhancement
module: micrometer-core
An issue that is related to our core module
performance
Issues related to general performance
Milestone
Please describe the feature request.
This is enhancement request to speed up common operations on set of
Tags
. Depending on scenario application may use some of the operations on tags very often causing micrometer to be non-negligible consumer of CPU of service relying on it.The following operations are proposed to be optimised:
Tags
from already sorted array of unique tags;Tags
objects in optimal way taking into account that tags are stored as sorted arrays.Rationale
I've observed unexpectedly high CPU time spent in micrometer library in several production services I have access to. Here is screenshots from DataDog profiler:
with most of the time is actually spent on two things: creating
Tags
object and merging twoTags
objects:Additional context
I've already did initial PR #4959 which seems to be already lost among many of bot-generated PRs. So I've decided to created dedicated issue to keep track of progress towards making optimisations on
Tags
happen and be accepted.The text was updated successfully, but these errors were encountered: