Hello.
Apologies for the late response – just seeing this thread today.
When I first had my hands on a preview version of v.18, one of the first things I did was to try out a re-written version of a custom function (JSONQuery) which relies heavily on recursion.
I knew that While would help make the code easier to read.
By virtue of the fact that it would obviate the aspect that involved maintaining “state” variables across iterations I expected that the code would perform better.
And then, there was the question of what sort of performance change would there be with having a repeated task performed numerous times using While, versus using recursion.
I no longer have metrics to share, but the performance gain was not significant enough for me to consider releasing a special version of the CF that would use While (but which would not be compatible with pre-18 FMP).
As I recall, queries that heavily taxed the CF would take perhaps 30 seconds in the original version of the CF, and these same queries took between 28 and 29 seconds using the While version. Queries which were more routine and lighter had deltas which could be measured in milliseconds.
These differences seemed very small to me, and I decided it was not worth the overhead involved with maintaining two versions of the function, or with losing v.16, v.17 compatibility.
Really, the plus that I feel was there to be gained (in my particular scenario) was that While would help make a difference with respect to the code being easier to read for anyone unfamiliar with the coding style that I was using when I wrote the custom function.
I hope that the above may be helpful to anyone interested in this topic.
Kind regards to all, and @Cecile, thanks for bringing this forum to life.
-steve