Matlab running slower on Linux than Windows 7
Show older comments
I am having a problem running a piece of code with Matlab 2014a with a Ubuntu 16.04 installation. The computer running Ubuntu performs worse than my laptop running Windows 7, in that the same piece of code takes over twice as long to run on the computer with Ubuntu (~ 50 minutes for computer with Ubuntu, 23 minutes for laptop with Windows) for reasons that I don't understand. There are no differences in the code between comparisons.
The hardware for the computer with Ubuntu is an intel core i7-4770 cpu @ 3.4 GHz (8 cores) with 32 Gb of ram. The hardware for the laptop running Windows 7 is an intel core i5-3427U cpu @ 1.8 GHz (4 cores) with 4 Gb of ram.
The benchmark results for the laptop with Windows 7 is not great:


While the benchmark results for the computer with Ubuntu are much better:


I did try increasing the Java heap memory to see if this would speed things up on the ubuntu computer. I also tried increasing the process priority with the command "renice" but that didn't change anything. My complaint is that the computer running Ubuntu takes much longer to run the same code, but I don't have any errors or anything else to go off of besides comparing run times. I'm quite confused as to why I see worse performance with a more powerful machine, and I would appreciate any insight or help with the problem, thanks!
5 Comments
Walter Roberson
on 2 Mar 2018
I do not see mention of the number of cores on each machine?
Katherine
on 2 Mar 2018
Walter Roberson
on 2 Mar 2018
Note that MATLAB will not use hyperthreads by default, as hyperthreads can be slower that not hyperthreading for heavy computation (hyperthreading makes the CPUs run hotter, so CPUs often deliberately slow down for hyperthreading to control heat. But hyperthreading works by taking over when the other thread is idle for I/O, and for heavy mathematics the cores are not idle for I/O -- so you end up running the computations in serial anyhow, but at reduced speeds compared to if you had not tried to use hyperthreading.)
... Not that this explains what you are seeing: just don't expect 8 cores worth of performance.
Katherine
on 4 Mar 2018
Benjamin Kraus
on 5 Mar 2018
What version of MATLAB are you running on both machines? There are been a lot of performance optimizations, so if Windows 7 is running the newer version of MATLAB, that could explain the difference.
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!