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

Investigate switching from net.IP to netip.Addr #321

Open
antoninbas opened this issue Sep 28, 2023 · 1 comment
Open

Investigate switching from net.IP to netip.Addr #321

antoninbas opened this issue Sep 28, 2023 · 1 comment
Assignees

Comments

@antoninbas
Copy link
Member

Go 1.18 introduced the net/netip package: https://tip.golang.org/doc/go1.18#netip

Here is a relevant statement about the new package:

The new net/netip package defines a new IP address type, Addr. Compared to the existing net.IP type, the netip.Addr type takes less memory, is immutable, and is comparable so it supports == and can be used as a map key.

netip.Prefix also replaces net.IPNet

Switching from net to net/netip may yield significant performance improvements (reduced CPU and memory usage) for consumers of the go-ipfix library, although it may break backwards-compatibility in some places (should be ok given that there is no v1 major release yet). This should be investigated and measured.

@antoninbas
Copy link
Member Author

antoninbas commented Sep 28, 2023

I can't assign myself, but I'm currently looking into this

@antoninbas antoninbas self-assigned this Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant