[Date Index] [Thread Index] [Author Index]
Re: Timing holes?
In article <8chbll$9f5 at smc.vnet.net>, Gavin Scott <gscott at netcom.com> writes: > With 4.0.2 under Windows 2000, Timing doesn't seem to work, or at least > not to the degree that I would expect. For example, > > Timing[N[Pi, 10^6]] > > returns something like 84 seconds, but the kernel eats up 40 minutes of > CPU (and wall) time performing the evaluation! > > Should I complain to support? Probably not. Refer instead to the reference guide entry for Timing. | Timing includes only CPU time spent in the Mathematica kernel. It | does not include time spent in external processes connected via | MathLink or otherwise. Nor does it include time spent in the | Mathematica front end. | | Timing[expr] includes only time spent in the evaluation of expr, and | not, for example, in the formatting or printing of the result. | result. Your example is one of those cases where the bulk of the CPU time is spent outside evaluation because the textual form of the result is so large. Most of the time reported by Windows 2000 is reported in creation of box structures from the underlying expression, transmission of the box form from kernel to the front end by MathLink, and in the front end's computation of linebreaks for the result. Try rerunning your example, this time suppressing the output. start = SessionTime; Print[Timing[N[Pi, 10^6];]]; SessionTime - start If you find that there is still a large discrepancy between Timing and operating system timing reports, then a query to Technical Support is highly encouraged. -- P.J. Hinton Mathematica Programming Group paulh at wolfram.com Wolfram Research, Inc. Disclaimer: Opinions expressed herein are those of the author alone.