Author: Tom | Posted on: 10/2/2008 3:00:00 AM | Views : 828

Thought I would give a little details on one type of optimization that it is possible to see and explain what it is and how it affects things so that if you come across it, you will understand what is happening.
So there is this concept of tail calling which is where the compiler will optimize code to save execution of instructions as well as saving some reads and writes of stack memory.  This happens under certain circumstances when a function ends by calling another function (hence tail calling).  For example, if we have the following: