alexklibisz / elastiknn

Elasticsearch plugin for nearest neighbor search. Store vectors and run similarity search using exact and approximate algorithms.
https://alexklibisz.github.io/elastiknn
Apache License 2.0
368 stars 48 forks source link

Performance: optimize ArrayHitCounter increment method (benchmarks improved by up to 10%) #609

Closed alexklibisz closed 9 months ago

alexklibisz commented 9 months ago

Related Issue

611

Changes

Making two slight optimizations within ArrayHitCounter:

  1. Get rid of an overloaded method call
  2. Doing the check-and-increment in a single operation rather than two separate operations

This improves the Fashion Mnist benchmarks by up to 10%:

image image image

Testing and Validation

Standard CI and benchmarks