mirror of https://github.com/apache/lucene.git
LUCENE-10128: avoid costly reflection in SparseFixedBitSet ctor
Seems that VectorFormat merge creates A LOT of these bitsets. We don't need to do any fancy reflection here via shallowSizeOf(Object), when we can call sizeOf(long[]) which is fast. We may want to revisit this RAMUsageEstimator api in the future to prevent traps like this.
This commit is contained in:
parent
7357bdc272
commit
6ac311068f
|
@ -69,7 +69,7 @@ public class SparseFixedBitSet extends BitSet {
|
|||
bits = new long[blockCount][];
|
||||
ramBytesUsed =
|
||||
BASE_RAM_BYTES_USED
|
||||
+ RamUsageEstimator.shallowSizeOf(indices)
|
||||
+ RamUsageEstimator.sizeOf(indices)
|
||||
+ RamUsageEstimator.shallowSizeOf(bits);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue