Gameenginearchitecture Reading Notes (3)

Source: Internet
Author: User
  • memory management

    • C ++'s default new method is less efficient
    • If the algorithms are the same, a good memory management policy can also improve performance.
    • you can use pre-allocation to reduce the number of dynamic allocations (memory pool)
    • SIMD Math Library requires memory alignment (xnamath)
    • cache miss
      • CPU access to ram is slow, so there is a fast cache in the middle
      • when the CPU accesses data, it will copy a segment from Ram to the cache. If the cache is good enough, it will respond quickly. If not, it is necessary to re-load another segment to the cache
      • the cache miss cannot be avoided, but you can reduce the number of occurrences in the Program Policy
      • how to reduce data cache miss
        • try to organize your data in a continuous memory
        • each part should be as small as possible (bit domain operations can be used)
      • How to Reduce instruction cache miss
        • performance-related do not call functions in the Code section.
        • if you have to call a function, put the function in the same CPP.
        • use the inline function
    • if you are too lazy to do it yourself, you can use TBB or nedmalloc
  • resource and File System
    • File System

      • we recommend that you use the "/" path separator and provide the path processing tool function class.
      • asynchronous Io should be supported at this layer
    • Resource Management
      • Version Control is best integrated into management tools
      • you can create a resource database for easy retrieval
      • The resource "compiler" allows you to perform resource format conversion and Optimization in this step.
      • file packaging can reduce the disk's seek time
      • resource data compression can be performed at the file package layer
      • serialization can be used to reduce file format confusion, but C ++ lacks this feature.

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.