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

transport: Optimize protocol name construction on every every substream open #346

Open
lexnv opened this issue Feb 27, 2025 · 0 comments
Open
Labels
priority: low Nice-to-have improvements, optimizations, or future considerations todo Extracted from code todos

Comments

@lexnv
Copy link
Collaborator

lexnv commented Feb 27, 2025

Litep2p constructs a list of protocols (including name and fallback) to negotiate with the remote peer.
This list can be statically constructed since the protocol names are not supposed to change.

// TODO: protocols don't change after they've been initialized so this should be done only
// once
let protocols = std::iter::once(&*protocol)
.chain(fallback_names.iter().map(|protocol| &**protocol))
.collect();

@lexnv lexnv added priority: low Nice-to-have improvements, optimizations, or future considerations todo Extracted from code todos labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Nice-to-have improvements, optimizations, or future considerations todo Extracted from code todos
Projects
None yet
Development

No branches or pull requests

1 participant