bytes.Clone for slice copying #96
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#96
Loading…
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?
Original issue: https://github.com/nspcc-dev/neofs-node/issues/2251
Go 1.20 finally brought to us a killer feature --- bytes.Clone library function that can... copy byte slices! We can finally replace
slice.Copy
(but not a `slice.CopyReverse, ha-ha) with something standard.slice.Copy
fromgithub.com/nspcc-dev/neo-go/pkg/util/slice
is defined like that:while
bytes.Clone
isSo,
Clone
does not use preallocated memory that may lead to extra memory usage:I suppose this may break heuristics for
GOMEMLIMIT
that's used by GC and so onWDYT?
neo-go has plans for dropping
util/slice
, so I suggest moving to std version. https://github.com/nspcc-dev/neo-go/issues/3089slices
package usage #815