Unusual slow Julia code compared to C++?

The difference in iteration counts is telling. For x86 registers have more precision than memory for doubles ( in a register it’s 80-bit ), so you can end up with different results given initial conditions depending on how the registers are utilized. You may have denormals as well. Try setting the cpu to flush them in Julia, might be a source of the performance difference.

from: 50x speed difference in gemv for different values in vector

set_zero_subnormals(true)
1 Like