Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: General efficiency question

Author: Uri Blass

Date: 04:30:12 04/23/02

Go up one level in this thread


On April 23, 2002 at 07:15:54, Sune Fischer wrote:

>On April 23, 2002 at 05:46:54, Uri Blass wrote:
>
>>In my program I thought about optimization in cases that it is important but
>>only about changing the algorithm and I decided to do nothing about optimization
>>of writing the same algorithm faster by assembler that I do not know.
>>
>>
>>>Things like generating the entire movelist and then sorting the entire movelist
>>>by some simple O(N^2) algorithm, and doing all this with a huge array being
>>>allocated on the fly is real bad, it will cost a lot of performance.
>>>
>>>That was my first design, I rewrote it but I didn't find it trivial to do.
>>>I simply had to change it, I couldn't stand looking at what I knew was p*ss poor
>>>code.
>>
>>It is not clear if doing it in O(N*logN) is better because often the first move
>>fail high and you can do it in O(N).
>
>I was doing this:
>
>GenAllMoves();
>SortAllMoves();
>while(moves left){
>  MakeMove();
>  search....
>}
>
>...simple but slow.

It is not more complicated and it is faster to do the following:

genallmove();
while (move left)
{
sortnextmove();
makeMove();
search...
}

Uri



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.