-
Notifications
You must be signed in to change notification settings - Fork 102
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
WIP: Allocation/borrowing optimizations, part 1 #179
Conversation
Thank you for starting the ball rolling on this! re: your unresolved questions:
|
Re:
|
As I'm talking about mega-PRs, I'm realizing that combining suffix into args is a big change that I might want to separate from this... |
39b39dc
to
aa4f08a
Compare
- Made some parts of the documentation less ambiguous about borrows. - Updated parser documentation to reflect new parameters. - Removed the 15-parameter restriction, replacing it with a parser-iterator (even though servers/clients SHOULD NOT send more than 15, they MUST be able to handle such messages). - Combined suffix/trailing parameter with middle parameters, as it MUST be treated the same as if it were a final parameter ("PRIVMSG #foo :Hello" and "PRIVMSG #foo Hello" are semantically equivalent).
Rebased on latest 0.14. |
This is part of an effort to resolve #32 by replacing owned strings with borrows,
Cow
s, and generics where possible. The most straightforward part is theMessage
type which now references a single buffer containing the message's serialization. It avoids additional allocations by using iterators for parameters/tags instead of storing them in collections.This PR also resolves #172 as part of the re-implementation of the message type.delayedTODO
Message
type with the other APIs.Message
.Unresolved questions
How do we want to implement this in the broader scale?
Command
andPrefix
are also going to have to be rewritten to allow zero-allocation as they liberally useString
, but we still haven't really discussed our options here.Do we want to split these other changes into different PRs, or would it be best to review and merge together?