mirror of https://github.com/apache/lucene.git
Speedup GlobalHitsThresholdChecker a little (#13836)
Even though this field is not `volatile`, writing it isn't free and causes needless cache thrashing at some frequency. We can speed things up by only writing the `true` value and never the `false` value.
This commit is contained in:
parent
94d3504359
commit
15168ce5c1
|
@ -46,7 +46,11 @@ abstract class HitsThresholdChecker {
|
|||
if (thresholdReached) {
|
||||
return true;
|
||||
}
|
||||
return thresholdReached = globalHitCount.longValue() > getHitsThreshold();
|
||||
if (globalHitCount.longValue() > getHitsThreshold()) {
|
||||
thresholdReached = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue