Main Content

Reuse components during compilation

Option to specify whether to enable component reuse for scalable and incremental compilation

Since R2021b

Model Configuration Pane: Simscape

Description

Component reuse during compilation helps you speed up compilation of large models. When you enable component reuse:

  • During the first compilation, the solver compiles one instance of each reusable component and then reuses these compilation artifacts for repeated instances in the model.

  • During subsequent compilations, the compilation time is further reduced because if a reusable component is unchanged, the solver does not recompile it. This optimization applies to all the reusable blocks and subsystems in the model, independent of whether there are multiple instances or just a single instance.

To take advantage of scalable and incremental compilation, besides enabling component reuse, you also need to designate which components are reusable. For more information, see How to Designate Reusable Components.

Settings

off (default) | on
On

Use scalable and incremental compilation. Compile each reusable component once and then reuse these compilation artifacts for other instances of the same component in the model. For subsequent compilations, do not recompile reusable components if they are unchanged.

Off

Do not use scalable or incremental compilation. Use the regular model compilation algorithms.

Recommended Settings

ApplicationSetting
DebuggingNo Impact
TraceabilityNo Impact
EfficiencyOn
Safety precautionNo Impact

Programmatic Use

Parameter: SimscapeCompileComponentReuse
Type: character vector | string scalar
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced in R2021b