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
feat(subscriber): spill callsites into hash set (#97)
This changes the `Callsites` behavior when the array of callsites is
full. Currently, we panic in this case. This means that we are quite
generous with array sizes, for cases where, e.g., multiple async
runtimes are in use. However, being more generous with the array's
length makes the linear search performance worse.
This branch replaces the panicking behavior with a spillover behavior.
Once the array of callsites is full, we will now store any additional
callsites in a `HashSet`, rather than panicking. This means we can make
the arrays a bit shorter, and (perhaps more importantly) it means we
will no longer panic in the (rare) case where an app contains a big pile
of interesting callsites.
The spillover `HashSet` is protected by a `RwLock`, which is kind of
a bummer, since it may be locked when checking if a span/event is
in the set of callsites we care about (but only if we have spilled over).
However, it should be _contended_ only very rarely, since writes only
occur when registering a new callsite.
I added an optional `parking_lot` feature to use `parking_lot`'s
`RwLock` implementation, which likely offers better performance than
`std`'s lock (especially when uncontended, which this lock often is).
The feature is disabled by default, for users who don't want the
additional dependency.
Signed-off-by: Eliza Weisman <[email protected]>
0 commit comments