-
Notifications
You must be signed in to change notification settings - Fork 36
Enable struct Spans with reference semantics; optimal NoopSpan #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Rationale: since passing around any SpanProtocol a lot looked terrible; Also, less breakage in protocol renaming
51927c5
to
2240874
Compare
@@ -47,7 +47,7 @@ public struct NoOpTracer: LegacyTracerProtocol { | |||
// no-op | |||
} | |||
|
|||
public final class NoOpSpan: SpanProtocol { | |||
public struct NoOpSpan: Span { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic.
@@ -57,7 +57,7 @@ public struct NoOpTracer: LegacyTracerProtocol { | |||
get { | |||
"noop" | |||
} | |||
set { | |||
nonmutating set { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"whoa whoa whoa" this saved the day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
2240874
to
b4d9954
Compare
I believe we need some "Swift Protocol Design Guidelines" that’s going to save us from naming🤣 |
b4d9954
to
b522350
Compare
**Motivation:** We want a noop span to be NOT ref counted. **Modifications:** Allow spans to be value types through they must have reference semantics **Result:** Efficient noop spans
b522350
to
f43657a
Compare
Yeah the protocol naming is rough when one uses |
For a dumb benchmark like this:
Would be actually fun to hook the refcount funcs as well, so we could see reduction in refcounts explicitly. |
Talked with @fabianfett, I believe we're happy here 👍 |
Enable struct Spans with reference semantics; optimal NoopSpan - as per @fabianfett's request recently
Motivation:
We want a noop span to be NOT ref counted.
Modifications:
Allow spans to be value types through they must have reference semantics
Result:
Efficient noop spans
Also,
Span
as the protocol name again