Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: profiling problem continued :-)

Author: David Dory

Date: 01:57:20 02/10/02

Go up one level in this thread


On February 10, 2002 at 04:55:19, David Dory wrote:

>>David Rasmussen wrote:
>>I don't know what Windows you are talking about (and this is also dependant on
>>the compiler, actually much more than the OS), but with gcc and MSVC on Windows
>>2000, clock() has a pretty high resolution, and is pretty consistent. If I do
>>something like the above, I get consistent results. If you're testing the
>>difference between to different ways of doing the same thing, and you loop
>>enough times, you will get an ok picture of which is faster, and by how much.
>
>His post showed he was comparing the speed of two functions, using two different
>methods of measuring that speed.
>
>My opinion is that he should compare both functions using ONE measuring method,
>rather than using TWO methods. To make the test as valid as possible, all other
>variables should be eliminated (in this case, the variable of the second time
>measuring method).
>
>Testing for ONE variable at a time, is the ONLY way to go.
>
>When you inadvertently add a second variable to the test - well. You can NOW
 ***** OOPS, dept: *****   ADD THIS: prove or disprove ANYTHING.

>>
>>But of course I use a profiler for complex problems. After all, clock() isn't
>>guaranteed by ANSI C to have a resolution higher than 1 second even.
>
>MSVC 6 states that clock() has a resolution of 1/1000ths of a second. But you
>can't believe that, in my opinion, if the OS is Windows.
>
>Any Windows OS, (and the older 16-bit'ers are certainly worse), can give you
>slightly different times for the exact same task, in my experience, with
>clumping. The compiler used is irrelevant.
>
>For instance, say you time your task at 4.327 seconds. Repeating the exact same
>task may give you a sampling of: 4.324, 4.327, 4.330, etc.
>
>What I haven't seen are results like: 4.326, 4.327, 4.328.
>
>The results are not perfectly the same, nor are they perfectly granular -
>they're "CLUMPY" <grin>, for lack of a better word.
>
>Sorry, I don't have 7, and know nada about it.
>
>Dave
>>
>>BTW. MSVC 7 (which is in beta), doesn't have a profiler. They threw it out from
>>MSVC 6, because they believed that it wasn't good enough, and that there were
>>many good third party options. But which? Is there a free profiler for MSVC
>>available? I use the profiler for gcc sometimes, but since this code is usually
>>being compiled with MSVC, a gcc profile isn't exactly precise.
>>
>>/David



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.