The results ARE wildly inaccurate.

I'm using the trial version of 2.6, downloaded February 5th, 2006.

The time in seconds in the results is way off.

For instance, I ran the mandelbrot program for about 10-15 seconds, and it said Main() (with children) took 262 seconds.

That was very suspicious, so I tried running the application and immediately closing it. Although it ran for less than a second, it said Main() (with children) took over 40 seconds.

I think you can even see this in the screenshots in the help file that's included, in the screenshot for the "All methods panel".

The hit count of SetPixelColor() is 115104 -- one for each pixel, right? But the time for Main() (with children) is listed as 106 seconds. Did it really take that long?? I don't think so.

This doesn't just affect Main(). All the times seem off.

What's going on here?

Comments

  • More evidence that the timings are off, taken from the screenshot in the profiler's own help file. (The same screenshot I mentioned above.)

    The time for Main() (excluding children) was listed as 70+ seconds.

    Main() contains only the following code:

    Application.Run(new Form1());

    That took 70+ seconds, excluding children??
  • Hi there,

    many thanks for pointing out a common misunderstanding with interpreting profiling results. The time shown for Main is basically the total time that the application runs for. The reason for this is that a Windows Forms application spends most of its time waiting to respond to windows messages. ANTS Profiler includes this waiting time in the results. You can try this out by starting up profiling of the Mandelbrot application and letting is run for say 20 secs before closing it down. I've just done this and it correctly reports the time for Main as ~20 seconds. Approx 0.3s is spent in the constructor of the Form, whilst the rest is spent waiting on the line Application.Run(new Form1());

    You can find out where exactly it is waiting by choosing to profile all .NET methods - you will discover that it waits in System.Windows.Forms.UnsafeNativeMethods.WaitMessage()

    Best regards,

    Tom Harris

    Red Gate Software Ltd
  • I don't think you read my message.

    I ran the application for 10-15 seconds and it reported Main() taking 262 seconds.

    I ran it for one second and it reported Main() taking 40 seconds.

    How do you explain this?
  • Right, but the time spent waiting for messages doesn't occur within the body of Main(). As you said, it occurs within WaitMessage(), which is probably called by Application.Run() (directly or indirectly).

    Thus, I would expect the time spent waiting to show up in the time with children and not in the time excluding children.

    The time excluding children for Main(), I think, should be almost nothing. It allocates an object and calls Run(). The rest of the time is spent there, inside Run() -- inside a child of Main().

    So I'm not sure why the time is showing up in Main() (excluding children).

    But please read my previous message and don't just reply to this one. (The message about it showing 40 seconds when I ran the application for one second.) That's the bigger issue here.
  • This topic has been superceded by the following two topics:

    * Total seconds counts are wrong
    * Time excluding children seems wrong

    Go there for the continuation of this discussion.
This discussion has been closed.