Importance of compiler optimizations

Example program

Used the following program to illustrate the effect of optimizations.
//counts the number of ones in an array of booleans
sum=0;
for (i = 0; i < n; i++) {
  if (a[i]) sum++;
}
return sum;

Why is profile-guided optimization not the norm?

History and future of compilers

Overview of a compiler