-
Notifications
You must be signed in to change notification settings - Fork 15
perf: parse w3c traceparent using a custom parser #178
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
Conversation
std::regex is notoriously known to be slow. This custom parser implementation offers significantly better performance.
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
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.
That benchmark 😮
Apart from fuzzing, it would be cool to get some unit tests for those invalid values as well as a valid one.
Oh, we did have unit tests, sorry 😓 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
==========================================
- Coverage 93.91% 93.81% -0.11%
==========================================
Files 73 73
Lines 4176 4202 +26
==========================================
+ Hits 3922 3942 +20
- Misses 254 260 +6 ☔ View full report in Codecov by Sentry. |
Don't be fooled by the bot, this is expected. Our macro benchmark don't measure context propagation... which is something we probably should ;) |
This addresses a regression introduced in #178, where traceparent headers containing unsupported characters were not properly rejected and were incorrectly treated as valid. [APMAPI-1599]
This addresses a regression introduced in #178, where traceparent headers containing unsupported characters were not properly rejected and were incorrectly treated as valid. [APMAPI-1599]
This addresses a regression introduced in #178, where traceparent headers containing unsupported characters were not properly rejected and were incorrectly treated as valid. [APMAPI-1599]
Description
std::regexis notoriously known to be slow. This custom parser implementation offers significantly better performance.Benchmark
Bench: https://quick-bench.com/q/XJw86Zh_SBDpQ3xhI2nrY-k-Xbc

Result:
TODO