msokolov commented on PR #13872: URL: https://github.com/apache/lucene/pull/13872#issuecomment-2462587122
## heap comparison Here's the output from luceneutil's JFR heap usage summarizer. Clearly a huge amount more allocations for this change. ### float32 mainline ``` PERCENT HEAP SAMPLES STACK 31.03% 262M org.apache.lucene.util.hnsw.NeighborArray#<init>() [Inlined code] 18.07% 152M org.apache.lucene.util.ArrayUtil#copyOfSubArray() [Inlined code] 9.11% 77M java.lang.Integer#valueOf() [Inlined code] 8.61% 72M org.apache.lucene.util.hnsw.NeighborQueue#nodes() [Inlined code] ``` ### float32 knn-dictionary ``` PERCENT HEAP SAMPLES STACK 94.25% 54257M org.apache.lucene.codecs.lucene95.OffHeapFloatVectorValues#vectors() [Inlined code] 2.27% 1306M org.apache.lucene.store.MemorySegmentIndexInput#clone() [Inlined code] 1.14% 656M org.apache.lucene.util.hnsw.NeighborQueue#nodes() [Inlined code] 0.46% 266M org.apache.lucene.store.MemorySegmentIndexInput$SingleSegmentImpl#<init>() [Inlined code] 0.43% 245M org.apache.lucene.util.hnsw.NeighborArray#<init>() [Inlined code] 0.37% 214M org.apache.lucene.codecs.hnsw.DefaultFlatVectorScorer$FloatScoringSupplier#scorer() [JIT compiled code] 0.24% 138M org.apache.lucene.util.ArrayUtil#copyOfSubArray() [Inlined code] 0.14% 83M java.lang.Integer#valueOf() [Inlined code] 0.11% 62M org.apache.lucene.codecs.lucene95.OffHeapFloatVectorValues#vectors() [JIT compiled code] 0.07% 42M org.apache.lucene.util.hnsw.NeighborQueue#nodes() [JIT compiled code] ``` ### int7 mainline ``` PERCENT HEAP SAMPLES STACK 53.56% 14617M jdk.internal.foreign.SegmentFactories#fromArray() [Inlined code] 41.52% 11333M jdk.internal.foreign.MemorySessionImpl#createHeap() [Inlined code] 1.16% 316M org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorScorer#dotProductFactory() [Inlined code] 1.03% 280M org.apache.lucene.util.hnsw.NeighborArray#<init>() [Inlined code] 0.56% 152M org.apache.lucene.util.ArrayUtil#copyOfSubArray() [Inlined code] 0.29% 79M java.lang.Integer#valueOf() [Inlined code] ``` ### int7 knn-dictionary ``` PERCENT HEAP SAMPLES STACK 40.22% 20231M java.nio.HeapByteBuffer#<init>() [Inlined code] 30.42% 15298M jdk.internal.foreign.SegmentFactories#fromArray() [Inlined code] 22.30% 11214M jdk.internal.foreign.MemorySessionImpl#createHeap() [Inlined code] 1.35% 677M org.apache.lucene.store.MemorySegmentIndexInput#clone() [Inlined code] 1.01% 506M java.nio.ByteBuffer#allocate() [Inlined code] 0.82% 411M org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues$1#<init>() [Inlined code] 0.77% 389M org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorScorer#dotProductFactory() [Inlined code] 0.63% 315M org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues#vectors() [Inlined code] 0.54% 270M org.apache.lucene.util.hnsw.NeighborArray#<init>() [Inlined code] 0.31% 155M org.apache.lucene.store.MemorySegmentIndexInput$SingleSegmentImpl#<init>() [Inlined code] 0.31% 154M org.apache.lucene.util.ArrayUtil#copyOfSubArray() [Inlined code] 0.15% 75M java.lang.Integer#valueOf() [Inlined code] ``` ### int4 mainline ``` PERCENT HEAP SAMPLES STACK 26.75% 348M org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorScorer#dotProductFactory() [Inlined code] 21.15% 275M org.apache.lucene.util.hnsw.NeighborArray#<init>() [Inlined code] 11.16% 145M org.apache.lucene.util.ArrayUtil#copyOfSubArray() [Inlined code] 6.36% 82M java.lang.Integer#valueOf() [Inlined code] 5.25% 68M org.apache.lucene.util.hnsw.NeighborQueue#nodes() [Inlined code] 2.79% 36M org.apache.lucene.util.SparseFixedBitSet#insertLong() [JIT compiled code] 2.54% 33M java.util.Arrays#copyOf() [Inlined code] ``` ### int4 knn-dictionary ``` 85.00% 20633M java.nio.HeapByteBuffer#<init>() [Inlined code] 2.53% 614M org.apache.lucene.store.MemorySegmentIndexInput#clone() [Inlined code] 2.05% 498M java.nio.ByteBuffer#allocate() [Inlined code] 1.66% 403M org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues$1#<init>() [Inlined code] 1.60% 388M org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorScorer#dotProductFactory() [Inlined code] 1.16% 282M org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues#vectors() [Inlined code] 1.14% 277M org.apache.lucene.util.hnsw.NeighborQueue#nodes() [Inlined code] 1.05% 255M org.apache.lucene.util.hnsw.NeighborArray#<init>() [Inlined code] 0.81% 196M org.apache.lucene.store.MemorySegmentIndexInput$SingleSegmentImpl#<init>() [Inlined code] 0.60% 144M org.apache.lucene.util.ArrayUtil#copyOfSubArray() [Inlined code] 0.34% 82M java.lang.Integer#valueOf() [Inlined code] 0.18% 44M org.apache.lucene.util.hnsw.NeighborQueue#nodes() [JIT compiled code] 0.16% 38M org.apache.lucene.util.SparseFixedBitSet#insertLong() [JIT compiled code] 0.15% 36M java.util.Arrays#copyOf() [Inlined code] ``` -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org