prometheus/model
Bryan Boreham b835d3bdb4 Labels: simpler/faster stringlabels encoding
Instead of using varint to encode the size of each label, use a single
byte for size 0-254, or a flag value of 255 followed by the size in
3 bytes little-endian.

This reduces the amount of code, and also the number of branches in
commonly-executed code, so it runs faster.

The maximum allowed label name or value length is now 2^24 or 16MB.

Memory used by labels changes as follows:
* Labels from 0 to 127 bytes length: same
* From 128 to 254: 1 byte less
* From 255 to 16383: 2 bytes more
* From 16384 to 2MB: 1 byte more
* From 2MB to 16MB: same

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-02-23 15:25:57 +00:00
..
exemplar update links to openmetrics to reference the v1.0.0 release 2024-12-13 21:32:27 +00:00
histogram fix TestCuttingNewHeadChunks/really_large_histograms on 32-bit 2024-12-16 10:45:01 -05:00
labels Labels: simpler/faster stringlabels encoding 2025-02-23 15:25:57 +00:00
metadata Fix: metadata API using wrong field names (#13633) 2024-02-26 09:53:39 +00:00
relabel Addressed comments. 2025-01-27 09:54:13 +00:00
rulefmt rulefmt: support YAML aliases for Alert/Record/Expr (#14957) 2025-02-13 20:48:33 +11:00
textparse chore: enable unused-parameter from revive 2025-02-19 19:50:28 +01:00
timestamp Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
value Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00