From 6f48a25d5365933570f3f4c37c2c4255827ce022 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Mon, 19 Nov 2018 19:22:27 +0100 Subject: [PATCH] do not force changes to disk diskBlock.force() makes insertion speed very slow, because it adds two digit ms to tree changes. I disabled it for now. The tree is not crash resistent anyway. --- .../src/main/java/org/lucares/pdb/map/PersistentMap.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java b/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java index 09a1aaf..4015d2f 100644 --- a/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java +++ b/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java @@ -12,10 +12,10 @@ import java.util.Stack; import java.util.UUID; import org.lucares.collections.LongList; -import org.lucares.pdb.blockstorage.intsequence.VariableByteEncoder; import org.lucares.pdb.diskstorage.DiskBlock; import org.lucares.pdb.diskstorage.DiskStorage; import org.lucares.utils.Preconditions; +import org.lucares.utils.byteencoder.VariableByteEncoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,7 +24,7 @@ public class PersistentMap implements AutoCloseable { private static final Logger LOGGER = LoggerFactory.getLogger(PersistentMap.class); // the maximum key - private static final byte[] MAX_KEY; + static final byte[] MAX_KEY; static { MAX_KEY = new byte[20]; Arrays.fill(MAX_KEY, Byte.MAX_VALUE); @@ -308,7 +308,7 @@ public class PersistentMap implements AutoCloseable { final byte[] newBuffer = node.serialize(); System.arraycopy(newBuffer, 0, buffer, 0, buffer.length); diskBlock.writeAsync(); - diskBlock.force(); + // diskBlock.force(); // makes writing nodes slower by factor 800 (sic!) } public synchronized void print() throws IOException {