|
|
|
|
|
by fluffything
2171 days ago
|
|
> Tail call removal. A recursive function that ends in a call to itself can often be rewritten as a loop, reducing call overhead and reducing the chance of stack overflow. Most important: this optimization enables pipelined execution. When people talk about a CPU executing an integer add instruction in ~1 cycle, what they actually mean is that the add has this latency when the CPU pipelines are full. If you have an 11 stage pipeline... the add can often have a latency of ~11 cycles... if you write the _right_ code for it. |
|