Leistung
Wenn Sie bereit sind, Produktionscode zu generieren, können Sie Konfigurationsoptionen und erweiterte Optimierungen nutzen, um die Leistung zu verbessern. Sie können die in der Produktdokumentation von MATLAB® Coder™ beschriebenen Optionen und Optimierungen verwenden. Mit Embedded Coder® können Sie die Leistung zudem mithilfe von Ausführungszeit-Profilierung und Speicherauslastungsprofilierung analysieren.
Mit der Profilierung der Ausführungszeit können Sie:
Ermitteln, ob der generierte Code die Echtzeitanforderungen Ihrer Hardware erfüllt.
Herausfinden, bei welchen Codeabschnitten Leistungsverbesserungen erforderlich sind.
Die statischen Codemetrik-Berichte umfassen Metriken zu Dateien, globalen Variablen und Funktionen. Mit dem statischen Codemetrik-Bericht können Sie ermitteln, welche globalen Variablen und Funktions-Aufrufspfade sich auf die Leistung auswirken. Um die Größe des Stack-Speichers zu ermitteln, der zur Ausführung des generierten Codes erforderlich ist, können Sie eine Software-in-the-Loop- (SIL) und Processor-in-the-Loop-Ausführung (PIL) ausführen, die ein Stack-Auslastungsprofil ausgibt.
Apps
| Code Profile Analyzer | Analyze execution-time and stack usage profiles for generated code (Seit R2023a) |
Funktionen
Objekte
Themen
Ausführungszeit-Profilierung
- Execution Time Profiling for SIL and PIL
Why measure execution times for code generated from entry-point functions. - Generate Execution Time Profile
Enable execution-time profiling for a software-in-the-loop (SIL) or processor-in-the-loop (PIL) execution. - View Execution Times
Open the code execution profiling report generated by a SIL or PIL execution. - Analyze Execution Time Data
Use line commands to analyze execution-time measurements from a SIL or PIL execution. - Investigate Execution-Time Issues Using PMU Metrics
Analyze code execution metrics from the Performance Monitoring Unit of the hardware.
Speicherauslastungsprofilierung
- Generating a Static Code Metrics Report for Code Generated from MATLAB Code
Create and explore an example static code metrics report. - Static Code Metrics
The code generator performs static analysis of the generated C or C++ code and provides these metrics in the static code metrics report in the code generation report. - Stack Usage Profiling for Code Generated From MATLAB Code
Determine size of stack memory that is required to run generated code. - Preserve Unused Class Properties in Generated C/C++ Code
Preserve unused class properties or structure fields in the generated C/C++ code.
Ausführungsgeschwindigkeit
- Simplify Multiply Operations for Array Indexing in Loops
Replace multiply operations with add operations in array indexing in loops in C/C++ code generated from MATLAB code. - Generate SIMD Code from MATLAB Functions for Intel Platforms
Improve the execution speed of the generated code using Intel® SSE and Intel AVX technology. - Generate SIMD Code from MATLAB Functions for Apple silicon Platforms
Improve the execution speed of the generated code for Apple silicon platforms using ARM® Neon technology.