[?] Speed up Sum while implementing the Jacobi method for linear systems?

Hi,
I’ve come across a strange performance issue while implementing the Jacobi method. In the attachment, the last parameter in the “Jacobi” function, just controls how a certain sum is computed: using the Mathematica Sum (WithSum==1) or by standard partial sums. In my understanding, this should be equivalent, however I see a whole different story…
For very small dimensions, say n <= 200, using Sum gives slightly smaller computational times. However, from a certain point on ( in my case n = 250), Sum suddenly starts taking forever… For n=250 using sum takes almost 40 times more then not using Sum!

How can this be??

Sum is really a symbolic function and can change methods based o e.g. length of summation. Much faster would be to use instead sum = A[[i]].aux; in that loop. There are other speed improvements one might make but this should be by far the most substantial.

Hi David, thank you for your reply. I am now warned about Sum!