MathGroup Archive 1999

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

Search the Archive

Re: how decrease computation time?

  • To: mathgroup at
  • Subject: [mg18564] Re: how decrease computation time?
  • From: "Martin Rommel" <rommel at>
  • Date: Sat, 10 Jul 1999 02:18:53 -0400
  • References: <> <7m1850$5i0$>
  • Sender: owner-wri-mathgroup at

> Hi, I' m a new user of Mathematica and I try to translate C program in
> Mathematica language;
> When I do a calculation with Mathematica it takes too many time
> compared with C program (6.4 second versus 0.1second);
> Please excuse me for the lentgh of my message but I really don't know
> what to do for increase the speed;
> (Note that separately each function doesn't take many)

I did not check your code but a frequent cause for the problem you describe
is that Mathematica does not evaluate expressions before it deems it
necessary. That can result in internally building up huge data structures
before they get evaluated. If you run the same commands individually the
expressions get evaluated earlier and things are faster. Try putting some
Evaluate commands into your code.

Sorry for such a phenomenological answer but even after reading the sections
about evaluation control and non-standard evaluation a couple of times I
feel not quite on top of things. I wish somebody wrote Mathematica
Evaluation Control for Dummies or so.


  • Prev by Date: Re: Livegraphics3D
  • Next by Date: Re: Re: "At long last, Sir, have you no shame?"
  • Previous by thread: Re: how decrease computation time?
  • Next by thread: Re: how decrease computation time?