I have been mostly a Table functions user in mathematica. However I have noticed that in several examples where I used Array instead of Table to express the same result, it ran
Your statement:
However I have noticed that in several examples where I used Array instead of Table to express the same result, it ran markedly faster, especially as the dimension of table grew larger.
is not usually true for one-dimensional arrays. Take a look:
Cl;
Needs["PlotLegends`"]
$HistoryLength = 0;
a = 10^8;
arr = {}; tab = {};
Do[(
arr = {First@Timing@Array[# &, a], arr};
tab = {First@Timing@Table[i, {i, a}], tab};
), {10}];
ListLinePlot[{Flatten@arr, Flatten@tab},
AxesLabel -> {Style["Iteration", 14], Style["Time", 14]},
PlotLegend -> {Style["Array", 14], Style["Table", 14]},
PlotRange -> {{0, 10}, {1.6, 2}}]