Re: how decrease computation time?
- To: mathgroup at smc.vnet.net
- Subject: [mg18564] Re: how decrease computation time?
- From: "Martin Rommel" <rommel at semitest.com>
- Date: Sat, 10 Jul 1999 02:18:53 -0400
- References: <37610ED6.C47372B7@diamant.ensg.u-nancy.fr> <email@example.com>
- Sender: owner-wri-mathgroup at wolfram.com
> 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. Martin.