- Prefer ZERO to all other constants
- then ONE
- Using Virtual Table for HOT i-cache
- but still, depends on compiler's implementation
- WRITE OUR OWN VTABLE!
- SWITCH:
- good for up to 7 branches
- mix could and hot code
- code for distinct types stays together
- effectively trades off modularity for performance
- Future:
- elide move just like rvo/nrvo
Reference: Writing-Quick-Code-in-Cpp-Quickly,Andrei Alexandrescu How can I cause an instruction cache miss? Is RVO (Return Value Optimization) on unnamed objects a universally guaranteed behavior? Want Speed? Pass by Value. c++: RVO and NRVO
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.