Author: Pham Hong Nguyen
Date: 23:26:46 06/09/02
Go up one level in this thread
On June 10, 2002 at 00:37:30, Russell Reagan wrote: >On June 09, 2002 at 22:46:36, Pham Hong Nguyen wrote: > >>If you use structure instead of class for Move, it will become real C and you >>can avoid that problem. >> >>BTW, when searching, I try to "fix" classes as much as possible because any >>dynamic things will cost too much. For example, if I can, I will declare Move >>array as the following: >> >>static Move moves[512]; > >When you say "fix" things, do you mean that you "limit" them as much as >possible, so that the compiler knows that the scope of the variables is less, >and can therefore do more optimizing? Not because of optimazation. Simply allocation code for dynamic objects of C++ cost much time. If you see that inline code can save little time, reducing dynamic object calls will bring more. > >Also, if I understand your adding "static", then that would mean that all >instances of class MoveList would share the same data, right? I don't think that >is the desired effect, but perhaps I am wrong. That is good effect, in terms of speed ;) You should do some few small "tricks" for speeding up search function if you don't want to move back into C or ASM code. Those tricks work OK on my engine and they are still clear and much easier than use of Assembly codes. > >Russell
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.