Author: Sune Fischer
Date: 17:33:01 05/06/03
Go up one level in this thread
On May 06, 2003 at 19:24:23, Magoo wrote:
>After making alot of functions to macros and alot of other stuff, my program is
>much faster!!
>Perft 5 (without evaluating nodes) gives:
>Depth:5, Nodes:5072212, Time:63 sec, Nps:80511, Value:0
>
>But!! I know other programs (i been looking at mscp and faile) do this
>at least 6 times faster, (that is perft 5 < 10sec).
>I've looked at the source for the programs i compare with, especially faile does
>alot of stuff in the move_generator, mine is smaller, maybe a few more if
>statments.
>Now, if i only could figure out why it is so slow, it shouldn't be!!
>
>Flat profile:
>
>Each sample counts as 0.01 seconds.
> % cumulative self self total
> time seconds seconds calls s/call s/call name
> 66.51 42.12 42.12 5087588 0.00 0.00 move_generator
> 6.58 46.29 4.17 5087588 0.00 0.00 all_moves_legal
> 6.57 50.45 4.16 125595698 0.00 0.00 push
> 6.19 54.37 3.92 135333428 0.00 0.00 look
> 3.65 56.68 2.31 5087587 0.00 0.00 undo_move
> 3.21 58.71 2.03 5087587 0.00 0.00 do_move
> 2.42 60.24 1.53 53339218 0.00 0.00 hist_score2
> 1.33 61.08 0.84 1 0.84 63.33 perft_doit
> 1.06 61.75 0.67 10175154 0.00 0.00 do_passant
> 1.03 62.40 0.65 20519350 0.00 0.00 get_zobrist_piece
> 0.32 62.60 0.20 2945541 0.00 0.00 score_cap
> 0.27 62.77 0.17 5294191 0.00 0.00 pop
> 0.22 62.91 0.14 5087587 0.00 0.00 pop_hist
> 0.21 63.04 0.13 5087587 0.00 0.00 look_hist
> 0.14 63.13 0.09 5087588 0.00 0.00 new_moves
> 0.11 63.20 0.07 5087588 0.00 0.00 free_move_list
> 0.11 63.27 0.07 5087587 0.00 0.00 push_hist
> 0.08 63.32 0.05 5087850 0.00 0.00 getToMove
> 0.02 63.33 0.01 169002 0.00 0.00 do_material_getval
> 0.00 63.33 0.00 5506 0.00 0.00 new_move_with_passant
> 0.00 63.33 0.00 2 0.00 0.00 chess_board
You are doing something unorthodox with that move_generator.
This is what the profile looks like in my perft:
Func Func+Child Hit
Time % Time % Count Function
---------------------------------------------------------
15365.779 41.5 15365.779 41.5 51467325 MakeMove()
14127.271 38.2 36370.902 98.3 2085821 Perft()
4065.822 11.0 6877.851 18.6 2085821 GenMoves()
(The unmakemove is done inside perft as a simple copy, so it is almost as slow
as makemove.)
But notice that _generating_ the moves is only 18.6% of the time.
The perft tree is a little special compared to a normal search tree, in perft
you actually get to use all the moves you generate on the leafs.
So I think those 18.6% is pretty much to be expected, as you can see there are
many more calls (hitcount) to makemove.
You can download it here if your interested in a bitboard movegen example.
http://www.geocities.com/ruleren/crbmg.zip
-S.
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.