Replies: 1 comment
-
I think it was more than it needed to be! @hawkw just landed a PR (#1974) that reduced the overhead of spans without subscribers between 50-70%. To answer questions:
Yes, there's some overhead in that case. The compile-time filters might help reduce overhead, though.
I'm not entirely sure. I'll defer to Eliza on that point.
I'll take a look! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context: I'm working on SWC (https://github.com/swc-project/swc) to enable tracing support. I've added initial spans via
#[instrument]
macro with few manual spans - can be found at https://github.com/swc-project/swc/pull/3911/files - and it seems like creating non-negligible runtime overhead on some local number comparison between current TOT of master : swc-project/swc#3911 (comment)Roughly, number may vary but worst cast > 20%. In the test above,
test parser
is a base we can sure those 2 sets ran under similar considiton asparser
does not have any tracing at the moment.I was under assumption having span will create some runtime overhead but it's generally within acceptable threshold unless there's actual subscriber is running. All of those results are coming from test set doesn't have any subscribers though. There maybe following q, as an initial question
#[swc_trace]
macro which appends#[instrument]
for the fn for specific impl. (https://github.com/swc-project/swc/blob/main/crates%2Fswc_trace_macro%2Fsrc%2Flib.rs#L19)Thanks! 🙏
Beta Was this translation helpful? Give feedback.
All reactions