opentelemetry-php icon indicating copy to clipboard operation
opentelemetry-php copied to clipboard

Optimize `baggage` header parsing logic

Open Blacksmoke16 opened this issue 4 years ago • 4 comments

Current implementation works, but could be updated to be more performant/efficient.

Originally posted by @bobstrecansky in https://github.com/open-telemetry/opentelemetry-php/pull/437#discussion_r721869389

Blacksmoke16 avatar Oct 09 '21 01:10 Blacksmoke16

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 18 '22 09:02 stale[bot]

Hi @bobstrecansky, I would like to work on this one incase you have less bandwidth

amber0612 avatar Aug 11 '22 07:08 amber0612

hi @amber0612 do you still want this one?

brettmc avatar Sep 20 '22 05:09 brettmc

hi @amber0612 do you still want this one?

Sure @brettmc

amber0612 avatar Sep 20 '22 06:09 amber0612

I ran some benchmarks against baggage parsing, it's very fast (~2us per execution when run 10k times) and I couldn't see much room for improvement. It looks like the original implementation was based on Java's, and I think our code is easier to read: https://github.com/open-telemetry/opentelemetry-java/blob/main/api/all/src/main/java/io/opentelemetry/api/baggage/propagation/Parser.java#L45

brettmc avatar Nov 28 '22 05:11 brettmc