Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cthulhu-rider opened this issue Dec 20, 2023 · 1 comment
Labels
enhancement Improving existing functionality I3 Minimal impact performance More of something per second S3 Minimally significant U3 Regular

Comments

@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Dec 20, 2023

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/[email protected]/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

@cthulhu-rider cthulhu-rider added the enhancement Improving existing functionality label Dec 20, 2023
@roman-khimov
Copy link
Member

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

@roman-khimov roman-khimov added U3 Regular S3 Minimally significant I3 Minimal impact performance More of something per second labels Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I3 Minimal impact performance More of something per second S3 Minimally significant U3 Regular
Projects
None yet
Development

No branches or pull requests

2 participants