Recursive procedures do not necessarily contain list-widgets. So it does not really make sense to add an exit condition to the list widget. It will not solve the underlaying problem. The number of list elements is determined by the filter-expression.
Handling 100000 elements internally is not the real problem. It seems as soon as we do create that many DOM elements “in one go”, we do get a problem.
At the moment there are some pull requests underway, which try to explore the problem a bit closer.
As I wrote. No list-widgets are involved.
Only the widget-prototype is involved. Eg. The most common problem new users face is {{}}
which is the shortcut for <$transclude/>
in the tiddler preview pain → It reads its own tiddler content and renders it. So it reads <$transclude/>
and renders → and so on.
Internally behaviour like this creates a “nested” widget-tree. So transclusion inside transclusion inside transclusion … The widget-depth can be counted.
At the moment the maximum number of nested transclusions is hard-coded to 1000. That’s OK for the TW UI, which needs about a depth of 60 - maximum. So there is plenty of headroom. – But –
Recursive procedures like the one, discussed in this thread or the Fibonacci series are designed to “behave well”.
They “only” need more time (and memory). So the hardcoded max of 1000 may not be enough.
The main problem is, that the underlaying widget-prototype functions are performance sensitive. Even adding a new if(){}
command, at the wrong place, can have performance related side effects.
I did suggest tv-max-widget-tree-depth
in an earlier post. That cannot happen.
It did create a general slowdown of creating the right sidebar → More → Tags list at tw-com from ~260ms to >310ms. That’s about 20% increase for “normal” use on my PC.
A different way, that does not have a negative performance impact, introduces a mechanism, that we (the devs) do not really want. It may limit future development “freedom”, because once published we cannot get rid of it anymore, for backwards compatibility reasons.
So a completely new mechanism will be evaluated, which should avoid the need to “publish” an internal “private” variable.
hope that makes sense
-mario