Is there a penalty (in terms of speed) associated with the use of RECURSIVE subroutines?

tim18
Total Points:
68,947
Status Points:
68,947
Black Belt
November 4, 2009 9:54 AM PST
Rate
 
#1
It certainly appears that all these data must be replicated on stack for each recursive call.  I don't see that a generalization could be made about the performance, even if I assume that your alternative is an array of those "complicated structures."  If there is no reason for each instance to have its own copy of those arrays, it seems you could get better cache locality by sharing a single copy, if only one thread is involved.


Intel Software Network Forums Statistics

8488 users have contributed to 31626 threads and 100733 posts to date.
In the past 24 hours, we have 35 new thread(s) 132 new posts(s), and 199 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983