2 ms·
WriteRequest::timeseries is a vector (https://github.com/prometheus/prometheus/blob/main/prompb/remote.proto#L23 https://github.com/prometheus/prometheus/blob/m
by v0y4g3r 2y ago
WriteRequest::timeseries is a vector (https://github.com/prometheus/prometheus/blob/main/prompb/remote.proto#L23 https://github.com/prometheus/prometheus/blob/main/prompb/re...) and
the repeated file `Timeseries::labels` and `Timeseries::samples` are reused across different timeseries. You don't have to alloc a new vector for the lables and samples for each new timeseries instance.
- K0nserv 2y agoThat would be true if you used `Vec::clear` too, it doesn't allocate a new vector. My point was that you still end up running Drop implementations with RepeatedField<T>, just not all at once. See https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=75621151b0a3e81da16741a24f8f9e96 https://play.rust-lang.org/?version=stable&mode=debug&editio...