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 custom comparison for rule matching #30

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 with existing match

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 custom match:

BenchmarkScorecard-4                     1000000              2107 ns/op
BenchmarkScorecardGenerate-4               30000             48146 ns/op
BenchmarkProdDataSetWithRelease-4           2000           1190656 ns/op
BenchmarkProdDataSetWithoutRelease-4        2000            758932 ns/op