Repository navigation
Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-11-01 04:26 UTC Resolve merge conflicts. Two things need attention:
Status above doesn't look right?
|
xrmx
reviewed
Oct 26, 2026
| if resource is None: | ||
| resource = Resource.create({}) | ||
| super().__init__( | ||
| name=name, |
Contributor
There was a problem hiding this comment.
Can we quantify how the named arguments contribute to this? Not a fan on making things less readable.
Contributor
Author
There was a problem hiding this comment.
IIRC it does result in a >10% speedup for Span creation. I'll add benchmarks breaking it down. I agree though, switching to positional args makes it hard to read, if you'd prefer we remove it that's OK with me.
Contributor
Author
Contribution of positional argumentsApple M5 Pro, CPython 3.14.5
|
|
Hi @herin049 — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reduces per-span overhead in the SDK hot path. Most performance gains where achieved by reordering branch statements, inlining a few function calls and switching from keyword to positional calling where possible.
Note: There are some very minor/subtle breaking changes with adding
__slots__on some classes (i.e.__dict__goes away onSpanobjects). Likewise, the bounded attributes change does switch the default fromNonetosys.maxsize, but this one is extremely unlikely to break any existing code. If we're concerned about the__slots__changes, we can remove this from the PR.Type of change
Please delete options that are not relevant.
Benchmarks (MacBook M5, CPython 3.14)
opentelemetry-sdk/benchmarks/trace/test_benchmark_trace.pystart_span_with_attributes[0]start_span_with_attributes[1]start_span_with_attributes[10]start_span_with_attributes[50]start_span_with_attributes[128]simple_start_spansimple_start_as_current_spanset_attribute[10]read_events[10]set_attribute_types[str]set_attribute_types[seq_int]Per span, memory drops by 56 B: the span object goes from 344 B to 224 B, and
SpanContextfrom 112 B to 96 B.Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
tox -e precommittox -e typecheck