mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 06:18:16 +00:00
perf[protocol]: 增加缓存提高通过class获取协议id的速度
This commit is contained in:
1 parent
795f0c7e28
commit
cfc15a80be
6 files changed
+23
-12
No files matched your search
@@ -64,7 +64,7 @@ public class FileChannelMap<V extends IPacket> implements LpMap<V>, Closeable {
|
||||
this.indexFileRandomAccess = new RandomAccessFile(indexFile, "rw");
|
||||
this.indexFileChannel = this.indexFileRandomAccess.getChannel();
|
||||
|
||||
var protocolId = ProtocolManager.getProtocolIdByClass(clazz);
|
||||
var protocolId = ProtocolManager.protocolId(clazz);
|
||||
protocolRegistration = ProtocolManager.getProtocol(protocolId);
|
||||
|
||||
indexBuffer = ByteBufAllocator.DEFAULT.ioBuffer(16);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class FileHeapMap<V extends IPacket> implements LpMap<V> {
|
||||
try {
|
||||
this.dbFile = FileUtils.getOrCreateFile(dbPath, StringUtils.format("{}.db", clazz.getSimpleName()));
|
||||
|
||||
var protocolId = ProtocolManager.getProtocolIdByClass(clazz);
|
||||
var protocolId = ProtocolManager.protocolId(clazz);
|
||||
protocolRegistration = ProtocolManager.getProtocol(protocolId);
|
||||
heapMap = new HeapMap<>();
|
||||
|
||||
|
||||
Reference in new issue
Block a user