• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to 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...
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,296
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.
Top