Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Weird compiler problem

Author: Dieter Buerssner

Date: 05:43:55 10/30/00

Go up one level in this thread


On October 30, 2000 at 08:08:37, David Rasmussen wrote:

>I made a profile on the program on the AMD/win98 machine. It shows that 60% of
>the time is used by search()! Usually when I make the exact same profile, with
>the exact same compiler, I get that FirstBit and Evaluate takes up the majority
>of the time. So something was weird in my search() function.
>After a little examination I found that it was my call to clock() in search that
>wasted all that time. When I started doing time control code, I found that there
>were no penalty (even on win98) in calling clock() at every node, instead of
>calling it once a second or so. Now it looks the other way around. Why?
>
>Is clock() implemented differently in win98, or in win98 win running on AMD ??

Clock is certainly differently implemented under NT and Win98. In NT it returns
CPU-time, while in Win98 it returns elapsed time. So under NT (or under most
OS) clock() might not be suitable for chess programs elapsed time function.
Nevertheless, it is weird, that it is faster under NT in your example, if I have
read your original message correctly. I know, that there are different
implementations of some low level time functions under NT and Win98. I.e.
the HighPerformanceTimer on the computers I tried have a frequency of about
1MHz, while I have seen a problem on one NT computer, where it had a rate of
something like 500 MHz - most probably the CPU speed. The 1 MHz probably comes
from the built in timer, which is much more complicated to access (via in/out).
Perhaps these instructions need many wait cycles on Athlon. The 500 Mhz timer
comes probably from built in timer of the cpu, which can be read with one
instruction. Perhaps, the clock is based on the low level timer functions. Just
speculation ...

Regards,
Dieter




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.