-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag parsing optimizations #210
Merged
matthiasr
merged 5 commits into
prometheus:master
from
claytono:tag-parsing-optimizations
May 14, 2019
Merged
Tag parsing optimizations #210
matthiasr
merged 5 commits into
prometheus:master
from
claytono:tag-parsing-optimizations
May 14, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Clayton O'Neill <[email protected]>
On the a-z benchmark, this brings the ns/op down from 5658 to 5533. Signed-off-by: Clayton O'Neill <[email protected]>
This improves performance per call in the a-z case from around 5533 ns/op to 3169ns/op. It also drops allocations per call from 57 to 31 in the a-z case. Signed-off-by: Clayton O'Neill <[email protected]>
Signed-off-by: Clayton O'Neill <[email protected]>
claytono
force-pushed
the
tag-parsing-optimizations
branch
from
May 13, 2019 16:47
6967643
to
4570415
Compare
This improves performance from 3169ns/op to 2836 ns/op and drops one allocation per op. Signed-off-by: Clayton O'Neill <[email protected]>
claytono
force-pushed
the
tag-parsing-optimizations
branch
from
May 13, 2019 17:32
4570415
to
a4faae2
Compare
Wonderful, thank you! |
matthiasr
pushed a commit
that referenced
this pull request
May 14, 2019
Signed-off-by: Matthias Rampke <[email protected]>
matthiasr
pushed a commit
that referenced
this pull request
May 15, 2019
* [CHANGE] Do not run as root in the Docker container by default ([#202](#202)) * [FEATURE] Add metric for count of events by action ([#193](#193)) * [FEATURE] Add metric for count of distinct metric names ([#200](#200)) * [FEATURE] Add UNIX socket listener support ([#199](#199)) * [FEATURE] Accept Datadog [distributions](https://docs.datadoghq.com/graphing/metrics/distributions/) ([#211](#211)) * [ENHANCEMENT] Add a health check to the Docker container ([#182](#182)) * [ENHANCEMENT] Allow inconsistent label sets ([#194](#194)) * [ENHANCEMENT] Speed up sanitization of metric names ([#197](#197)) * [ENHANCEMENT] Enable pprof endpoints ([#205](#205)) * [ENHANCEMENT] DogStatsD tag parsing is faster ([#210](#210)) * [ENHANCEMENT] Cache mapped metrics ([#198](#198)) * [BUGFIX] Fix panic if a mapping resulted in an empty name ([#192](#192)) * [BUGFIX] Ensure that there are always default quantiles if using summaries ([#212](#212)) * [BUGFIX] Prevent ingesting conflicting metric types that would make scraping fail ([#213](#213)) With #192, the count of events rejected because of negative counter increments has moved into the `statsd_exporter_events_error_total` metric, instead of being lumped in with the different kinds of successful events. Signed-off-by: Matthias Rampke <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Profiling shows that for our environment, parsing tags is the single biggest steady state contributor to CPU usage. This PR replaces some calls to strings library functions to simpler implementations with the intention of reducing CPU overhead and some memory allocations.
Here is an example of the before scenario:
And here is what it looks like afterwards: