The so-called code footprint-encryption ction Techniques is simply to makeCodeSmaller Methods
Http://www.mozilla.org/performance/footprint-reduction-techniques.html
This articleArticleLists the following misunderstandings and solutions.
- Overuse of Virtual Methods to indicate class attributes
It is said that many virtual functions are used to implement class attributes.
The solution is to put the variable in the base class, and modify the variable value in the derived class.
- Too much class Specialization
Too many features,
- Huge switch statements
If the switch statement is too large, the solution is to use mapping table ing.
- Heap-based readonly tables
Heap-based read-only tables
- Using pointers to member classes
We recommend that you directly include members rather than store pointers. this can save 4 bytes. I personally think this method is a little abnormal. c ++ requires a pointer when there is a wrapper policy that hides implementation details.