Recursive Inlining
As already indicated, directly recursive methods cannot be inlined. This can be very problematic for the performance of a number of relatively simple data structures that rely on recursion for insertion, deletion, and searching. These recursive methods typically are directly recursive and fairly small. Performance will suffer greatly if we are forced to execute such methods without the benefits of inlining or some other form of call collapsing. What follows are mechanisms for iterative call collapsing and recursive call unrolling.
Some recursive methods are tail recursive. Tail recursion is evidenced by a method that recursively descends until its base case is reached. At that point some action is taken and the method terminates, ...
Get Efficient C++ Performance Programming Techniques now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.