-
Notifications
You must be signed in to change notification settings - Fork 109
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
implement a new multiaddress API #198
Comments
Another annoyance I ran into: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problems with the current API
Major problems:
Related: multiformats/multiaddr#155
Minor problems:
Multiaddr
is an interface, and therefore (almost always) allocated on the heap. This creates a lot of GC pressure.SplitLast
) and methods on the interface (e.g.ValueForProtocol
). There’s no (apparent) logic behind this, making use of the API confusingProtocols
) is the major source of allocations in a Kubo nodeProposal for a new API
Wishlist
Multiaddr
is not an interface any more, but a concrete typeMultiaddr
can be entirely allocated on the stackMultiaddr
are comparable using the==
operator. This means they can be used as map keys!Component
is a concrete type, also allocated on the stack, and==
comparableThe text was updated successfully, but these errors were encountered: