Re: PowerPCs
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: PowerPCs
- From: withoff (David Withoff)
- Date: Fri, 1 Jul 1994 12:35:31 -0500
> In posting timing comparisons for Mathematica operations, > > please be careful to use ACTUAL ELAPSED TIME > > from pressing enter key until completion of operation. > Do *NOT* use the Timing command without explicitly saying so. > Do *NOT* trust the front end timings -- verify them with a stop watch. > Do *NOT* give comparisons of your times with others unless others have > stated explicitly their timing methods so you can be sure they are comparable. > > Richard Mercer I am not an expert on computer timing comparisons, but here are a few remarks that people doing timing comparisons of may find useful. 1) The Mathematica Timing function uses, and consequently inherits the reliability (or lack of reliability) of the C library times function. The times function (according to the UNIX man page) gives "the CPU time used while executing instructions in the user space of the calling process." The time reported is the time used by the Mathematica kernel process for evaluating an expression. It does not include the time for parsing the input, formatting the output, or the time used by child processes. 2) The time given by the front end when you select "Display timing after each evaluation" reports the change in the system tick count, as reported by TickCount (on the Macintosh), GetTickCount (under Windows), or a similar function. It is basically an electronic stopwatch. This time includes such things as the time used by processes unrelated to Mathematica, time used by the operating system for memory management, and the time used by the operating system for switching between processes. If you are trying to measure time used by the Mathematica kernel, this time is subject to arbitrarily large error. 3) A stopwatch operated by a human independent of the computer is subject to the same effects as (2), plus error due to human reaction time and due to individual definitions of things like "press enter key" and especially "completion of operation". The best method to use depends on what you are trying to measure. If you are trying to measure time used by the kernel for evaluation, and you trust the C library, then Timing is the easiest function to use. If you don't trust the C library, and know enough about operating systems to ensure that the Mathematica kernel gets the full attention of the cpu, then you can use stopwatch time. If neither of these cases applies to you, then you are stuck. Parsing and output formatting is done largely by the kernel. Timing[ToExpression[<input>]] causes <input> to be parsed during evaluation, so the result will include the time needed for parsing. Similarly, Timing[ToString[<input>]] will include the time needed for formatting output. PostScript interpreters and graphics renderers are either separate processes or are part of the front end. As with parsing and output formatting, there is no separate function for timing these things. You can get a rough estimate of the time needed to render graphics by subtracting the stopwatch time from the result returned by Timing, assuming of course that nothing else on your computer is using the cpu. If you want to estimate the time needed to do things in an environment with some typical set of other processes running and some typical amount time used for memory management and other operating system processes, then front end "Display timing after each evaluation" time or stopwatch time are probably appropriate. I do not know of anything that could cause a significant difference between front end time and stopwatch time. Dave Withoff Research and Development Wolfram Research