4 ms·
Did you start Julia with multiple threads? Julia unfortunately starts with only a single thread by default, and the slow time you reported (14 ms) makes it appe
by celrod 5y ago
Did you start Julia with multiple threads?
Julia unfortunately starts with only a single thread by default, and the slow time you reported (14 ms) makes it appear that this may have been the case.
You can start `julia -t4` for 4 threads, for example.
Or you can set the environmental variable `JULIA_NUM_THREADS=4`.
If you were using the same number of threads for both, mind letting me know which CPU you're using?
- cycomanic 5y agoYou were correct, I just tested with julia -t4 and that improved times by about a factor of 3. N = 2000 27.137 ms (24 allocations: 61.04 MiB) 49.496 ms (3 allocations: 61.05 MiB) 4.597 ms (2 allocations: 61.04 MiB) The CPU is a ryzen 3600 btw.
- celrod 5y ago-t6 would give 6 threads. FWIW, the Ryzen 2600 with 6 threads took 6 ms, so the 3600's floating point and vector improvement is quite evident from your timing. (The 2600 emulates 256-bit operations with 2x 128-bit, while the 3600 has full support.)
- cycomanic 5y agoYes, I've also run with 6 threads and get an additional minor improvement on the loopvectorized code (3.9 vs 4.5ms). I have to say LoopVectorization.jl is quite an impressive piece of work. I have to try out some more julia at some point, unfortunately pretty much everything I do is using complex values.