Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
performance [2019/08/05 11:47]
neils [Tip #8 REPEAT ... UNTIL is faster than FOR ... NEXT]
performance [2019/09/03 08:55] (current)
neils [Tip #9: Know the optimizer]
Line 98: Line 98:
   until i! = 100   until i! = 100
   ​   ​
-==== Tip #9: Know the optimizer ====+==== Tip #9: Use LSHIFT() and RSHIFT() ==== 
 + 
 +It's much faster to multiply or divide by powers of two using bit shifting operations. Use [[lshift|LSHIFT()]] and [[rshift|RSHIFT()]] whenever you can. 
 + 
 +==== Tip #10: Know the optimizer ====
  
 **XC=BASIC** features a built-in optimizer that replaces commonly used program sequences with faster opcode sequences. To make good use of the optimizer, bear in mind the following program structures that can be optimized: **XC=BASIC** features a built-in optimizer that replaces commonly used program sequences with faster opcode sequences. To make good use of the optimizer, bear in mind the following program structures that can be optimized: