Closed yha closed 3 years ago
Generally you should use a "combined" for
syntax.
@manipulate for i in 1:10, j in 1:10, ...
...
end
Only one @manipulate
per widget. Otherwise, changing the outermost parameter has to re-create the whole tree beneath it, which is (as you've noticed) slow.
I'm aware that @manipulate
supports this syntax, but it doesn't remove the need for nested @manipulate
. Nested @manipulate
is required whenever the inner widgets depend on the setting of outer widgets. Not having them is a pretty severe limitation on what can be done with Interact
.
And it generally works fine at first but becomes slow gradually, suggesting there is some leak.
In a complex notebook, I find that creation of widgets (in nested
@manipulate
) becomes very slow (more than 10s) with continuing interaction. Reloading the page helps temporarily. Here is a simple reproducer only with widgets and no plots (using##
to represent cell breaks):After some interaction with the last cell, the first two become sluggish to render the inner widget when changing the top slider. (my actual notebook has no more than two levels of nesting, but has more cells with several complex plots).