Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RE: puzzling difference in speed

  • To: mathgroup at
  • Subject: [mg34795] Re: [mg34737] RE: [mg34688] puzzling difference in speed
  • From: "Fred Simons" <f.h.simons at>
  • Date: Fri, 7 Jun 2002 01:08:58 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

Hartmut Wolf remarked with respect to the given examples::

> Obviously the computing machinery for Array behaves differently when the
> dimensions are given explicitly or introduced as an expression (to be
> evaluated)

It seems to be more complicated. Have a look at the following results:

n=100; t1 = Table[0, {n},{n},{n}];

t = array[Plus, Dimensions[t1]];
u = array[Plus, {100, 100, 100}];
Equal[t, u]

Out[4]= True

ReplaceAll[t, array\[Rule]Array]; // Timing
ReplaceAll[u ,array\[Rule]Array]; // Timing

{0.65 Second,Null}
{0.77 Second,Null}

Apply[Array, t]; // Timing
Apply[Array, u]; // Timing

{4.51 Second,Null}
{0.72 Second,Null}

Despite the fact that t equals u, we have the same difference in timing.
Does Mathematica 'remember' the way the expression t has been computed?

Fred Simons
Eindhoven University of Technology

  • Prev by Date: RE: PlotVectorField
  • Next by Date: Re: On Limit[ f[x,y], x->x0 ]
  • Previous by thread: RE: puzzling difference in speed
  • Next by thread: Re: puzzling difference in speed