• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Recursion taking up far too much memory... any ideas?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recursion taking up far too much memory... any ideas?


  • Subject: Re: Recursion taking up far too much memory... any ideas?
  • From: Daniel Dalquen <email@hidden>
  • Date: Wed, 6 Jun 2007 00:15:42 -0400


On 05.06.2007, at 13:29, John Stiles wrote:

most kinds of recursion (particularly tail recursion) can be converted into non-recursive code

If I remember correctly from my algorithms and data structures lecture five years ago, ALL recursions can be expressed by a non- recursive loop structure. Recursion is very nice, because you can express things very cleanly and create nice-looking code. But depending on the depth of the recursion, you have a way larger memory footprint because each call gets its own stack frame.


That said, Sam, if you want to reduce the memory usage of you code, try re-writing it in a non-recursive way.

Cheers,
Daniel
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Recursion taking up far too much memory... any ideas? (From: Sam Stigler <email@hidden>)
 >Re: Recursion taking up far too much memory... any ideas? (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Best way to play a MP3?
  • Next by Date: Re: Best way to play a MP3?
  • Previous by thread: Re: Recursion taking up far too much memory... any ideas?
  • Next by thread: Re: Recursion taking up far too much memory... any ideas?
  • Index(es):
    • Date
    • Thread