Is the C code generated by Matlab Coder Faster than my Matlab Code?
Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
2 voti
Condividi un link a questa domanda
Risposta accettata
0 voti
Condividi un link a questa risposta
- 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 Commenti
- 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.
Più risposte (0)
Categorie
Scopri di più su MATLAB Coder in Centro assistenza e File Exchange
Tag
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- 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)
