-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use trait objects internally to avoid generic instantiation (#60)
Keep the external interface to async transactions *mostly* unchanged, but delegate to internal functions that (as much as possible) avoid using generic functions. This is intended to reduce code generation. For a debug build of `omicron-nexus`, this reduces the (debug build, Linux) binary size from 514 MiB to 497 MiB. Source for idea: https://matklad.github.io/2021/09/04/fast-rust-builds.html#Keeping-Instantiations-In-Check > A... common case here are closures: by default, prefer &dyn Fn() over impl Fn(). Similarly to paths, an impl-based nice API might be a thin wrapper around dyn-based implementation which does the bulk of the work.
- Loading branch information
Showing
2 changed files
with
73 additions
and
4 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