-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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:
- Initialisation of
Tagsfrom already sorted array of unique tags; - Merging two
Tagsobjects 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 two Tags 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.