Skip to content

Instantly share code, notes, and snippets.

@slrtbtfs
Created November 21, 2019 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slrtbtfs/24a4d92de43ad4ae871714840dab2d76 to your computer and use it in GitHub Desktop.
Save slrtbtfs/24a4d92de43ad4ae871714840dab2d76 to your computer and use it in GitHub Desktop.
Benchmarks for removing parser concurrency
goos: linux
goarch: amd64
pkg: github.com/prometheus/prometheus/promql
BenchmarkParser/a-8 876998 1952 ns/op 256 B/op 4 allocs/op
BenchmarkParser/metric-8 877825 1308 ns/op 256 B/op 4 allocs/op
BenchmarkParser/1-8 348022 3526 ns/op 592 B/op 7 allocs/op
BenchmarkParser/1_>=_bool_1-8 343376 4234 ns/op 592 B/op 7 allocs/op
BenchmarkParser/1_+_2/(3*1)-8 252307 5212 ns/op 592 B/op 7 allocs/op
BenchmarkParser/foo_or_bar-8 295990 3827 ns/op 672 B/op 10 allocs/op
BenchmarkParser/foo_and_bar_unless_baz_or_qux-8 108090 10518 ns/op 688 B/op 10 allocs/op
BenchmarkParser/bar_+_on(foo)_bla_/_on(baz,_buz)_group_right(test)_blub-8 147235 8275 ns/op 688 B/op 10 allocs/op
BenchmarkParser/foo_/_ignoring(test,blub)_group_left(blub)_bar-8 196173 6972 ns/op 688 B/op 10 allocs/op
BenchmarkParser/foo_-_ignoring(test,blub)_group_right(bar,foo)_bar-8 150034 7572 ns/op 688 B/op 10 allocs/op
BenchmarkParser/foo{a="b",_foo!="bar",_test=~"test",_bar!~"baz"}-8 143658 16003 ns/op 704 B/op 13 allocs/op
BenchmarkParser/min_over_time(rate(foo{bar="baz"}[2s])[5m:])[4m:3s]-8 62676 17052 ns/op 688 B/op 10 allocs/op
BenchmarkParser/sum_without(and,_by,_avg,_count,_alert,_annotations)(some_metric)_[30m:10s]-8 99964 13018 ns/op 592 B/op 7 allocs/op
BenchmarkParser/(_(should_fail)-8 247758 4561 ns/op 624 B/op 8 allocs/op
BenchmarkParser/}_(should_fail)-8 261322 5366 ns/op 628 B/op 9 allocs/op
BenchmarkParser/1_or_1_(should_fail)-8 276622 4256 ns/op 592 B/op 7 allocs/op
BenchmarkParser/1_or_on(bar)_foo_(should_fail)-8 227551 4820 ns/op 592 B/op 7 allocs/op
BenchmarkParser/foo_unless_on(bar)_group_left(baz)_bar_(should_fail)-8 182618 6617 ns/op 688 B/op 10 allocs/op
BenchmarkParser/test[5d]_OFFSET_10s_[10m:5s]_(should_fail)-8 177471 6739 ns/op 696 B/op 11 allocs/op
PASS
ok github.com/prometheus/prometheus/promql 29.775s
goos: linux
goarch: amd64
pkg: github.com/prometheus/prometheus/promql
BenchmarkParser/a-8 2916598 469 ns/op 240 B/op 5 allocs/op
BenchmarkParser/metric-8 2667409 445 ns/op 240 B/op 5 allocs/op
BenchmarkParser/1-8 764242 1586 ns/op 544 B/op 7 allocs/op
BenchmarkParser/1_>=_bool_1-8 685143 1853 ns/op 544 B/op 7 allocs/op
BenchmarkParser/1_+_2/(3*1)-8 748627 1635 ns/op 544 B/op 7 allocs/op
BenchmarkParser/foo_or_bar-8 522926 2024 ns/op 656 B/op 11 allocs/op
BenchmarkParser/foo_and_bar_unless_baz_or_qux-8 530834 2382 ns/op 672 B/op 11 allocs/op
BenchmarkParser/bar_+_on(foo)_bla_/_on(baz,_buz)_group_right(test)_blub-8 536006 2197 ns/op 672 B/op 11 allocs/op
BenchmarkParser/foo_/_ignoring(test,blub)_group_left(blub)_bar-8 515916 2181 ns/op 672 B/op 11 allocs/op
BenchmarkParser/foo_-_ignoring(test,blub)_group_right(bar,foo)_bar-8 533240 2607 ns/op 672 B/op 11 allocs/op
BenchmarkParser/foo{a="b",_foo!="bar",_test=~"test",_bar!~"baz"}-8 334815 3457 ns/op 880 B/op 20 allocs/op
BenchmarkParser/min_over_time(rate(foo{bar="baz"}[2s])[5m:])[4m:3s]-8 506728 2317 ns/op 672 B/op 11 allocs/op
BenchmarkParser/sum_without(and,_by,_avg,_count,_alert,_annotations)(some_metric)_[30m:10s]-8 719946 1678 ns/op 544 B/op 7 allocs/op
BenchmarkParser/(_(should_fail)-8 618573 1913 ns/op 544 B/op 7 allocs/op
BenchmarkParser/}_(should_fail)-8 697624 1718 ns/op 580 B/op 9 allocs/op
BenchmarkParser/1_or_1_(should_fail)-8 700022 1692 ns/op 544 B/op 7 allocs/op
BenchmarkParser/1_or_on(bar)_foo_(should_fail)-8 595244 1997 ns/op 544 B/op 7 allocs/op
BenchmarkParser/foo_unless_on(bar)_group_left(baz)_bar_(should_fail)-8 504351 2376 ns/op 672 B/op 11 allocs/op
BenchmarkParser/test[5d]_OFFSET_10s_[10m:5s]_(should_fail)-8 560629 2197 ns/op 672 B/op 11 allocs/op
PASS
ok github.com/prometheus/prometheus/promql 30.849s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment