Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcontent filter: Add map and builder filter benchmark #81575

Merged
merged 4 commits into from
Dec 14, 2021

Conversation

weizijun
Copy link
Contributor

@weizijun weizijun commented Dec 9, 2021

I add the map and builder in the FilterContentBenchmark. The result show that parser performance is much better than map and builder. Later my colleague and I will commit some PR, that It will replace from map and builder to parser.

In wildcard case, map filter is so slow:

Benchmark                                                  (fieldCount)  (inclusive)         (type)  Mode  Cnt         Score   Error  Units
FilterContentBenchmark.filterWithBuilder              10_wildcard_field         true  cluster_stats  avgt    2    229729.345          ns/op
FilterContentBenchmark.filterWithMap                  10_wildcard_field         true  cluster_stats  avgt    2  29668878.146          ns/op
FilterContentBenchmark.filterWithNewParserConfig      10_wildcard_field         true  cluster_stats  avgt    2    237100.911          ns/op
FilterContentBenchmark.filterWithParserConfigCreated  10_wildcard_field         true  cluster_stats  avgt    2    221254.827          ns/op

and parse filter has a little improvement with builder filter:

Benchmark                                                  (fieldCount)  (inclusive)         (type)  Mode  Cnt         Score   Error  Units
FilterContentBenchmark.filterWithBuilder                       10_field         true  cluster_stats  avgt    2    170686.503          ns/op
FilterContentBenchmark.filterWithMap                           10_field         true  cluster_stats  avgt    2    492973.006          ns/op
FilterContentBenchmark.filterWithNewParserConfig               10_field         true  cluster_stats  avgt    2    142003.739          ns/op
FilterContentBenchmark.filterWithParserConfigCreated           10_field         true  cluster_stats  avgt    2    127459.484          ns/op

Here is the full benchmark result:

Benchmark                                                  (fieldCount)  (inclusive)         (type)  Mode  Cnt         Score   Error  Units
FilterContentBenchmark.filterWithBuilder                       10_field         true  cluster_stats  avgt    2    170686.503          ns/op
FilterContentBenchmark.filterWithBuilder                       10_field         true    index_stats  avgt    2     19893.310          ns/op
FilterContentBenchmark.filterWithBuilder                       10_field         true     node_stats  avgt    2     26955.237          ns/op
FilterContentBenchmark.filterWithBuilder                     half_field         true  cluster_stats  avgt    2    399922.076          ns/op
FilterContentBenchmark.filterWithBuilder                     half_field         true    index_stats  avgt    2     34104.100          ns/op
FilterContentBenchmark.filterWithBuilder                     half_field         true     node_stats  avgt    2     45339.887          ns/op
FilterContentBenchmark.filterWithBuilder                      all_field         true  cluster_stats  avgt    2    541790.127          ns/op
FilterContentBenchmark.filterWithBuilder                      all_field         true    index_stats  avgt    2     50051.251          ns/op
FilterContentBenchmark.filterWithBuilder                      all_field         true     node_stats  avgt    2     66082.753          ns/op
FilterContentBenchmark.filterWithBuilder                 wildcard_field         true  cluster_stats  avgt    2    207682.012          ns/op
FilterContentBenchmark.filterWithBuilder                 wildcard_field         true    index_stats  avgt    2     20100.143          ns/op
FilterContentBenchmark.filterWithBuilder                 wildcard_field         true     node_stats  avgt    2     26076.856          ns/op
FilterContentBenchmark.filterWithBuilder              10_wildcard_field         true  cluster_stats  avgt    2    229729.345          ns/op
FilterContentBenchmark.filterWithBuilder              10_wildcard_field         true    index_stats  avgt    2     28191.823          ns/op
FilterContentBenchmark.filterWithBuilder              10_wildcard_field         true     node_stats  avgt    2     34450.794          ns/op
FilterContentBenchmark.filterWithMap                           10_field         true  cluster_stats  avgt    2    492973.006          ns/op
FilterContentBenchmark.filterWithMap                           10_field         true    index_stats  avgt    2    154447.596          ns/op
FilterContentBenchmark.filterWithMap                           10_field         true     node_stats  avgt    2    181779.656          ns/op
FilterContentBenchmark.filterWithMap                         half_field         true  cluster_stats  avgt    2   2370660.246          ns/op
FilterContentBenchmark.filterWithMap                         half_field         true    index_stats  avgt    2    401988.258          ns/op
FilterContentBenchmark.filterWithMap                         half_field         true     node_stats  avgt    2    483548.818          ns/op
FilterContentBenchmark.filterWithMap                          all_field         true  cluster_stats  avgt    2   3113373.152          ns/op
FilterContentBenchmark.filterWithMap                          all_field         true    index_stats  avgt    2    476683.420          ns/op
FilterContentBenchmark.filterWithMap                          all_field         true     node_stats  avgt    2    652082.500          ns/op
FilterContentBenchmark.filterWithMap                     wildcard_field         true  cluster_stats  avgt    2    459415.604          ns/op
FilterContentBenchmark.filterWithMap                     wildcard_field         true    index_stats  avgt    2     70230.935          ns/op
FilterContentBenchmark.filterWithMap                     wildcard_field         true     node_stats  avgt    2     89341.348          ns/op
FilterContentBenchmark.filterWithMap                  10_wildcard_field         true  cluster_stats  avgt    2  29668878.146          ns/op
FilterContentBenchmark.filterWithMap                  10_wildcard_field         true    index_stats  avgt    2  28205368.190          ns/op
FilterContentBenchmark.filterWithMap                  10_wildcard_field         true     node_stats  avgt    2  29332307.103          ns/op
FilterContentBenchmark.filterWithNewParserConfig               10_field         true  cluster_stats  avgt    2    142003.739          ns/op
FilterContentBenchmark.filterWithNewParserConfig               10_field         true    index_stats  avgt    2     18086.331          ns/op
FilterContentBenchmark.filterWithNewParserConfig               10_field         true     node_stats  avgt    2     23383.744          ns/op
FilterContentBenchmark.filterWithNewParserConfig             half_field         true  cluster_stats  avgt    2    389990.443          ns/op
FilterContentBenchmark.filterWithNewParserConfig             half_field         true    index_stats  avgt    2     34894.318          ns/op
FilterContentBenchmark.filterWithNewParserConfig             half_field         true     node_stats  avgt    2     45604.779          ns/op
FilterContentBenchmark.filterWithNewParserConfig              all_field         true  cluster_stats  avgt    2    549971.331          ns/op
FilterContentBenchmark.filterWithNewParserConfig              all_field         true    index_stats  avgt    2     51233.495          ns/op
FilterContentBenchmark.filterWithNewParserConfig              all_field         true     node_stats  avgt    2     67761.011          ns/op
FilterContentBenchmark.filterWithNewParserConfig         wildcard_field         true  cluster_stats  avgt    2    213109.821          ns/op
FilterContentBenchmark.filterWithNewParserConfig         wildcard_field         true    index_stats  avgt    2     20191.982          ns/op
FilterContentBenchmark.filterWithNewParserConfig         wildcard_field         true     node_stats  avgt    2     25866.681          ns/op
FilterContentBenchmark.filterWithNewParserConfig      10_wildcard_field         true  cluster_stats  avgt    2    237100.911          ns/op
FilterContentBenchmark.filterWithNewParserConfig      10_wildcard_field         true    index_stats  avgt    2     27744.183          ns/op
FilterContentBenchmark.filterWithNewParserConfig      10_wildcard_field         true     node_stats  avgt    2     34841.488          ns/op
FilterContentBenchmark.filterWithParserConfigCreated           10_field         true  cluster_stats  avgt    2    127459.484          ns/op
FilterContentBenchmark.filterWithParserConfigCreated           10_field         true    index_stats  avgt    2     15194.965          ns/op
FilterContentBenchmark.filterWithParserConfigCreated           10_field         true     node_stats  avgt    2     18798.854          ns/op
FilterContentBenchmark.filterWithParserConfigCreated         half_field         true  cluster_stats  avgt    2    238616.088          ns/op
FilterContentBenchmark.filterWithParserConfigCreated         half_field         true    index_stats  avgt    2     20972.354          ns/op
FilterContentBenchmark.filterWithParserConfigCreated         half_field         true     node_stats  avgt    2     28047.925          ns/op
FilterContentBenchmark.filterWithParserConfigCreated          all_field         true  cluster_stats  avgt    2    274096.558          ns/op
FilterContentBenchmark.filterWithParserConfigCreated          all_field         true    index_stats  avgt    2     24948.247          ns/op
FilterContentBenchmark.filterWithParserConfigCreated          all_field         true     node_stats  avgt    2     33163.017          ns/op
FilterContentBenchmark.filterWithParserConfigCreated     wildcard_field         true  cluster_stats  avgt    2    209233.272          ns/op
FilterContentBenchmark.filterWithParserConfigCreated     wildcard_field         true    index_stats  avgt    2     20056.664          ns/op
FilterContentBenchmark.filterWithParserConfigCreated     wildcard_field         true     node_stats  avgt    2     25519.848          ns/op
FilterContentBenchmark.filterWithParserConfigCreated  10_wildcard_field         true  cluster_stats  avgt    2    221254.827          ns/op
FilterContentBenchmark.filterWithParserConfigCreated  10_wildcard_field         true    index_stats  avgt    2     24113.686          ns/op
FilterContentBenchmark.filterWithParserConfigCreated  10_wildcard_field         true     node_stats  avgt    2     31885.001          ns/op

@elasticsearchmachine elasticsearchmachine added v8.1.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Dec 9, 2021
@nik9000
Copy link
Member

nik9000 commented Dec 10, 2021

This feels pretty similar to the benchmark I did in #77154. It feels more general than what I made though which is nice.

I'd love to use the parser based filtering any place where we can!

@nik9000
Copy link
Member

nik9000 commented Dec 10, 2021

@elasticsearch, test this please

@weizijun
Copy link
Contributor Author

This feels pretty similar to the benchmark I did in #77154. It feels more general than what I made though which is nice.

I'd love to use the parser based filtering any place where we can!

yeah, It's an additional to your PR

@jtibshirani jtibshirani added the :StorageEngine/TSDB You know, for Metrics label Dec 13, 2021
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 13, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@nik9000
Copy link
Member

nik9000 commented Dec 14, 2021

issue label checking robot. please wake up

@nik9000 nik9000 merged commit 41afe85 into elastic:master Dec 14, 2021
@weizijun weizijun deleted the improve-FilterContentBenchmark branch December 14, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants