How much time does it take for matlab to print a line in the command window
27 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Patrik Ek
el 20 de Dic. de 2013
Respondida: Jan
el 20 de Dic. de 2013
Hi,
I have a function that prints a line in the command window every time it is run. This function is run for a different number of times depending on the situation, but at maximum like 3000 times. This is why I wonder how much time it takes for matlab to actually write the line in excess of the time it takes to run the command. I Expect this operation to slow down my script quite a lot. This is a little hard to test since the program runs on a multi core processor and thus the cpu time is higher than the actual time passing. Also tic-toc does not take care to the delay due to printing.
If anyone anything about this please respond.
BR Patrik
0 comentarios
Respuesta aceptada
Jan
el 20 de Dic. de 2013
The updates of the command window are performed in the Java level of Matlab. The execution times vary randomly and can slow down the processing remarkably.
I ran a large program with several hundred thousands line of code, which needs some seconds to execute only. When I have to start in in a batch mode for thousands of cases, the delay caused by the screen output is painful and therefore I've implemented a "fast" mode, which calls the program through evalc() and suppressed the complete output except for warning or errors. This saves 20% to 30% runtime(!) and nobody is able to read 1000*500 lines of messages at all.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!