# 3.4 GHz Ryzen 5 slower to diagonalise large matrix than Intel i5-6300U 2.4 GHz

Sorry that this is quite a specific question but I need to diagonalise large matrices for the problem I'm trying to solve and can't for the life of me work out what's going on:

I was expecting that diagonalising these would be much quicker on my desktop than laptop, however there seems to be very little performance difference and in fact my more powerful desktop - every aspect of the system is significantly superior to my laptop - is about 15% slower.

The simplest code that produces the difference is:

AbsoluteTiming[Eigensystem[Table[RandomReal[{0, 1}], {i, 10000}, {j, 10000}],-10, Method -> "Arnoldi"];]


This takes on average about 64 seconds on my desktop but around 58 secs on my laptop. For the specific task I'm trying to solve that difference actually seems larger too.

Any idea what's going on and if there's anyway to solve it? I've read that Mathematica can be a slower on AMD chips than Intel but I seem to get faster performance in almost every task on my desktop than on my laptop... apart from this specific one.

Full specs:

Desktop: AMD Ryzen 5 2600 3.4 GHz 6-core (3.7 GHz Boost), 32 GB 3000 MT/s (2x16 GB) RAM, Intel EVO 970(R 3500, W 2200)

Laptop (Surface Book 1): Intel i5-6300U 2.4 GHz Dual Core (3.0 GHz Boost), 8 GB 1866 MT/s (2x4 GB) RAM, SSD (R 1500, W 600)

Edit: I notice that the CPU usage in Task Manager is slightly different - running at around 60-65% for the laptop but at 50% for the desktop. Is there perhaps a different implementation of Arnoldi for Intel that can take advantage of multiple cores? Edit 2 Logical processors view of task manager for desktop

• I am just curious: Does this happen also for positive-definite input matrices? – Henrik Schumacher Jan 28 at 19:16
• Nope the specifics of the matrix seems to make little difference to the difference in timings between the computers. – Ram Problems Jan 28 at 19:27
• Hm. Okay. I've just read this morning that ARPACK++ implements its own data type for machine precision complex numbers; compared to FORTRAN's native complex data type, this data type is said to severe performance issues... – Henrik Schumacher Jan 28 at 20:58
• I've added that to the post. Looks like all 6 are being used at ~100% – Ram Problems Jan 29 at 6:41
• It might be interesting to run Needs["Benchmarking"]; BenchmarkReport[] on both configurations. The results of tests 9 and (maybe 8 and 10) should be of particular interest. If the result of test 9 is similar to your tests with Eigensystem, this might be an indication for both suboptimal BLAS and fewer FMA units on the Ryzen. Btw., it would also be interesting to see whether Module[{m1, m2}, AbsoluteTiming[SeedRandom[1]; m1 = RandomComplex[{}, {1050, 1050}]; m2 = RandomComplex[{}, {1050, 1050}]; Do[m1.m2, {12}]]] (test 9 for complex numbers) leads to unexpected timings. – Henrik Schumacher Jan 29 at 12:44

• Probably Mathematica uses a non-parallelized implementation of Anoldi's method. In single-core performance, these processors are not that much different: https://cpu.userbenchmark.com/Compare/Intel-Core-i5-6300U-vs-AMD-Ryzen-5-2600/m27864vs3955. But thinking of it: By Haswell Quad Core executes this Eigensystem` at 400 % CPU speed (that's macOS' way of telling me that it runs on all cores without hyperthreading) and it only takes about 29 seconds...