Remogenerate optimized code by removing code for out-of-range floating point to integer conversions did not improve execution speed,is there a problem?

2 visualizzazioni (ultimi 30 giorni)
I want to improve the running speed of the code converted from Simulink to C coder, so I tried setting the maximum running speed mode in it, but the result was similar to balancing RAM and speed mode. So I tried to modify more detailed settings, I tried to modify the settings to regenerate optimized code by removing out of range floating-point to integer conversion code, but still had no effect. Why is this? Is there any other setting in the model that can improve the running speed of the code? Or should I directly modify the structure of the code to improve speed?

Risposta accettata

Jatin
Jatin il 20 Ago 2024
Hi @peter,
Using the optimization technique of “removing out of range floating-point to integer” may not always give the required optimization specially if they are minimal compared to the other parts of your code.
Consider trying these methods and see if this helps you in improving your code performance.
  1. You can use the “Code Generation Advisor” to analyse the model for code efficiency. You can select multiple objectives and prioritize them. The advisor gives recommended actions that can limit efficiency objectives.
  2. Make use of “Clone Detector” to identify clones in your model that have identical block and connections which can lead to inefficient code generation.
  3. You can generate “static metric report” which performs static analysis on the generated code. You can get insights to various things like stack usage per function, review global variables per function, possible performance slow points etc.
You can refer to all the relevant documentations using the links below:
Apart from this you can try profiling tools to analyse the performance of your generated code using the given link:
Hope this was of help.
  1 Commento
peter
peter il 21 Ago 2024
@Jatin SinghThank you so much for your helpful assistance. Your input has been incredibly valuable to me and has really helped me solve the problem.I will immediately start trying and practicing.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Manual Performance Optimization in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by