Is the C code generated by Matlab Coder Faster than my Matlab Code?
Ahora está siguiendo esta pregunta
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
Se ha producido un error
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
2 votos
Comparte un enlace a esta pregunta
Respuesta aceptada
0 votos
Comparte un enlace a esta respuesta
- 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 comentarios
Comparte un enlace a este comentario
- 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.
Comparte un enlace a este comentario
Comparte un enlace a este comentario
Más respuestas (0)
Categorías
Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.
Etiquetas
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- 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)
