Same code works slower in linux than windows
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Andreas Goser
2011-9-22
Just to make sure that the OS is the only difference:
Same machines? Same architectures? Same MATLAB Release?
Daniel Shub
2011-9-22
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.
采纳的回答
Jan
2011-9-22
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 个评论
Daniel Shub
2011-9-28
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!