Removing an unnecessary counter check from the critical path of MatchHashesAndScoreQuery. The check originated in https://github.com/alexklibisz/elastiknn/pull/170, at which point it was actually useful. Then #231 removed the original reason/necessity for this check, but it was kept around for some reason.
The check is checking whether the number of hits is less than the number of possible hits going to return true in almost all cases. The only way it returns false is if we match/hit every document in the segment. If that happens, the LSH model parameters are almost certainly suboptimal.
Though this was in the critical path, the benchmark results are almost identical, so it's more of a simplification than a perf improvement:
Related Issue
611
Changes
Removing an unnecessary counter check from the critical path of MatchHashesAndScoreQuery. The check originated in https://github.com/alexklibisz/elastiknn/pull/170, at which point it was actually useful. Then #231 removed the original reason/necessity for this check, but it was kept around for some reason.
The check is checking whether the number of hits is less than the number of possible hits going to return true in almost all cases. The only way it returns false is if we match/hit every document in the segment. If that happens, the LSH model parameters are almost certainly suboptimal.
Though this was in the critical path, the benchmark results are almost identical, so it's more of a simplification than a perf improvement:
Testing and Validation
Standard CI and benchmarks