Matrix Inverse Timing

We compare the timing for an inverse matrix computation using the the Mathematica Compiler with C Code.

Uncompiled version

test[phi_, n_] := 
        Inverse[Table[phi^Abs[i - j], {i, n}, {j, n}]];

Timing[test[0.5, 1000];]

Compiled version

test2 = 
      Compile[{phi, {n,  _Integer}}, 
        Inverse[Table[phi^Abs[i - j], {i, n}, {j, n}]] ]

Timing[test2[0.5, 1000];]