mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Performance tune for mit.
This commit is contained in:
@@ -19,18 +19,18 @@ package net.openhft.chronicle.hash.impl;
|
||||
import net.openhft.chronicle.hash.ChronicleHash;
|
||||
import net.openhft.chronicle.hash.KeyContext;
|
||||
import net.openhft.chronicle.hash.impl.hashlookup.HashLookup;
|
||||
import net.openhft.chronicle.hash.impl.util.BuildVersion;
|
||||
import net.openhft.chronicle.hash.serialization.BytesReader;
|
||||
import net.openhft.chronicle.hash.serialization.SizeMarshaller;
|
||||
import net.openhft.chronicle.hash.serialization.internal.MetaBytesInterop;
|
||||
import net.openhft.chronicle.hash.serialization.internal.MetaProvider;
|
||||
import net.openhft.chronicle.hash.serialization.internal.SerializationBuilder;
|
||||
import net.openhft.chronicle.hash.impl.util.BuildVersion;
|
||||
import net.openhft.lang.Jvm;
|
||||
import net.openhft.lang.io.Bytes;
|
||||
import net.openhft.lang.io.BytesStore;
|
||||
import net.openhft.lang.io.MappedStore;
|
||||
import net.openhft.lang.io.NativeBytes;
|
||||
import net.openhft.lang.io.serialization.JDKObjectSerializer;
|
||||
import net.openhft.lang.io.serialization.BytesMarshallableSerializer;
|
||||
import net.openhft.lang.threadlocal.Provider;
|
||||
|
||||
import java.io.File;
|
||||
@@ -224,7 +224,7 @@ public abstract class VanillaChronicleHash<K, KI, MKI extends MetaBytesInterop<K
|
||||
public final void createMappedStoreAndSegments(File file) throws IOException {
|
||||
warnOnWindows();
|
||||
createMappedStoreAndSegments(new MappedStore(file, FileChannel.MapMode.READ_WRITE,
|
||||
sizeInBytes(), JDKObjectSerializer.INSTANCE));
|
||||
sizeInBytes(), BytesMarshallableSerializer.create()));
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public final class CharSequenceWriter<CS extends CharSequence> implements BytesW
|
||||
|
||||
@Override
|
||||
public long size(@NotNull CS s) {
|
||||
return AbstractBytes.findUTFLength(s, s.length());
|
||||
return AbstractBytes.findUTFLength(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-2
@@ -20,8 +20,9 @@ import net.openhft.chronicle.hash.serialization.BytesWriter;
|
||||
import net.openhft.lang.io.Bytes;
|
||||
import net.openhft.lang.io.DirectBytes;
|
||||
import net.openhft.lang.io.DirectStore;
|
||||
import net.openhft.lang.io.serialization.BytesMarshallableSerializer;
|
||||
import net.openhft.lang.io.serialization.BytesMarshaller;
|
||||
import net.openhft.lang.io.serialization.JDKObjectSerializer;
|
||||
import net.openhft.lang.io.serialization.ObjectSerializer;
|
||||
import net.openhft.lang.threadlocal.StatefulCopyable;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -37,6 +38,7 @@ class DirectBytesBuffer
|
||||
transient ForBytesMarshaller forBytesMarshaller;
|
||||
transient ForBytesWriter forBytesWriter;
|
||||
transient ForDataValueWriter forDataValueWriter;
|
||||
private final ObjectSerializer objectSerializer = BytesMarshallableSerializer.create();
|
||||
|
||||
DirectBytesBuffer(Serializable identity) {
|
||||
this.identity = identity;
|
||||
@@ -65,7 +67,7 @@ class DirectBytesBuffer
|
||||
return buffer = store.bytes();
|
||||
}
|
||||
} else {
|
||||
buffer = new DirectStore(JDKObjectSerializer.INSTANCE, Math.max(1, maxSize), true)
|
||||
buffer = new DirectStore(objectSerializer, Math.max(1, maxSize), true)
|
||||
.bytes();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user