You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: use shallow dup instead of deep_dup for Scope and BreadcrumbBuffer
⚠️ Needs closer review — changes copy semantics for scope containers.
Replace deep_dup with dup for Scope's contexts, extra, tags, user, and
fingerprint hashes, and for BreadcrumbBuffer's buffer array.
Rationale: These containers are not mutated in-place after duplication.
Scope methods like set_tags, set_extras, set_user all use assignment
(replacing the entire hash) or merge! on the copy's own hash. The inner
values (strings, numbers, symbols) are immutable or treated as such.
BreadcrumbBuffer: Individual Breadcrumb objects in the buffer are not
mutated after being recorded — they are only read during serialization.
A shallow dup of the buffer array is sufficient to prevent the copy
from seeing new breadcrumbs added to the original.
span, session, and propagation_context still use deep_dup as they
contain mutable nested state that may be modified in-place.
0 commit comments