in reply to subroutine calls itself

What kind of performance issue did you expect?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: subroutine calls itself
by tux402 (Acolyte) on Jan 09, 2009 at 16:14 UTC
    I was just hoping that if the program is looping over and over that it won't suck up all my servers resources. As long as the program performance doesn't grow without bounds, I'm good.
      I was just hoping that if the program is looping over and over that it won't suck up all my servers resources.
      That is entirely up to the content of the sub-routine. If each call to your sub-routine fills a lexical array with a million floating point values and before you end the subroutine you call it again (and again, and again, ...) it will not take long before you exhaust your memory and then the swap-space and then your server dies. As such that has nothing to do with the fact that the subroutine calls itself, just that it was written badly.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James