Skip to content

opentelemetry-instrumentation-urllib3: remove multiple calls to sanitize_method#4718

Open
codeboten wants to merge 3 commits into
open-telemetry:mainfrom
codeboten:codeboten/urllib-sanitize
Open

opentelemetry-instrumentation-urllib3: remove multiple calls to sanitize_method#4718
codeboten wants to merge 3 commits into
open-telemetry:mainfrom
codeboten:codeboten/urllib-sanitize

Conversation

@codeboten

@codeboten codeboten commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

Instead call the method once and pass the results in where needed

Type of change

Please delete options that are not relevant.

  • Small improvement

How Has This Been Tested?

Ran some benchmarks, the results where:

Metric Before (multiple calls to sanitize_method) After (1×) Delta
Min 145.6 µs 147.3 µs +1.2 µs
Median 157.0 µs 156.2 µs −0.8 µs
Mean 170.1 µs 160.6 µs −9.5 µs (−5.6%)
StdDev 106.5 µs 20.2 µs −81% tighter
OPS 5,879/s 6,227/s +5.9%
  • Added benchmark

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Benchmarks have been added

…ize_method

Instead call the method once and pass the results in where needed

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@codeboten codeboten requested a review from a team as a code owner June 18, 2026 22:05
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant