Skip to content

Commit 858e74a

Browse files
committed
fix: MVStore.compact: run map copy in parallel by default (¼ cores, override via h2.compactThreads)
1 parent bce0ec1 commit 858e74a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

h2/src/main/org/h2/mvstore/MVStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ private static void compact(MVStore source, MVStore target) {
408408
}
409409
}
410410

411-
int poolSize = Integer.getInteger("h2.compactThreads", 1);
411+
int poolSize = Integer.getInteger("h2.compactThreads", Math.max(1, Runtime.getRuntime().availableProcessors() / 4));
412412
ExecutorService pool = Executors.newFixedThreadPool(poolSize);
413413
CompletableFuture.allOf(
414414
// We are going to cheat a little bit in the copyFrom() by employing "incomplete" pages,

0 commit comments

Comments
 (0)