VictoriaMetrics/app/vmselect/promql
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
..
active_queries.go app/vmselect: show X-Forwarded-For contents on /api/v1/status/active_queries page 2020-07-31 20:05:18 +03:00
aggr.go app/vmselect/promql: preserve the order of time series passed to limit_offset() function 2021-12-12 18:04:58 +02:00
aggr_incremental.go app/vmselect/promql: return empty values from group() if all the time series have no values at the given timestamp 2020-07-28 13:40:11 +03:00
aggr_incremental_test.go all: use %w instead of %s for wrapping errors in fmt.Errorf 2020-06-30 23:05:11 +03:00
aggr_test.go app/vmselect/promql: add mode() aggregate function 2020-07-20 15:31:20 +03:00
binary_op.go app/vmselect/promql: add atan2 binary operator, which is going to be added in Prometheus 2.31 2021-10-11 21:15:53 +03:00
eval.go app/vmselect/promql: properly keep metric names when optimized path is used for aggregate function calculations 2022-01-17 15:30:30 +02:00
exec.go app/vmselect/promql: add topk_last and bottomk_last functions 2021-09-30 13:22:52 +03:00
exec_test.go app/vmselect/promql: properly keep metric names when optimized path is used for aggregate function calculations 2022-01-17 15:30:30 +02:00
memory_limiter.go app/vmselect/promql: use dynamic limit on memory for concurrent queries 2019-06-12 23:18:44 +03:00
memory_limiter_test.go app/vmselect/promql: use dynamic limit on memory for concurrent queries 2019-06-12 23:18:44 +03:00
parser.go app/vmselect: accept optional extra_filters[] query args for all the supported Prometheus querying APIs 2021-12-06 17:07:09 +02:00
rollup.go app/vmselect/promql: implement keep_metric_names modifier for transform and rollup functions 2022-01-14 04:14:59 +02:00
rollup_result_cache.go app/vmselect: accept optional extra_filters[] query args for all the supported Prometheus querying APIs 2021-12-06 17:07:09 +02:00
rollup_result_cache_test.go lib/metricsql: move it to a separate repository - github.com/VictoriaMetrics/metrics 2020-04-28 15:28:22 +03:00
rollup_test.go app/vmselect/promql: add stale_samples_over_time() function 2022-01-14 01:48:04 +02:00
rollup_timing_test.go all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
timeseries.go lib/bytesutil: split Resize() into ResizeNoCopy() and ResizeWithCopy() functions 2022-01-25 15:24:44 +02:00
timeseries_test.go app/vmselect/promql: store compressed results in the cache 2019-08-14 02:29:45 +03:00
transform.go app/vmselect/promql: implement keep_metric_names modifier for transform and rollup functions 2022-01-14 04:14:59 +02:00
tzdata.go all: add go:build lines for Go1.17 2021-07-26 15:48:21 +03:00