Add non-capturing overloads of Modify methods#1396
Open
Joe4evr wants to merge 1 commit intodiscord-net:devfrom
Open
Add non-capturing overloads of Modify methods#1396Joe4evr wants to merge 1 commit intodiscord-net:devfrom
Joe4evr wants to merge 1 commit intodiscord-net:devfrom
Conversation
Member
|
Pretty sure we ended up deciding that interface additions weren't breaking version changes, due to the internal-implementation-only part of them. Overall, I'm not sure this is actually a worthwhile change given the fact that we're already a pretty allocation-heavy library. To me, it seems pretty hard to get any meaningful results, but could you run some benchmarks to check how much of an improvement this is? |
Contributor
Author
|
I'll write some tomorrow, it's getting late here. |
301efd7 to
391823b
Compare
Contributor
Author
|
So because I had to deal with Discord's rate limits to get these numbers, I'm cutting out the timing columns from this table:
|
Contributor
Author
|
@foxbot PTAL? |
Member
|
@Joe4evr Are you willing to fix merge conflicts? I like this PR! 😃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is technically a breaking change since it modifies the interfaces, but people shouldn't be making their own implementations of our interfaces.
This change adds an overload to all
ModifyAsyncmethods (that I could find) to take in astateparameter that's forwarded into the callback so they can be written without closing over local state. End users can take advantage of these overloads to keep GC pressure down.