Skip to content

Conversation

@iverase
Copy link
Contributor

@iverase iverase commented Jul 28, 2025

I added more dimensions to be run on OSQScorerBenchmark and I notice that for 782 dimensions the speed was slower than expected:

Benchmark                                                (dims)   Mode  Cnt   Score   Error   Units
OSQScorerBenchmark.scoreFromArray                           384  thrpt    5  29.949 ± 1.378  ops/ms
OSQScorerBenchmark.scoreFromArray                           782  thrpt    5  11.533 ± 0.641  ops/ms
OSQScorerBenchmark.scoreFromArray                          1024  thrpt    5  21.132 ± 1.033  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentAllBulk            384  thrpt    5  52.487 ± 1.577  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentAllBulk            782  thrpt    5  15.716 ± 0.422  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentAllBulk           1024  thrpt    5  32.097 ± 0.755  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVector         384  thrpt    5  32.016 ± 0.814  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVector         782  thrpt    5  12.263 ± 0.215  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVector        1024  thrpt    5  22.009 ± 0.744  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVectorBulk     384  thrpt    5  46.539 ± 1.406  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVectorBulk     782  thrpt    5  14.539 ± 0.208  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVectorBulk    1024  thrpt    5  27.242 ± 4.121  ops/ms

The reason is that for that number of dimensions, the scalr part is quite big and it is slowing down everything. Add ing the same strategy as in the scalar implementation (ES91OSQVectorsScorer), provides a good speed up for that number of dimensions while the other ones remain practically the same:

Benchmark                                                (dims)   Mode  Cnt   Score   Error   Units
OSQScorerBenchmark.scoreFromArray                           384  thrpt    5  29.977 ± 0.601  ops/ms
OSQScorerBenchmark.scoreFromArray                           782  thrpt    5  11.637 ± 0.330  ops/ms
OSQScorerBenchmark.scoreFromArray                          1024  thrpt    5  21.074 ± 0.465  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentAllBulk            384  thrpt    5  57.584 ± 0.896  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentAllBulk            782  thrpt    5  30.038 ± 0.419  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentAllBulk           1024  thrpt    5  31.260 ± 1.500  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVector         384  thrpt    5  30.984 ± 0.956  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVector         782  thrpt    5  19.381 ± 1.134  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVector        1024  thrpt    5  22.125 ± 0.529  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVectorBulk     384  thrpt    5  45.391 ± 1.388  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVectorBulk     782  thrpt    5  24.009 ± 3.614  ops/ms
OSQScorerBenchmark.scoreFromMemorySegmentOnlyVectorBulk    1024  thrpt    5  27.191 ± 0.623  ops/ms

@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jul 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm other than a few old comments

@iverase iverase merged commit 1771d00 into elastic:main Jul 29, 2025
32 of 33 checks passed
@iverase iverase deleted the speedTail branch July 29, 2025 06:39
szybia added a commit to szybia/elasticsearch that referenced this pull request Jul 29, 2025
…-tracking

* upstream/main: (26 commits)
  Add release notes for v9.1.0 release (elastic#131953)
  Unmute multi_node generative tests (elastic#132021)
  Avoid re-enqueueing merge tasks (elastic#132020)
  Fix file entitlements for shared data dir (elastic#131748)
  ES|QL brute force l2_norm vector function (elastic#132025)
  Make ES|QL SAMPLE not a pipeline breaker (elastic#132014)
  Speed up tail computation in MemorySegmentES91OSQVectorsScorer (elastic#132001)
  Remove deprecated usages in `TransportPutFollowAction` (elastic#132038)
  Simulate impact of shard movement using shard-level write load (elastic#131406)
  Remove RemoteClusterService.getConnections() method (elastic#131948)
  Fix off by one in ValuesBytesRefAggregator (elastic#132032)
  Use unicode strings in data generation by default (elastic#132028)
  Adding index.refresh_interval as a data stream setting (elastic#131482)
  [ES|QL] Add more Min/MaxOverTime CSV tests (elastic#131070)
  Restrict remote ENRICH after FORK (elastic#131945)
  Fix decoding of non-ascii field names in ignored source (elastic#132018)
  [docs] Use centrally maintained version variables (elastic#131939)
  Configurable Inference timeout during Query time (elastic#131551)
  ESQL: Allow pruning columns added by InlineJoin (elastic#131204)
  ESQL: Fail `profile` on text response formats (elastic#128627)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants