Skip to content

Significant performance impact with new TermOrdValComparator.SkipperBasedCompetitiveState #15707

@benwtrent

Description

@benwtrent

Description

During the 10.4 release process, we noticed a 100-300x slowdown on a benchmark that utilizes doc-skippers.

The query is rather innocuous, its an attempt to sort the result by a SORTED SET field while filtering by a separate sorted set field. The index is sorted by both fields, but also by multiple others.

Before the changes to TermOrdValComparator.SkipperBasedCompetitiveState this query took about 4ms, now its 700+ms.

Here are some interesting flamegraphs (I am attempting to get JFR to pair down the actual times of the queries, but its taking hours as the actual runtime of the benchmark is many hours...)

baseline (note how its 0.06% of samples)
Image

candidate (note how its over 3% of samples)

Image

I am still attempting to fully replicate without an insane benchmark run of multiple hours. The key things seem to be:

  • Index sorted by (but not exclusively by) two doc value fields
  • Using a skipper with larger windows
  • ... and I am not sure what else... need to dig further, this is new territory for me.

Regardless, this competitive iterator is still doing WAY too much work and obviously needs fixing.

One of the key things this shows me is the lack of Lucene Util nightly benchmarks that use the new doc-skipper stuff. I think @romseygeek is working on these to catch stuff like this early.

Related PRs:

Version and environment details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions