Skip to content

Commit be46e79

Browse files
authored
Record index build time in buildInMemory path (#667)
1 parent 434c7c7 commit be46e79

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • jvector-examples/src/main/java/io/github/jbellis/jvector/example

jvector-examples/src/main/java/io/github/jbellis/jvector/example/Grid.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,13 @@ private static Map<Set<FeatureId>, ImmutableGraphIndex> buildInMemory(List<? ext
574574
FilteredForkJoinPool.createFilteredPool());
575575
start = System.nanoTime();
576576
var onHeapGraph = builder.build(floatVectors);
577+
double buildTimeS = (System.nanoTime() - start) / 1_000_000_000.0;
577578
System.out.format("Build (%s) M=%d overflow=%.2f ef=%d in %.2fs%n",
578579
"full res",
579580
M,
580581
neighborOverflow,
581582
efConstruction,
582-
(System.nanoTime() - start) / 1_000_000_000.0);
583+
buildTimeS);
583584
for (int i = 0; i <= onHeapGraph.getMaxLevel(); i++) {
584585
System.out.format(" L%d: %d nodes, %.2f avg degree%n",
585586
i,
@@ -603,6 +604,7 @@ private static Map<Set<FeatureId>, ImmutableGraphIndex> buildInMemory(List<? ext
603604
var index = OnDiskGraphIndex.load(ReaderSupplierFactory.open(graphPath));
604605
indexes.put(features, index);
605606
}
607+
indexBuildTimes.put(ds.getName(), buildTimeS);
606608
return indexes;
607609
}
608610

0 commit comments

Comments
 (0)