Support buffer providing for payloadSizeLimiter #155

Closed
opened 2023-09-01 06:39:23 +00:00 by dkirillov · 0 comments
Collaborator

When we use client cut for streaming objects whose size is greater than MaxObjectSize in network the runtime.GrowSlice for this starts consuming a lot of resources. It would be nice to have some kind of reusing this buffer.

Describe the solution you'd like

Since we cannot just reuse this buffer inside of payloadSizeLimiter (when object is formed client code can do anything with it and we have no guarantee that this payload won't be changed), we can provide to it some function/struct/interface that will be invoked to get new buffer. This way client code be able to reuse such buffer if it's sure that it's safe.

## Is your feature request related to a problem? Please describe. When we use client cut for streaming objects whose size is greater than MaxObjectSize in network the `runtime.GrowSlice` [for](https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/src/commit/84e7e69f98ac8c0d6ef09fb90bb60ba035aade17/object/transformer/transformer.go#L124) [this](https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/src/commit/84e7e69f98ac8c0d6ef09fb90bb60ba035aade17/object/transformer/transformer.go#L281) starts consuming a lot of resources. It would be nice to have some kind of reusing this buffer. ## Describe the solution you'd like Since we cannot just reuse this buffer inside of `payloadSizeLimiter` (when object is formed client code can do anything with it and we have no guarantee that this payload won't be changed), we can provide to it some function/struct/interface that will be invoked to get new buffer. This way client code be able to reuse such buffer if it's sure that it's safe.
dkirillov added the
enhancement
label 2023-09-01 06:39:23 +00:00
achuprov was assigned by fyrchik 2023-12-05 13:57:59 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-sdk-go#155
There is no content yet.