dropbox / load_management

This repository contains Go utilities for managing isolation and improving reliability of multi-tenant systems.
Apache License 2.0
54 stars 15 forks source link

Use regex for rule matching #28

Closed mehant closed 4 years ago

mehant commented 4 years ago

Updated scorecard implementation to compile a regex expression when a new scorecard is initialized. This expression is used to perform the matching of rules with tags as opposed to glob matching via path.Match()

Benchmark results without regex

BenchmarkScorecard-4                      500000              2539 ns/op
BenchmarkScorecardGenerate-4               30000             47088 ns/op
BenchmarkProdDataSetWithRelease-4           1000           2118143 ns/op
BenchmarkProdDataSetWithoutRelease-4        1000           1201993 ns/op

Benchmark results with regex:

BenchmarkScorecard-4                      500000          3462 ns/op
BenchmarkScorecardGenerate-4               30000         47166 ns/op
BenchmarkProdDataSetWithRelease-4           1000       1504129 ns/op
BenchmarkProdDataSetWithoutRelease-4        2000        903693 ns/op