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에서 Startup and Shutdown에 대해 자세히 알아보기
			
	제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!