title: C++ Tips for code optimization on ARM devices
body: <p>I have been developing C++ code for augmented reality on ARM devices and optimization of the code is very important in order to 
  keep a good frame rate. In order to rise efficiency to the maximum level I think it is important to gather general tips that 
  make life easier for compilers and reduce the number of cicles of the program. Any suggestion is welcomed.</p>
  
  <p>1- <strong>Avoid high-cost instructions</strong>: division, square root, sin, cos</p>
  
  <ul>
  <li>Use logical shifts to divide or multiply by 2.</li>
  <li>Multiply by the inverse when possible.</li>
  </ul>
  
  <p>2- Optimize <strong>inner "for" loops</strong>: they are a botleneck so we should avoid making many calculations inside, especially divisions, square roots..</p>
  
  <p>3- Use <strong>look-up tables</strong> for some mathematical functions (sin, cos, ...)</p>
  
  <p><strong>USEFUL TOOLS</strong></p>
  
  <ul>
  <li>objdump: gets assembly code of compiled program. This allows to compare two functions and check if it is really optimized.</li>
  </ul>