Is the C code generated by Matlab Coder Faster than my Matlab Code?
Sie verfolgen jetzt diese Frage
- Aktualisierungen können Sie in Ihrem Feed verfolgter Inhalte sehen.
- Je nach Ihren Kommunikationseinstellungen können Sie auch E-Mails erhalten.
Es ist ein Fehler aufgetreten
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
2 Stimmen
Teilen Sie einen Link zu dieser Frage
Akzeptierte Antwort
0 Stimmen
Teilen Sie einen Link zu dieser Antwort
- Debug the code and test it exhaustively in the initial version. Improving failing code is a complete waste of time. You need a trustwothry version to compare the results after each step of optimization.
- Use the profiler to identify the bottlenecks.
- Analyse the maths and adjust the model to reduce computations.
- Check if a (partial) vectorization improves the speed.
- Compare with the bottleneck improved by the Coder.
- Parallelize the code, if many cores of the CPU are in idle mode during the processing.
- Buy a faster computer (or if step 6 is fine: 10 faster computers).
4 Kommentare
Teilen Sie einen Link zu diesem Kommentar
- Buying used hardware with an age of 3 years for some 100 Euro. Only business PCs are reliable enough, because searching compatible drives or BIOS updates wastes a lot of time.
- Replace the disks and invest in stable backup system. A disk crash can cost a month, while saving a month of processing time is nearly impossible.
- Debug each function with an exhaustive unit test, which checks clearly the processing of valid and invalid inputs. You can loose weeks with finding a deeply nested bug if e.g. MathWorks decides to change the behaviour of strncmp('', '', 2) another time.
- The documentation of code is very important, because it supports re-using it for other projects. It saves a year of programming time, if you can use or expand a well tested toolbox.
- Now the optimization of the bottlenecks can start - see my former asnwer.
Teilen Sie einen Link zu diesem Kommentar
Teilen Sie einen Link zu diesem Kommentar
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB Coder finden Sie in Hilfe-Center und File Exchange
Tags
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
