I created a Pluto notebook to capture some the performance tips in the manual, and everything seems to run fine on my home computer. But I am getting an odd result when trying to run the notebook on Binder using this Pluto-on-binder link.
Specifically, I copied the
@simd example from the Performance Annotations section, which is
@noinline function inner(x, y) s = zero(eltype(x)) for i = eachindex(x) @inbounds s += x[i]*y[i] end return s end @noinline function innersimd(x, y) s = zero(eltype(x)) @simd for i = eachindex(x) @inbounds s += x[i] * y[i] end return s end
and it runs fine where
innersimd runs roughly 8x faster than
inner on my home computer’s 8 threads.
However, when I run the notebook on Binder, the two functions are nearly identical in runtime.
Threads.nthreads() shows that I should have four threads available in the notebook, so I don’t understand why I am not seeing the
@simd performance boost. What am I missing here?