[#39] Client: add memory usage optimizations

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2025-03-07 15:29:45 +03:00
parent d6fe034453
commit 32a7e64538
14 changed files with 120 additions and 92 deletions

View file

@ -327,10 +327,10 @@ internal sealed class ObjectServiceProvider(ObjectService.ObjectServiceClient cl
{
Body = new()
{
Address = address,
Address = address,
Patch = new PatchRequest.Types.Body.Types.Patch
{
Chunk = ByteString.CopyFrom(chunkBuffer, 0, bytesCount),
Chunk = UnsafeByteOperations.UnsafeWrap(chunkBuffer.AsMemory(0, bytesCount)),
SourceRange = new Object.Range { Offset = currentPos, Length = (ulong)bytesCount }
}
}
@ -481,7 +481,7 @@ internal sealed class ObjectServiceProvider(ObjectService.ObjectServiceClient cl
var obj = new FrostFsObject(partHeader)
{
SingleObjectPayload = buffer.Length == size ? buffer : buffer[..size]
SingleObjectPayload = buffer.AsMemory(0, size)
};
var prm = new PrmSingleObjectPut(obj);