1. The alignment principle. For example, 64-bit bus, each address read 8B. Pay attention to the variable address when programming, and consume the least number of addresses of the bus. Heap memory request, the system is strictly aligned according to the principle of alignment, so use time also try not to cross the addressing boundary.
2. When needed, the code can be copied for efficiency, although the code volume is increased, but it is worthwhile. Especially for loops, if the number of times is less, it is no harm to disassemble.
3. Bit operation,-1 right shift, left 1, it is still -1;-1 left shift, right 0, it is no longer 1.
4. Each application of the heap memory, preferably initialized, the inside is garbage data, and not empty.
5. In project development, often an engine exposes a pure virtual class, and its interface is the * * pointer variable of this class.
C + + Programming optimization experience (continuous update)