elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.47k stars 24.88k forks source link

Improve halfbyte transposition performance, marginally improving bbq performance #117350

Closed benwtrent closed 5 days ago

benwtrent commented 6 days ago

The transposition of the bits in half-byte queries for BBQ is pretty convoluted and slow. This commit greatly simplifies & improves performance for this small part of bbq queries and indexing.

Here are the results of a small JMH benchmark for this particular function.

TransposeBinBenchmark.transposeBinNew     1024  thrpt    5  857.779 ± 44.031  ops/ms
TransposeBinBenchmark.transposeBinOrig    1024  thrpt    5   94.950 ±  2.898  ops/ms

While this is a huge improvement for this small function, the impact at query and index time is only marginal. But, the code simplification itself is enough to warrant this change in my opinion.

elasticsearchmachine commented 6 days ago

Pinging @elastic/es-search-relevance (Team:Search Relevance)

elasticsearchmachine commented 6 days ago

Hi @benwtrent, I've created a changelog YAML for you.

elasticsearchmachine commented 5 days ago

💚 Backport successful

Status Branch Result
8.17