perf: parse w3c traceparent using a custom parser#178
Conversation
std::regex is notoriously known to be slow. This custom parser implementation offers significantly better performance.
pablomartinezbernardo
left a comment
There was a problem hiding this comment.
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