Same code works slower in linux than windows
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am wondering whether it is a common problem that same code works slower when it's under Linux. I tested a same code which about RPCA on image, something like image recovery. And I found the executing time is in Win7 100s but 300s in Ubuntu 11.04.
THX advance.
3 comentarios
Andreas Goser
el 22 de Sept. de 2011
Just to make sure that the OS is the only difference:
Same machines? Same architectures? Same MATLAB Release?
Daniel Shub
el 22 de Sept. de 2011
Often proprietary video drivers are optimized for Windows and inefficiently reversed engineered for Linux. As Jan said in his answer use the profiler to figure out the difference.
Respuesta aceptada
Jan
el 22 de Sept. de 2011
Windows 7 has a very advanced memory manager. If the code allocates a lot of temporary memory, this might be the cause of the differences.
If the code accesses the harddisk or the data are located on a network path, there may be further differences caused by the operating system, e.g. the Virus checker or the network device driver.
If the function uses compiled MEX files, there can be a big difference caused by the optimization capabilities of the used compilers. Sometimes the SSE-instructions of the MSVC compiler are excellent, sometimes GCC is much smarter.
Please use the PROFILEr to find the commands, which cause the different speed. Then a more explicite investigation is possible.
2 comentarios
Daniel Shub
el 28 de Sept. de 2011
You might be able to see these effects more generally with "bench" and changes in the 2-D and 3-D tasks. You might also be able to modify your code so the drawing is done with an invisible figure. and only showing the figure at the end. This might speed things up again.
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!