Using branch prediction with GCC
The GNU Compiler Collection's (GCC) C compiler offers a not so commonly known builtin function for branch prediction named __builtin_expect(). It is mostly used in critical code (e.g. it's quite wide spread along some portions of the Linux Kernel source code) but can also be used to optimize your own application.

