StringMatchingOr

com.netflix.atlas.core.util.StringMatchingOr

Regex OR queries have terrible performance. In many cases these can be rewritten to a set of startsWith or indexOf patterns in the string matcher. On some of the real data and queries this was up to 20 times faster. For the quick sample data in this benchmark it is 8 to 15 times faster.

> run -wi 10 -i 10 -f1 -t1 .*StringMatchingOr.*
[info] Benchmark                              Mode  Cnt    Score    Error  Units
[info] StringMatchingOr.testOrMatcher08      thrpt   10  953.969 ± 57.275  ops/s
[info] StringMatchingOr.testOrMatcher32      thrpt   10  437.536 ± 32.653  ops/s
[info] StringMatchingOr.testRegex08          thrpt   10  117.730 ± 18.946  ops/s
[info] StringMatchingOr.testRegex32          thrpt   10   29.162 ±  1.151  ops/s

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def testOrMatcher08(bh: Blackhole): Unit
def testOrMatcher32(bh: Blackhole): Unit
def testRegex08(bh: Blackhole): Unit
def testRegex32(bh: Blackhole): Unit