JIT vs vectorization
Mostrar comentarios más antiguos
Is there a reference for general rules for when vectorization is faster than the JIT?
I actually prefer to use for loops. I believe it makes my code more transparent. Months later it is much easier to figure out what a loop is doing than an intricate vectorized statement.
Is JIT as fast as vectorization for loops (when the code in the loop is acceptable for the JIT)?
Thanks, Ariel
Respuestas (1)
Matt Fig
el 2 de Mzo. de 2011
1 voto
JIT is just as fast as vectorization,... sometimes.
There is no published guide for using JIT because TMW doesn't want you to write code specifically for the JIT accelerator.
The two best tips that I know of for making loops as quick as possible:
- Pre-allocate arrays.
- Move repeated code to outer loops or completely outside if possible.
For plenty of examples, search CSSM.
2 comentarios
Ariel Balter
el 2 de Mzo. de 2011
Matt Fig
el 2 de Mzo. de 2011
http://www.mathworks.com/matlabcentral/newsreader/
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!