Commit 5b6b476
authored
perf(tracer): improve performance of DefaultContextProvider (#14920)
## Description
Two small tweaks to improve the overhead of DefaultContextProvider.
- Replace `isinstance(item, Span) with `type(item) is Span`
- Skip the `isinstance` check because we should only ever have this
exact class and not a subclass
- Remove calls to `Span.finished` which is a computed property
## Testing
<!-- Describe your testing strategy or note what tests are included -->
## Risks
<!-- Note any risks associated with this change, or "None" if no risks
-->
## Additional Notes
<!-- Any other information that would be helpful for reviewers -->1 parent b599d88 commit 5b6b476
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | | - | |
86 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
0 commit comments