Author: Robert Hyatt
Date: 19:50:33 11/11/02
Go up one level in this thread
On November 11, 2002 at 15:02:51, Scott Gasch wrote: >>If that is the essence of it, then my original question needs to be modified. >>Perhaps the $1,000,000 someone gave to the GURU Chess Programmer had to be not >>just for development of a new operating system but also development of a new >>OPTIMAL compiler for that operating system. >> >>Then the comparison would be between a chess engine compiled using the new >>optimal compiler and run using the new operating system versus the way it is >>done today. > >There are two main ways an OS can affect the speed of your program. 1. by >having slow system calls (calls the program makes that invoke kernel-mode >routines) and by having a poor scheduler / wasting time switching between jobs. > >Let's address each: 1. system calls in a chess engine are rare. Don't confuse >usermode library calls with system calls, though. printf is not a system call. Actually it may be. IE if using buffered I/O and the buffer fills up, it will definitely take a system call to dump the buffer. With unbuffered I/O any read/write turns into a system call. Otherwise I agree with your comments... >Sleep is. GlobalMemoryStatusEx is. WaitForSingleObject is. etc. So in short, >most chess _engines_ do not have very many system calls -- mostly calls to other >chess engine code or (more rarely) calls to a usermode runtime DLL. These, I >guess, are "part of the OS" too. In windows we're talking things like >kernel32.dll, ntdll.dll etc. In FreeBSD stuff like libc.so.4 etc. > >2. Even if the scheduler sucks, as long as nothing else is competing for cpu >resources your engine performance should not suffer greatly. > >There are other minor factors, like the speed of the I/O system / drivers etc. >But all in all I think the OS makes a very small impact on the performance of a >well written engine. > >I agree with Vincent that a compiler makes more of a difference. Ignoring the >fact that $1M might not be enough, why not just skip the compiler completely and >pay someone to implement an engine in hand-tuned, optimized for the platform >assembly language? Note, isn't fritz written largely in assembly language >anyway? > >Scott It is doable. But the issue becomes portability. To _really_ optimize means you study the pipeline specifications in great detail. And when you optimize to that level, the next version of the processor will probably break many of your assumptions and you get to start over. I went thru this from the Cray-1, to the Cray-XMP, to the Cray-YMP, to the Cray-C90, and finally to the Cray-T90. And, of course, none of that code works on any non-cray cpu, which is a real down-side...
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.