zhaih commented on code in PR #12651: URL: https://github.com/apache/lucene/pull/12651#discussion_r1359568778
########## lucene/core/src/java/org/apache/lucene/util/hnsw/OnHeapHnswGraph.java: ########## @@ -40,31 +41,39 @@ public final class OnHeapHnswGraph extends HnswGraph implements Accountable { // to vectors // added to HnswBuilder, and the node values are the ordinals of those vectors. // Thus, on all levels, neighbors expressed as the level 0's nodes' ordinals. - private final List<NeighborArray> graphLevel0; - // Represents levels 1-N. Each level is represented with a Map that maps a levels level 0 - // ordinal to its neighbors on that level. All nodes are in level 0, so we do not need to maintain - // it in this list. However, to avoid changing list indexing, we always will make the first - // element - // null. - private final List<Map<Integer, NeighborArray>> graphUpperLevels; - private final int nsize; - private final int nsize0; + private NeighborArray[][] graph; Review Comment: >Especially why we even need nonZeroLevelSize Yeah it is only used for memory accounting. But since it's just an int I guess it's ok to put it there? I added some more docs to explain those fields :) -- 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