Interesting anecdote, I was writing a ray tracer recently and instead of using real recursion I tried using a recursive template instead (because who needs i-cache). Basically, every bounce of a ray was a different function with &lt;current_bounce + 1&gt; until &lt;max_bounces&gt;.<p>The actual ray-tracing code wasn&#x27;t that long at all, but if you turned max_max_bounces up (say, 100+) &quot;code-gen&quot; time in visual studio blew up to over one minute. That was the moment when I appreciated what everyone was saying about C++ compile times being quite slow if you (mis)use templates.