nspcc-dev / neofs-sdk-go

Go implementation of NeoFS SDK
Apache License 2.0
5 stars 14 forks source link

netmap: Provide placement methods returning indices instead of copied node descriptors #541

Open cthulhu-rider opened 8 months ago

cthulhu-rider commented 8 months ago

Is your feature request related to a problem? Please describe.

network map is an array of storage nodes' descriptors of type https://pkg.go.dev/github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.11/netmap#NodeInfo, and

return [][]NodeInfo. This is pretty big overhead since all resulting 2d array's items are copied elements from the input array. Moreover, the elements may repeat (afaik)

Describe the solution you'd like

provide methods returning [][]int - indices from the inital array

Describe alternatives you've considered

provide iterators, but it's better to start with indices cuz they are simpler imo

Additional context

roman-khimov commented 8 months ago

[][]*NodeInfo is an option too, [][]int won't be a pleasure to use.