Main Content

Troubleshoot Unsatisfactory Real-Time Performance

I want some recommended methods to improve unsatisfactory real-time application performance.

What This Issue Means

Run-time performance and reduce the task execution time (TET) of a model depend on model design, target computer capacity, and target computer utilization.

Try This Workaround

You can improve run-time performance and reduce the task execution time (TET) of a model with these methods.

Enable Compile with GCC -ffast-math Option

The Compile with GCC -ffast-math option enables the GCC compiler -ffast-math option when compiling real-time application code. This option is disabled by default for Simulink® Real-Time™ models.

By enabling the Compile with GCC -ffast-math option, you provide the compiler with more flexibility to optimize floating-point math at the expense of deviating from the IEEE-754 floating-point standard.

For more information about the -ffast-math option, see the Semantics of Floating-Point Math in GCC and

Run Performance Tools

Use these performance tools:

  • To profile execution of a real-time application , use the startProfiler command.

  • To run the profiler and plot the results, use the plot function.

For more information, see Execution Profiling for Real-Time Applications.

Customize Concurrent Execution on Multicore Target Computer

You can improve run-time performance by configuring your model to take advantage of your multicore target computer:

  1. Partition the model into subsystems according to the physical requirements of the system that you are modeling. Set the block sample rates within each subsystem to the slowest rate that meets the physical requirements of the system.

  2. Create execution tasks and triggers, and then explicitly assign subsystem partitions to the tasks. See Partition Your Model Using Explicit Partitioning and Multicore Programming with Simulink.

    You can also use the Simulink Schedule Editor to partition the model. In the Simulink Editor, click the Modeling tab and select Design > Schedule Editor. For more information, see Create Partitions from a Rate-Based Model.

  3. Run the real-time application.


Do not use MATLAB System blocks in the top level of Simulink Real-Time models in which task execution is explicitly partitioned. These blocks generate a TLC error when building the real-time application, for example:

"Unable to find TLCBlockSID within the Block scope"

Minimize the Model

You can improve run-time performance by minimizing your model to make more memory and CPU cycles available for the real-time application:

  1. On the Solver pane, increase Fixed-step size (fundamental sample time). Executing with a short sample time can overload the CPU.

  2. Use polling mode. See Execution Modes.

  3. Reduce the number of I/O channels in the model.

Contact Technical Support

For additional guidance, refer to these sources:

For Speedgoat hardware issues, contact Speedgoat Tech Support:

See Also

Related Examples

More About

External Websites