I have a function that is a bit too slow for Manipulate[]
. Right now I plan to cache outputs outside the manipulation and just have the manipulator select among cached outputs, but I am wondering if some better version of that trick exists.
Basically, I am creating a CDF presentation in which I intend to show the effect of different values for a correlation parameter $\rho$ in Monte Carlo simulations to the audience using Manipulate[]
to show the resulting sample histograms. The simulation process is too slow to make for a good user experience as a live function, so one way or another I will have to cache some things.
It seems that if I am clever about writing a Module
as an argument to Manipulate
I should be able to make it cache, say, 199 different output sets corresponding to the various % correlations between -0.99 and +0.99.
Manipulate
? If it's only one, the minimal effort solution might be just precomputing a number of frames to show and usingListAnimate
. $\endgroup$Manipulate
it's possible not to update the output before releasing the slider, or updating the output only with "low quality" (actually custom output can be used) while dragging the slider. This lets you give instant feedback when dragging the slider and a precise result will appear a second or two after you release the slider. If the simulation is even slower than 1-2 seconds then you really need to cache something. How the caching is best implemented depends on the details of the problem. The most general solution (e.g.ListAnimate
) is not necessarily the best. $\endgroup$ControlActive
to get low-res behavior (as recommended in the "Advanced Tutorial") but as you anticipate it was too slow.ListAnimate
is an interesting idea but I rather like having variable values on the scrubber. $\endgroup$