Optimising iterative solution of small system

Profiling only runs the code once so it’s possible that the samples were noisy. Have you tried profiling a repeating loop instead?