mirror of
https://github.com/nspcc-dev/neofs-sdk-go.git
synced 2026-03-01 04:29:18 +00:00
Support custom memory allocators in object slicer #211
Labels
No labels
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U2
U2
U3
U4
blocked
bug
client
config
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
performance
pool
question
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-sdk-go#211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cthulhu-rider on GitHub (Jan 15, 2024).
object slicer allocates byte buffers of certain size using Go built-in
makefunction. From one side, it's normal default behavior for the library functionality. At the same time, some applications may desire to manage memory allocations deeper in order to improve app's performanceit's proposed to define app-level memory allocator (interface) and support it by the slicer as option. If set, this allocator is be used for processing, otherwise, slicer defaults to
makeadditionally, this approach will allow to get rid of
nspcc-dev/neofs-sdk-go@1db2fbf3c1/object/slicer/options.go (L58-L60)that requires buffer to be of sizeMaxObjectSize(64MB).@roman-khimov commented on GitHub (Jan 16, 2024):
Usually if you need a custom allocator you're doing something wrong, it'll be complicated and buggy. Pools/buffers should be sufficient for this.
@cthulhu-rider commented on GitHub (Jan 18, 2024):
these are custom allocators to me