metrics icon indicating copy to clipboard operation
metrics copied to clipboard

Use SSO in `SharedString`

Open loyd opened this issue 3 years ago • 1 comments

Shouldn't name/labels use SmartString inside? Almost all dynamic label values in my production fit in 23 bytes. Also, values of u64 also fit in 23 bytes. IPv4+port also fits into 23 bytes.

metrics already have custom Cow implementation, what about altering the Owned type to SmartString?

loyd avatar Feb 15 '22 06:02 loyd

I've never gotten around to benchmarking it, but I wouldn't be against such a change since it does seem likely to provide a benefit in cases of short strings.

tobz avatar Feb 15 '22 15:02 tobz