Matrix performance

As a general comment on your code, you want to loop with the innermost index in the tightest loop since Julia arrays are column major.

Yeah I was trying to debug before optimizing. Thanks again :slight_smile:

Well, your original question was about performance.

I was trying to debug differences between using matrix notation and for-loop notation and first thing I was confused about was the timing difference and then later discovered they weren’t even giving same results.

Static in the sense that the array size is known at compile-time, not at runtime, allowing the compiler to specialize the code for the array length (e.g. completely unrolling small loops).

2 Likes