Skip to content

x/net/ipv{4,6}: adopt net/netip address types #54883

@matzf

Description

@matzf

The x/net/ipv{4,6} packages currently use net.IP and net.Addr types everywhere, with all the performance issues that the new types in the net/netip package were designed to resolve. In particular, the performance sensitive function ReadBatch must allocate the returned source addresses on every call (see related #26838).

In order to introduce this without breaking changes, parts of the API needs to be duplicated, analogous to, for example, net.ReadFromUDPAddrPort added in go-1.18.
To avoid too much API bloat, it might be sufficient to implement this for performance sensitive functions like Read/WriteBatch.

Losely related to proposal #45886; when a fast net.Read/WriteUDPMsgs functionality is available, we may simply no longer need x/net.Read/WriteBatch for some use cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Accepted

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions