Repository navigation
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-24 23:27 UTC Review the latest changes. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9033 +/- ##
=========================================
Coverage 90.44% 90.44%
- Complexity 11171 11175 +4
=========================================
Files 1032 1032
Lines 30451 30459 +8
Branches 3974 3975 +1
=========================================
+ Hits 27540 27548 +8
Misses 1935 1935
Partials 976 976 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
On the Benchmark profilesThe profiles are based on 702 distinct
Benchmark resultsA benchmark adapted from
The consistent benefit is lower allocation per export. At median lengths, the cache saved about 950 bytes per request in both formats. At maximum lengths, it saved about 2.8 KB per request. These figures measure bytes allocated per operation with a warm cache; retained heap was not measured. Timing varied across runs... therefore, these results do not demonstrate a consistent latency improvement. |
MetricMarshalercurrently re-encodes metric names, descriptions, and units on every export, allocating new byte arrays for non-empty strings even when the metadata is unchanged.Cache these encodings using the existing
WeakConcurrentMapimplementation. Repeated use of the same string objects reuses their encoded bytes. Weak keys allow unused metadata to be collected, and subsequent cache accesses remove stale entries.Add a focused test verifying that separate marshaler instances reuse the same byte arrays for the name, description, and unit.