Increasing build time of my project when converting configurable to variant subsystem

3 vues (au cours des 30 derniers jours)
I tried converting configurable subsystem to variant subsystem through code. The code is increasing my project build time. Is there anything which we can do for optomisation?

Réponse acceptée

Anushka
Anushka le 5 Mai 2025
As you have correctly mentioned that converting a Configurable Subsystem can lead to increased build times, especially if not configured optimally. There are several ways to improve performance and reduce build time:
1. Efficient Variant Activation Times can be used; you can set the 'Variant Activation Time' to 'code compile' or 'startup' rather than 'update diagram' or 'init' to minimize simulation overhead.
2. Enabling Conditional Compilation can be helpful here, this ensures that only the active variant’s code is generated, reducing code generation and compilation effort. It can be enabled via parameter: 'GeneratePreprocessorConditionals' = 'on'
3. You can use Simulink.Parameter objects instead of hard-coded or global variables to improve code clarity and tuning options. Avoid setting unnecessary parameters as tunable.
4. Model References can be used for each variant branch if possible. This allows reuse of compiled models and faster incremental builds.
5. Unused Variant Choices can be removed. Redundant branches increase parsing and compilation times.
Hope this helps!

Plus de réponses (0)

Produits


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by