-
Notifications
You must be signed in to change notification settings - Fork 103
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
exporter/collector: avoid using req.String() to check for empty request #889
exporter/collector: avoid using req.String() to check for empty request #889
Conversation
960c664
to
709d9af
Compare
a6978e7
to
2adedca
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #889 +/- ##
==========================================
+ Coverage 61.03% 62.99% +1.96%
==========================================
Files 56 57 +1
Lines 5903 6013 +110
==========================================
+ Hits 3603 3788 +185
+ Misses 2143 2063 -80
- Partials 157 162 +5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, amazing work! Sounds like our benchmarks already has been proven to be useful.
The best optimizations are one-liners 💪🏽
I guess it would be nice to run some microbenchmark here to double check, but in theory this be faster vs stringifying
Added some microbenchmarks, here are some savings:
When WAL is disabled (default) the savings are higher, but with WAL this still has significant savings. Note that these numbers are pretty fudged since the exporting logic is omitted, but some significant improvement is visible nonetheless |
/gcbrun |
This change is motivated by some CPU profiling that showed that its responsible for over 20% of CPU time in my environment (running avalanche, OTel with Prom receiver and the gmp exporter). Sending this change because its logically equivalent to before but avoids the serialization to the string.
a60c45e
to
15099b9
Compare
This change is motivated by some CPU profiling that showed that its responsible for over 20% of CPU time in my environment (running avalanche, OTel with Prom receiver and the gmp exporter). Sending this change because its logically equivalent to before but avoids the serialization to the string.
Flamegraph: pprof/?id=f2daddf0bdf127bfa136618996b263c2&tab=flame&path=1ygnz740h91y6o