优化内存缓存写入速度

This commit is contained in:
刘祥超
2024-01-22 10:28:23 +08:00
parent 6c2d488c37
commit 4c143310b5

View File

@@ -48,6 +48,10 @@ func NewMemoryWriter(memoryStorage *MemoryStorage, key string, expiredAt int64,
SharedFragmentMemoryPool.IncreaseNew()
}
}
} else {
if expectedBodySize > 0 {
valueItem.BodyValue = make([]byte, 0, expectedBodySize)
}
}
var w = &MemoryWriter{
storage: memoryStorage,