--- Andreas Raab Andreas.Raab@gmx.de wrote:
Well, that's a good question. It most certainly _should_ be faster. In fact, I put some effort in preventing exhaustive allocations (by pre-allocating and recycling objects) since measuring showed that the overhead of allocating and garbage collecting the move, board, and player objects took roughly 80% of the overall time. And indeed - after taking care of these allocations the entire engine was four times faster.
Yep... I came to the same conclusion... Recycle transposition table entries and limit the allocation of moves and positions through the use of recycling and make/unmake. I am not sure though as how to pre-allocate... I though about filling up some kind of stack with a zillion objects from a forked a low level process but there's something I don't like about that.
almost all moves are valid). And if your allocation overhead is only remotely close to what I've measured your move generator must be three to four times faster than mine!
Well... I am recycling a lot... I though at first that I could get around all that messy code but it looks like it's inevitable in a chess program... All coordinates and move calculations are done with Points so I guess that since all the Smalltalk windowing uses those, this class must be pretty optimized so I'm not so much penalized...
BTW, the engine should run like hell with j3. I tried it once (but Win32/J3 crashed on me) so I don't know what the real outcome is. But it's all just integer arithmetic and recursion so j3 should make a _huge_ difference here (probably another factor of four or so).
Never tried it... Will probably give it a closer look once all is glued together and can play a decent and completely valid game...
===== ---------------------- Benoit St-Jean bstjean@yahoo.com ICQ: 130611319 / Yahoo Mssngr: bstjean http://cactus.swiki.net "We're only immortal for a limited time", Neil Peart ----------------------
__________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1