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
{{ message }}
Repository navigation
Cache miss rate in registry due to use of WeakMap.get(Object) #684
The optimization in #549 looks up labels by object.
Map and WeakMap keys that are not strings rely on object identity, so any two Metrics with the same labels will hit different keys, resulting in more eviction of old values, which could easily happen with count and sum metrics.
The tendency to make defensive copies of data structures in the code is likely exacerbating this miss rate.
It may be best to pull this code out, fix the issue, and then use the exact same code for util.hashObject()
Activity
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
jdmarshall commentedon Jul 11, 2025
This code only fires for histogram buckets, so should be fine, if a bit memory-intensive.
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels
Add benchmark for metric constructors, registry w/ no shared labels