Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Starting to optimize

Author: David Mitchell

Date: 11:55:43 02/29/04

Go up one level in this thread


On February 29, 2004 at 05:50:28, Matthias Gemuh wrote:

>On February 29, 2004 at 04:07:18, David Mitchell wrote:
>
>>>
>>>
>>>You have just described my 3-year-old engine, except that mine can SEE.
>>>How I wish it could see some good moves.
>>>
>>>/Matthias
>>
>>Have you profiled your program, yet? That should give you some good suspects for
>>such criminal behavior! ;)
>>
>>When you step through it, slowly, do you notice calls to functions being
>>repeated unnecessarily? For instance, in my program, I have the first function
>>check that the game isn't over from the last move that was made. To do that, it
>>generates _all_ the moves for the next ply, and checks each move until it finds
>>the first legal move.
>>
>>Now that the game isn't over, it again generates all pseudo legal moves,
>>repeating the work it just did. Since it happens pretty fast, it wasn't real
>>easy to see that was happening at first.
>>
>>Before you get into issues of cache efficiency, etc., be sure to check out the
>>overall logic loops in the big picture. It's easy for a chess program to hide
>>their devious ways. :)
>>
>>dave
>
>
>
>
>Unfortunately I have no means to profile my unportable Borland C++ Builder code.
>It uses the Borland VCL (a component library).
>When I overcome my laziness some day, I will cast out VCL and produce
>naked profilable C/C++ code for MS Visual C++.
>
>/Matthias.

Don't get down on account of this, Matthias. Just make a timing loop for every
major function, (I'd be tempted to sum it up with a global struct, but
everyone's idea is different). Have it accumulate the total time it spends in
your major functions.

Sure, it will run slowly in this fashion, but that's not important. It will give
you a good idea of your program's profile performance.

That way you can keep your "laziness", and get a profile, too. :)

dave



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.