File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,3 +70,25 @@ Guidelines
7070
7171See also
7272- [ Rust API Guidelines] ( https://rust-lang.github.io/api-guidelines/checklist.html )
73+
74+ ## Performance
75+
76+ Keep the code simple unless a real-world benchmark shows benefits to a more complicated design.
77+ Microbenchmarks are not always sufficient as performance can vary from real-world cases.
78+
79+ ### Limit code generation for tuples
80+
81+ Implementing traits for tuples can generate a lot of code.
82+
83+ Limit trait implementations for tuples to 10 elements.
84+
85+ Identify if a non-generic core can be split out.
86+
87+ Consider alternatives, like macros.
88+
89+ ### Inlined wrapper around specialized cores
90+
91+ The compiler does not always make the right inlining decisions that can lead to optimizations.
92+ One way of helping the compiler is to have a very thin ` #[inline(always)] ` wrapper that
93+ dispatches to one of several function bodies
94+ (whether syntactically or through monomorphization).
You can’t perform that action at this time.
0 commit comments