elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

Add benchmark for IndexNameExpressionResolver

Open gmarouli opened this issue 3 months ago • 1 comments

Recently we caused a performance regression with https://github.com/elastic/elasticsearch/commit/4c15cc077887d00ecf0e02c39b42cf01874ab6c4.

This commit has been reverted and this commit https://github.com/elastic/elasticsearch/commit/d5265bef572eaa87cc07b861ad00c74f8a955fbf has improved its performance.

In this PR we introduce a small microbenchmark that we hope will shorten the feedback loop during development.

Example of run over 3 different commits on a local machine with a cluster state with 10000 data streams with 1000 backing indices each, and 1000 standalone indices:

Initial state: 057062bcae2                                                                  (resourceMix)  Mode  Cnt      Score      Error  Units
IndexNameExpressionResolverBenchmark.resolveAllStarToConcreteIndices        10000|       1000  avgt   15  10394.024 ± 685.879  ms/op
IndexNameExpressionResolverBenchmark.resolveResourcesListToConcreteIndices  10000|       1000  avgt   15   9370.274 ± 491.076  ms/op

Added wrapper: 4c15cc07788                                                             (resourceMix)  Mode  Cnt      Score      Error  Units
IndexNameExpressionResolverBenchmark.resolveAllStarToConcreteIndices        10000|       1000  avgt   15  10323.434 ± 555.209  ms/op
IndexNameExpressionResolverBenchmark.resolveResourcesListToConcreteIndices  10000|       1000  avgt   15  10836.716 ± 433.244  ms/op

Current: feea0a09b87                                                                      (resourceMix)  Mode  Cnt      Score      Error  Units
IndexNameExpressionResolverBenchmark.resolveAllStarToConcreteIndices        10000|       1000  avgt   15  11130.473 ± 504.111  ms/op
IndexNameExpressionResolverBenchmark.resolveResourcesListToConcreteIndices  10000|       1000  avgt   15   7547.232 ± 530.436  ms/op

gmarouli avatar Oct 30 '24 19:10 gmarouli