VictoriaMetrics/lib/protoparser
Aliaksandr Valialkin f4989edd96
lib/bytesutil: split Resize() into ResizeNoCopy() and ResizeWithCopy() functions
Previously bytesutil.Resize() was copying the original byte slice contents to a newly allocated slice.
This wasted CPU cycles and memory bandwidth in some places, where the original slice contents wasn't needed
after slize resizing. Switch such places to bytesutil.ResizeNoCopy().

Rename the original bytesutil.Resize() function to bytesutil.ResizeWithCopy() for the sake of improved readability.

Additionally, allocate new slice with `make()` instead of `append()`. This guarantees that the capacity of the allocated slice
exactly matches the requested size. The `append()` could return a slice with bigger capacity as an optimization for further `append()` calls.
This could result in excess memory usage when the returned byte slice was cached (for instance, in lib/blockcache).

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2007
2022-01-25 15:24:44 +02:00
..
common lib/bytesutil: split Resize() into ResizeNoCopy() and ResizeWithCopy() functions 2022-01-25 15:24:44 +02:00
csvimport lib/protoparser: stop reading the input stream as soon as the callback provided by the caller returns error 2021-06-14 15:18:49 +03:00
datadog app/{vminsert,vmagent}: add ability to ingest data via DataDog "submit metrics" API 2021-09-29 00:13:08 +03:00
graphite lib/protoparser/graphite: allow multiple separators between metric name, value and timestamp 2021-12-02 13:43:49 +02:00
influx lib/protoparser/influx: automatically detect timestamp precision depending on the number of decimal digits in the timestamp 2021-10-28 12:47:22 +03:00
native lib/bytesutil: split Resize() into ResizeNoCopy() and ResizeWithCopy() functions 2022-01-25 15:24:44 +02:00
opentsdb lib/protoparser/opentsdb: follow-up after 8ee75ca45a 2021-08-29 11:49:21 +03:00
opentsdbhttp all: properly handle CPU limits set on the host system/container 2020-12-08 21:07:29 +02:00
prometheus lib/protoparser/prometheus: follow-up for 8e338632a3 2021-11-30 00:50:11 +02:00
promremotewrite changes protoparser apis for accepting reading from io.Reader (#1624) 2021-09-20 14:49:28 +03:00
vmimport changes protoparser apis for accepting reading from io.Reader (#1624) 2021-09-20 14:49:28 +03:00