About code footprint-Playback ction-Techniques

Source: Internet
Author: User

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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.