VictoriaMetrics/lib
Aliaksandr Valialkin 8a0dfc6220 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 this.

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.

As you can see, VictoriaMetrics outperforms Prometheus by more than 100x in almost all the test cases of this benchmark.

Prometheus was using 3.5GB of RAM during the benchmark, while VictoriaMetrics was using 400MB of RAM.
2019-11-18 18:45:06 +02:00
..
backup fix misspelled words (#229) 2019-11-12 00:16:42 +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:54:46 +02:00
decimal lib/{decimal,encoding}: optimize float64<->decimal conversion for arrays with zeros or ones 2019-11-01 16:48:12 +02:00
encoding lib/{decimal,encoding}: optimize float64<->decimal conversion for arrays with zeros or ones 2019-11-01 16:48:12 +02:00
fastnum fix misspelled words (#229) 2019-11-12 00:16:42 +02:00
filestream app/{vmbackup,vmrestore}: add vmbackup and vmrestore tools for creating backups on s3 or gcs from instant snapshots 2019-11-08 21:21:07 +02:00
fs Revert "lib/fs: do not postpone directory removal on NFS error" 2019-11-12 16:18:09 +02:00
httpserver all: return 503 http error if service is temporarily unavailable 2019-08-23 09:55:07 +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 00:50:48 +03:00
mergeset lib/{storage,mergeset}: create missing partition directories after restoring from backups 2019-11-02 02:27:11 +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:23:23 +03:00
procutil lib/procutil: typo fix in comment to WaitForSigterm 2019-06-04 17:31:47 +03:00
prompb lib/prompb: removed outdated README.md 2019-10-14 22:12:57 +03:00
storage lib/storage: add BenchmarkHeadPostingForMatchers similar to the benchmark from Prometheus 2019-11-18 18:45:06 +02:00
syncwg all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
timerpool lib/timerpool: use timer pool in concurrency limiters 2019-05-28 17:20:10 +03:00
uint64set lib/storage: return back inmemory inverted index for recent hour 2019-11-13 13:11:04 +02:00
workingsetcache lib/workingsetcache: remove data race when resetting c.misses 2019-09-22 19:36:49 +03:00