Julia loops are fairly low-impact when accessing arrays in column-major order <http://docs.julialang.org/en/release-0.4/manual/performance-tips/#access-arrays-in-memory-order-along-columns> (i.e. for j = 1:n; for i = 1:m; x[i,j]; end; end), so most of the cost will be in unnecessary memory allocation. See this illustrative gist <https://gist.github.com/stillyslalom/adfd514a6e856b6012ff> and the resulting plots:
<https://lh3.googleusercontent.com/-cEC9TVYYEiA/VkgkxLsC-nI/AAAAAAAAE2k/Jk55Nw41qQk/s1600/mesh_v_broadcast.png> <https://lh3.googleusercontent.com/-ODt0kkW2ZCw/Vkgkz2sOOyI/AAAAAAAAE2o/KEu_Qnw01PY/s1600/mesh_v_broadcast_malloc.png> On Saturday, November 14, 2015 at 8:48:51 PM UTC-6, digxx wrote: > > To state it correctly...The amount of operations wont be different but Im > wondering if it also takes time to jump to the next saved entry when using > repmat or is it just the memory storage that makes it take so much longer > than doing it with broadcast? >
