Disk Caching of Compilation Artifacts
Simscape™ software speeds up compilation of large models by automatically caching compilation artifacts in memory. However, memory caching does not persist between MATLAB® sessions. Therefore, when you start a new session, the first compilation of a model takes a longer time.
Instead of memory caching, you can choose to store the cached compilation artifacts on disk. Disk caching persists between MATLAB sessions and therefore improves the performance of the first compilation of a model in a given session. Use disk caching to accelerate model development and simulation processes between multiple sessions or multiple users.
When you enable disk caching, Simscape compilation artifacts are saved in the Simulink® cache file. When multiple users collaborate on different machines, copy
the model together with its cache file,
model
.slxc
. For more information, see
Share Simulink Cache Files for Faster Simulation.
How to Turn On Disk Caching
To turn on component reuse for a model:
In the model window, open the Modeling tab and click Model Settings. The Configuration Parameters dialog box opens.
On the Simscape pane, select the Store cached compilation artifacts on disk check box.
You can also use the equivalent command-line interface to set the model configuration parameter:
set_param(bdroot,'SimscapeCompileArtifactsDiskCache','on')