Tips to reduce build time

In no specific order,

  1. Use include guards to prevent multiple inclusions
  2. Profile your build : Set build verbosity to compute/display build time
  3. Easy with metaprogramming : pick your battles
  4. One-class/One-file doesn’t scale well
  5. Use precompiled headers
  6. Use precompiled headers well : only include third party there, no file modified frequently
  7. Use external tools (SN-DBS, Incredibuild…)
  8. Set build verbosity to the minimal setting when you don’t want to profile
  9. See if the pImpl idiom can help