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.
This commit is contained in:
@@ -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<K, V> 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<K, V> 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 {
|
||||
|
||||
Reference in New Issue
Block a user