Performance: recursion vs. iteration in Javascript

Posted by mastazi on Programmers See other posts from Programmers or by mastazi
Published on 2012-12-18T11:28:11Z Indexed on 2012/12/18 17:14 UTC
Read the original article Hit count: 430

I have read recently some articles (e.g. http://dailyjs.com/2012/09/14/functional-programming/) about the functional aspects of Javascript and the relationship between Scheme and Javascript (the latter was influenced by the first, which is a functional language, while the O-O aspects are inherited from Self which is a prototyping-based language).

However my question is more specific: I was wondering if there are metrics about the performance of recursion vs. iteration in Javascript.

I know that in some languages (where by design iteration performs better) the difference is minimal because the interpreter / compiler converts recursion into iteration, however I guess that probably this is not the case of Javascript since it is, at least partially, a functional language.

© Programmers or respective owner

Related posts about JavaScript

Related posts about functional-programming