model with model references building very slowly

19 次查看(过去 30 天)
Albert
Albert 2025-9-17,13:04
回答: TARUN 2025-9-22,10:48
Here are the versions I am using:
MATLAB Version: 9.14.0.2891782 (R2023a) Update 8
MATLAB License Number: 41098261
Operating System: Microsoft Windows 11 Business Version 10.0 (Build 22621)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.14 (R2023a)
Simulink Version 10.7 (R2023a)
Embedded Coder Version 7.10 (R2023a)
IEC Certification Kit Version 4.0 (R2023a)
MATLAB Coder Version 5.6 (R2023a)
OpenECU Blockset (Pi Innovo) Version 3.3.0 (r2023-1)
We recently converted our model to use model references and we are up to about 50. It takes around 4 hours to do a full build and 12 minutes to update the model. I don't remember exactly how long things used to take but I'm pretty sure the build took less than an hour before and the update model took maybe 6 minutes. What can I do to speed things up?

回答(1 个)

TARUN
TARUN 2025-9-22,10:48
When converting your Simulink model to use model references, it’s common to experience longer build and update times due to added overhead in code generation, compilation, and dependency management.
To improve performance, you can enable incremental builds and parallel model reference builds.
These features allow Simulink to reuse generated artifacts and distribute build tasks across multiple CPU cores or even multiple machines (workers).
So, to further speed up builds you can try the following workarounds:
  • If you're working locally, install “Parallel Computing Toolbox” and enable parallel model builds.
  • If you have access to a compute cluster, you can use MATLAB Parallel Server to distribute builds across remote workers. This can significantly reduce the total build time for large models.
  • You can launch a parallel pool using “parpool” and configure remote workers using “pctRunOnAll”.
For more information feel free to check the documentation here:

类别

Help CenterFile Exchange 中查找有关 Manual Performance Optimization 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by