VictoriaMetrics/lib
Aliaksandr Valialkin 6f61fd367a lib/storage: add BenchmarkHeadPostingForMatchers similar to the benchmark from Prometheus
See the corresponding benchmark in Prometheus - 23c0299d85/tsdb/head_bench_test.go (L52)

The benchmark allows performing apples-to-apples comparison of time series search
in Prometheus and VictoriaMetrics. The following article - https://www.robustperception.io/evaluating-performance-and-correctness -
contains incorrect numbers for VictoriaMetrics, since there wasn't this benchmark yet. Fix it.

Benchmarks can be repeated with the following commands from Prometheus and VictoriaMetrics source code roots:

- Prometheus: GOMAXPROCS=1 go test ./tsdb/ -run=111 -bench=BenchmarkHeadPostingForMatchers
- VictoriaMetrics: GOMAXPROCS=1 go test ./lib/storage/ -run=111 -bench=BenchmarkHeadPostingForMatchers

Benchmark results:
benchmark                                                          old ns/op      new ns/op     delta
BenchmarkHeadPostingForMatchers/n="1"                              272756688      364977        -99.87%
BenchmarkHeadPostingForMatchers/n="1",j="foo"                      138132923      1181636       -99.14%
BenchmarkHeadPostingForMatchers/j="foo",n="1"                      134723762      1141578       -99.15%
BenchmarkHeadPostingForMatchers/n="1",j!="foo"                     195823953      1148056       -99.41%
BenchmarkHeadPostingForMatchers/i=~".*"                            7962582919     8716755       -99.89%
BenchmarkHeadPostingForMatchers/i=~".+"                            7589543864     12096587      -99.84%
BenchmarkHeadPostingForMatchers/i=~""                              1142371741     16164560      -98.59%
BenchmarkHeadPostingForMatchers/i!=""                              9964150263     12230021      -99.88%
BenchmarkHeadPostingForMatchers/n="1",i=~".*",j="foo"              216995884      1173476       -99.46%
BenchmarkHeadPostingForMatchers/n="1",i=~".*",i!="2",j="foo"       202541348      1299743       -99.36%
BenchmarkHeadPostingForMatchers/n="1",i!=""                        486285711      11555193      -97.62%
BenchmarkHeadPostingForMatchers/n="1",i!="",j="foo"                350776931      5607506       -98.40%
BenchmarkHeadPostingForMatchers/n="1",i=~".+",j="foo"              380888565      6380335       -98.32%
BenchmarkHeadPostingForMatchers/n="1",i=~"1.+",j="foo"             89500296       2078970       -97.68%
BenchmarkHeadPostingForMatchers/n="1",i=~".+",i!="2",j="foo"       379529654      6561368       -98.27%
BenchmarkHeadPostingForMatchers/n="1",i=~".+",i!~"2.*",j="foo"     424563825      6757132       -98.41%

The first column (old) is for Prometheus, the second column (new) is for VictoriaMetrics.

Prometheus was using 3.5GB of RAM during the benchmark, while VictoriaMetrics was using 400MB of RAM.
2019-11-18 18:47:02 +02:00
..
auth all: open-sourcing cluster version 2019-05-23 00:25:38 +03:00
backup fix misspelled words (#229) 2019-11-12 00:18:24 +02:00
buildinfo all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
bytesutil add unittests for bytesutil and storage (#221) 2019-11-04 00:57:24 +02:00
consts all: open-sourcing cluster version 2019-05-23 00:25:38 +03:00
decimal lib/{decimal,encoding}: optimize float64<->decimal conversion for arrays with zeros or ones 2019-11-01 16:46:08 +02:00
encoding lib/{decimal,encoding}: optimize float64<->decimal conversion for arrays with zeros or ones 2019-11-01 16:46:08 +02:00
fastnum fix misspelled words (#229) 2019-11-12 00:18:24 +02:00
filestream app/{vmbackup,vmrestore}: add vmbackup and vmrestore tools for creating backups on s3 or gcs from instant snapshots 2019-11-07 21:26:43 +02:00
flagutil lib/flagutil: add NewArray helper func 2019-06-18 10:44:09 +03:00
fs Revert "lib/fs: do not postpone directory removal on NFS error" 2019-11-12 16:29:50 +02:00
handshake all: report the number of bytes read on io.ReadFull error 2019-09-11 14:50:24 +03:00
httpserver all: return 503 http error if service is temporarily unavailable 2019-08-23 09:49:50 +03:00
logger all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
memory lib/memory: properly handle int overflow in sysTotalMemory 2019-10-17 18:27:49 +03:00
mergeset lib/{storage,mergeset}: create missing partition directories after restoring from backups 2019-11-02 02:27:19 +02:00
netutil all: add support for GOARCH=386 and fix all the issues related to 32-bit architectures such as GOARCH=arm 2019-10-17 18:27:49 +03:00
procutil lib/procutil: typo fix in comment to WaitForSigterm 2019-06-03 16:54:37 +03:00
prompb lib/prompb: removed outdated README.md 2019-10-14 22:16:36 +03:00
storage lib/storage: add BenchmarkHeadPostingForMatchers similar to the benchmark from Prometheus 2019-11-18 18:47:02 +02:00
syncwg all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
tenantmetrics app/vminsert: split vm_rows_inserted_total into per-(accountID, projectID) metrics 2019-06-07 22:11:20 +03:00
timerpool lib/timerpool: use timer pool in concurrency limiters 2019-05-28 17:30:10 +03:00
uint64set lib/storage: fix inmemory inverted index issues found in v1.29 2019-11-13 13:35:38 +02:00
workingsetcache lib/workingsetcache: remove data race when resetting c.misses 2019-09-22 19:37:09 +03:00