Commit 7f09094
authored
perf(traces): Cache valid span statuses in a module-level frozenset (#6208)
The `status` setter on `StreamedSpan` was reconstructing a set from the
`SpanStatus` enum on every invocation. In high-throughput tracing
workloads this is a hot path, so caching the values in a module-level
`frozenset` avoids repeated allocations.
Fixes #6207
Fixes PY-24031 parent d40313b commit 7f09094
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
430 | 433 | | |
431 | 434 | | |
432 | 435 | | |
433 | | - | |
| 436 | + | |
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
| |||
0 commit comments