• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Is there anything wrong with recursion?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,342
Hi,

I thought I read something before about recursion being slow in JASS (or risking breaking the map) but would just like to make sure there's nothing wrong with it.

The recursive function(s) I am thinking of using would have calls equal to the size of the problem set (O(n)) and the average size would be around 3-10...
 
I think excessive recursion runs the risk of hitting a thread stack size limit (if it has one?). If you are using O(n) problems then it might be good to add a reasonable safety, eg n < 100 in case large input is given to it. This would prevent excessive performance degradation, thread crashes due to the op-limit and potentially let you catch some bugs.
 
Status
Not open for further replies.
Back
Top