Skip to content
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

speed up statsd parser #1768

Merged
merged 1 commit into from Sep 15, 2016
Merged

speed up statsd parser #1768

merged 1 commit into from Sep 15, 2016

Conversation

dgnorton
Copy link
Contributor

@dgnorton dgnorton commented Sep 14, 2016

Required for all PRs:

  • CHANGELOG.md updated

Before

BenchmarkParse-4                                      50000         35152 ns/op
BenchmarkParseWithTemplate-4                          30000         45953 ns/op
BenchmarkParseWithTemplateAndFilter-4                 30000         50166 ns/op
BenchmarkParseWith2TemplatesAndFilter-4               20000         64277 ns/op
BenchmarkParseWith2Templates3TagsAndFilter-4          20000         81050 ns/op

After

BenchmarkParse-4                                  100000         20525 ns/op
BenchmarkParseWithTemplate-4                      100000         20438 ns/op
BenchmarkParseWithTemplateAndFilter-4             100000         20692 ns/op
BenchmarkParseWith2TemplatesAndFilter-4           100000         20724 ns/op
BenchmarkParseWith2Templates3TagsAndFilter-4      100000         22354 ns/op

if err == nil {
s.graphiteParser = p
p.DefaultTags = tags
name, tags, field, _ = p.ApplyTemplate(name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part where the template gets applied should be outside of the p == nil if-statement

Copy link
Contributor

@sparrc sparrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgnorton dgnorton merged commit b613405 into master Sep 15, 2016
@dgnorton dgnorton deleted the dgn-speedup-statsd-parser branch September 15, 2016 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants