Optimizing C++/Writing efficient code

From Wikibooks, open books for an open world
< Optimizing C++
Jump to: navigation, search

In this chapter, guidelines are presented to program in C++ avoiding inefficient operations and preparing the source code for a possible successive optimization stage, but without jeopardizing code safety or maintainability.

Such guidelines could give no performance advantage, but quite probably they don't give any disadvantage either, and therefore you can apply them without worrying of their impact on performance. You are advised to accustom yourself to follow always such guidelines, even in code portions that have no particular efficiency requirements.

  1. Performance improving features
  2. Performance worsening features
  3. Constructions and destructions
  4. Allocations and deallocations
  5. Memory access
  6. Thread usage
Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox
In other languages
Sister projects
Print/export