Skip to content

ref(metrics): Change bucket name to Arc<str>#3279

Merged
Dav1dde merged 2 commits intomasterfrom
dav1d/ref/bucket-arc
Mar 18, 2024
Merged

ref(metrics): Change bucket name to Arc<str>#3279
Dav1dde merged 2 commits intomasterfrom
dav1d/ref/bucket-arc

Conversation

@Dav1dde
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde commented Mar 18, 2024

The bucket name is immutable and in serveral places it is being cloned. Instead of using a String and pruning the capacity (which wasn't always done) we can instead use an immutable variant which allows for cheap clones instead.

In a follow-up we can replace metrics created by Relay with a single Arc instance instead of creating the mri everytime.

#skip-changelog

@Dav1dde Dav1dde requested a review from a team as a code owner March 18, 2024 14:13
@Dav1dde Dav1dde self-assigned this Mar 18, 2024
Comment on lines -667 to -668
// do this so cost tracking still works accurately.
metric_name.shrink_to_fit();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Dav1dde Dav1dde merged commit 2f49cfe into master Mar 18, 2024
@Dav1dde Dav1dde deleted the dav1d/ref/bucket-arc branch March 18, 2024 15:44
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.

2 participants