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 次查看(过去 30 天)
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?

采纳的回答

Jatin
Jatin 2024-8-20
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 个评论
peter
peter 2024-8-21
@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.

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by