improve netProtocol performance for well-known protocols#6845
Conversation
f6b24b1 to
8a07f21
Compare
|
Could you share benchmarks showing the actual impact of this change? |
8a07f21 to
2074e6f
Compare
|
@dmathieu please see below. Benchstat from Main branch (89cbae1) PR (2074e6f) |
We have some "Improve performance" changelog entries. |
Yes but these always mention public packages not internals and a previous PR for opentelemetry-go it was mentioned not to mention the private packages, |
|
Changelog entries focus on user-facing changes. Hence that comment in otel-go, where the entry showed changed in private methods and had to be changed to show the impact for end-users. Mentioning that performance (and allocations) have been improved would be fine. However, the changelog entry shouldn't mention the private package, but every public package it's used in. |
Good day,
While I was review some profiles I noticed that the open-telemetry code was calling
strings.ToLowera bit more then I expected.After some digging I notice that
netProtocolwas called multiple times causingstrings.ToLowerto be called multiple times.Now for our application 99.9% of all requests are
HTTP/1.1(and I expect this is the same for many others) so instead of callingstrings.ToLowerevery-timenetProtocolnow checks some well known protocols first.Let me know what you think and thanks for reviewing this PR 😄
P.S. sorry for not updating the changelog but I honestly have no idea how to document this change as it's internal.