-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split up a few functions to minimize monomorphization-bloat (#1894)
Splitting up the large and commonly used functions `ChannelId::send_message`, `Message::edit`, `ApplicationCommandInteraction::create_interaction_response` and `create_followup_message` to minimize the length of the function that is generic over the closure argument. In most cases, closures count as unique types, and thus every use of these functions can cause a new copy of that function to be generated during monomorphization. By moving most of the function bodies into separate, non-generic functions, we can minimize the impact of this monomorphization-bloat. Co-authored-by: nickelc <constantin.nickel@gmail.com> Co-authored-by: Alex M. M. <acdenissk69@gmail.com>
- Loading branch information
1 parent
dc22cf2
commit 39fb310
Showing
3 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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