rust-prometheus icon indicating copy to clipboard operation
rust-prometheus copied to clipboard

Consider replacing most owned data with a `Cow<'static, _>` where it is plausible to carry static data

Open nagisa opened this issue 4 years ago • 1 comments

Currently a large number of APIs deal directly with owned strings, however in my experience most APIs deal with data that is most likely static: labels & sometimes their values, histogram buckets, namespaces, registry prefixes, etc.

Prometheus could internally use Cow<'static, str> instead of String and Cow<'static, [_]> instead of Vec<_> lowering the memory overhead of prometheus metrics and registries.

nagisa avatar Oct 02 '19 14:10 nagisa