Is the C code generated by Matlab Coder Faster than my Matlab Code?
Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
2 votes
Partagez un lien vers cette question
Réponse acceptée
0 votes
Partagez un lien vers cette réponse
- 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 commentaires
Partagez un lien vers ce commentaire
- 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.
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB Coder dans Centre d'aide et File Exchange
Tags
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
