romseygeek commented on code in PR #16285:
URL: https://github.com/apache/lucene/pull/16285#discussion_r3559669782
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java:
##########
@@ -1933,6 +1940,27 @@ private SortedNumericDocValues getSortedNumeric(
final LongValues values = getNumericValues(entry);
final int denseFixedCardinality = fixedCardinality(entry, skipperEntry);
+ // For GCD/delta encoded entries, capture raw packed values for
rangeIntoBitSet optimization.
+ // The decoded `values` wrapper applies mul*get+delta per call; using raw
values with
+ // transformed bounds avoids this per-value decode cost.
+ final boolean hasGcdEncoding =
+ entry.bitsPerValue > 0
+ && entry.blockShift < 0
+ && entry.table == null
+ && (entry.gcd != 1 || entry.minValue != 0);
+ final LongValues rawValues;
+ final long mul, delta;
+ if (hasGcdEncoding) {
+ RandomAccessInput rawSlice = data.randomAccessSlice(entry.valuesOffset,
entry.valuesLength);
Review Comment:
Creating a new slice isn't free - can we allocate this lazily inside
`intoBitSet` so that we don't add overhead to instances that aren't going to
use it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]