Skip to content

feat: cache default() result with OnceLock#8

Merged
DaniPopes merged 1 commit intomainfrom
dani/cache-default
Feb 1, 2026
Merged

feat: cache default() result with OnceLock#8
DaniPopes merged 1 commit intomainfrom
dani/cache-default

Conversation

@DaniPopes
Copy link
Copy Markdown
Member

Caches the result of default() in a static OnceLock, returning a partial clone on subsequent calls. This avoids re-registering metrics when default() is called multiple times.

The _partial_clone method clones metric fields but defaults skipped fields.

Base automatically changed from dani/refactor-for-loop to main February 1, 2026 17:35
@DaniPopes DaniPopes merged commit 3390905 into main Feb 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant