|
|
@ -114,6 +114,7 @@ func benchmarkPostingsForMatchers(b *testing.B, ir IndexReader) {
|
|
|
|
iCharSet := labels.MustNewMatcher(labels.MatchRegexp, "i", "1[0-9]")
|
|
|
|
iCharSet := labels.MustNewMatcher(labels.MatchRegexp, "i", "1[0-9]")
|
|
|
|
iAlternate := labels.MustNewMatcher(labels.MatchRegexp, "i", "(1|2|3|4|5|6|20|55)")
|
|
|
|
iAlternate := labels.MustNewMatcher(labels.MatchRegexp, "i", "(1|2|3|4|5|6|20|55)")
|
|
|
|
iXYZ := labels.MustNewMatcher(labels.MatchRegexp, "i", "X|Y|Z")
|
|
|
|
iXYZ := labels.MustNewMatcher(labels.MatchRegexp, "i", "X|Y|Z")
|
|
|
|
|
|
|
|
iNotXYZ := labels.MustNewMatcher(labels.MatchNotRegexp, "i", "X|Y|Z")
|
|
|
|
cases := []struct {
|
|
|
|
cases := []struct {
|
|
|
|
name string
|
|
|
|
name string
|
|
|
|
matchers []*labels.Matcher
|
|
|
|
matchers []*labels.Matcher
|
|
|
@ -131,6 +132,7 @@ func benchmarkPostingsForMatchers(b *testing.B, ir IndexReader) {
|
|
|
|
{`j=~"X.+"`, []*labels.Matcher{jXplus}},
|
|
|
|
{`j=~"X.+"`, []*labels.Matcher{jXplus}},
|
|
|
|
{`i=~"(1|2|3|4|5|6|20|55)"`, []*labels.Matcher{iAlternate}},
|
|
|
|
{`i=~"(1|2|3|4|5|6|20|55)"`, []*labels.Matcher{iAlternate}},
|
|
|
|
{`i=~"X|Y|Z"`, []*labels.Matcher{iXYZ}},
|
|
|
|
{`i=~"X|Y|Z"`, []*labels.Matcher{iXYZ}},
|
|
|
|
|
|
|
|
{`i!~"X|Y|Z"`, []*labels.Matcher{iNotXYZ}},
|
|
|
|
{`i=~".*"`, []*labels.Matcher{iStar}},
|
|
|
|
{`i=~".*"`, []*labels.Matcher{iStar}},
|
|
|
|
{`i=~"1.*"`, []*labels.Matcher{i1Star}},
|
|
|
|
{`i=~"1.*"`, []*labels.Matcher{i1Star}},
|
|
|
|
{`i=~".*1"`, []*labels.Matcher{iStar1}},
|
|
|
|
{`i=~".*1"`, []*labels.Matcher{iStar1}},
|
|
|
@ -146,6 +148,7 @@ func benchmarkPostingsForMatchers(b *testing.B, ir IndexReader) {
|
|
|
|
{`n="1",i!="",j=~"X.+"`, []*labels.Matcher{n1, iNotEmpty, jXplus}},
|
|
|
|
{`n="1",i!="",j=~"X.+"`, []*labels.Matcher{n1, iNotEmpty, jXplus}},
|
|
|
|
{`n="1",i!="",j=~"XXX|YYY"`, []*labels.Matcher{n1, iNotEmpty, jXXXYYY}},
|
|
|
|
{`n="1",i!="",j=~"XXX|YYY"`, []*labels.Matcher{n1, iNotEmpty, jXXXYYY}},
|
|
|
|
{`n="1",i=~"X|Y|Z",j="foo"`, []*labels.Matcher{n1, iXYZ, jFoo}},
|
|
|
|
{`n="1",i=~"X|Y|Z",j="foo"`, []*labels.Matcher{n1, iXYZ, jFoo}},
|
|
|
|
|
|
|
|
{`n="1",i!~"X|Y|Z",j="foo"`, []*labels.Matcher{n1, iNotXYZ, jFoo}},
|
|
|
|
{`n="1",i=~".+",j="foo"`, []*labels.Matcher{n1, iPlus, jFoo}},
|
|
|
|
{`n="1",i=~".+",j="foo"`, []*labels.Matcher{n1, iPlus, jFoo}},
|
|
|
|
{`n="1",i=~"1.+",j="foo"`, []*labels.Matcher{n1, i1Plus, jFoo}},
|
|
|
|
{`n="1",i=~"1.+",j="foo"`, []*labels.Matcher{n1, i1Plus, jFoo}},
|
|
|
|
{`n="1",i=~".*1.*",j="foo"`, []*labels.Matcher{n1, iStar1Star, jFoo}},
|
|
|
|
{`n="1",i=~".*1.*",j="foo"`, []*labels.Matcher{n1, iStar1Star, jFoo}},
|
|
|
|