File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -150,5 +150,30 @@ Order of parameters is fixed in every ABI.
150150ref: Not leacing Performance on the jump table Eduardo Madrid in cppcon
151151
152152> Do not pass an array as a single pointer.
153+ > Keep the number of function arguments low.
153154
155+ Reason: Having many arguments opens opportunities for confusion. Passing lots of arguments is often costly compared to alternatives.
154156
157+ Triple product: all int or vector 3
158+
159+ ref: Keep an eye out for buffer security checks
160+
161+ For all int there is a lot of moving.
162+
163+ And stack pointer is heavily used.
164+
165+ Number of Register is limited.
166+
167+ ## Conclusion
168+
169+ - Compilers do unexpected thing to your code, because they have to follow all the specification.
170+ - Compiler Explorer is you friend.
171+ - C++ Core Guidelines are pretty reasonable from performance point of view.
172+
173+ Guidelines:
174+
175+ - Return by value
176+ - Pass trivial types by value, oters by reference
177+ - Follow the rule of 0, or support trivial copy
178+ - Make APIs consistent
179+ - Understand abstraction cost on your target platform
You can’t perform that action at this time.
0 commit comments