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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access