Skip to content

Commit 8364012

Browse files
Remove unused construction batch member from OnHeapGraphIndex (#510)
* Remove unused construction batch member from OnHeapGraphIndex * Remove batchSize argument from constructor
1 parent 1823b9b commit 8364012

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

jvector-base/src/main/java/io/github/jbellis/jvector/graph/GraphIndexBuilder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
* that spawning a new Thread per call is not advisable. This includes virtual threads.
5959
*/
6060
public class GraphIndexBuilder implements Closeable {
61-
private static final int BUILD_BATCH_SIZE = 50;
62-
6361
private static final Logger logger = LoggerFactory.getLogger(GraphIndexBuilder.class);
6462

6563
private final int beamWidth;
@@ -327,7 +325,7 @@ public GraphIndexBuilder(BuildScoreProvider scoreProvider,
327325
this.simdExecutor = simdExecutor;
328326
this.parallelExecutor = parallelExecutor;
329327

330-
this.graph = new OnHeapGraphIndex(maxDegrees, neighborOverflow, new VamanaDiversityProvider(scoreProvider, alpha), BUILD_BATCH_SIZE);
328+
this.graph = new OnHeapGraphIndex(maxDegrees, neighborOverflow, new VamanaDiversityProvider(scoreProvider, alpha));
331329
this.searchers = ExplicitThreadLocal.withInitial(() -> {
332330
var gs = new GraphSearcher(graph);
333331
gs.usePruning(false);

jvector-base/src/main/java/io/github/jbellis/jvector/graph/OnHeapGraphIndex.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ public class OnHeapGraphIndex implements GraphIndex {
7777
// ratio, i.e., the maximum allowable degree if maxDegree * overflowRatio, it should be higher than 1.
7878
private final double overflowRatio;
7979

80-
public final ConcurrentMap<NodeAtLevel, VectorFloat<?>> constructionBatch;
81-
82-
OnHeapGraphIndex(List<Integer> maxDegrees, double overflowRatio, DiversityProvider diversityProvider, int batchSize) {
80+
OnHeapGraphIndex(List<Integer> maxDegrees, double overflowRatio, DiversityProvider diversityProvider) {
8381
this.overflowRatio = overflowRatio;
8482
this.maxDegrees = new IntArrayList();
8583
setDegrees(maxDegrees);
@@ -92,7 +90,6 @@ public class OnHeapGraphIndex implements GraphIndex {
9290
getDegree(0),
9391
(int) (getDegree(0) * overflowRatio))
9492
);
95-
this.constructionBatch = new ConcurrentHashMap<>(batchSize);
9693
}
9794

9895
/**

0 commit comments

Comments
 (0)