Branch mis-predictions can cause an enormous amount of inefficiency and be very costly in terms of the run time of a function. Improving branch predictions involves two steps: identifying where mis-predictions are occurring and at what ratio to correct predictions, and optimizing the code at that location to help the processor predict more accurately. Depending upon the type of branch encountered there are different approaches to optimizing that will correctly take advantage of the built in branch prediction of most processors. Understanding these branch types and their tricks is an important step towards code optimization.