[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: larger hashsize -> slower "book add" (and some SIGSEGV too)
From: |
Martin Mačok |
Subject: |
Re: larger hashsize -> slower "book add" (and some SIGSEGV too) |
Date: |
Tue, 11 Mar 2003 22:40:29 +0100 |
User-agent: |
Mutt/1.4i |
On Mon, Mar 10, 2003 at 09:43:06AM +0100, Martin Mačok wrote:
> when I enlarge HASHSLOTS and PAWNSLOTS in common.h then generating
> book is much slower. Larger tables -> slower generating.
>
> My system is Athlon 800/256MB, Mandrake 8.2 Linux, gcc-2.96
(I'm replying to myself since I'm off the list and I read your
responds on the web archive, please Cc: me directly on eventual
reply next time...)
I'm using 5.05 release, if you want me to test CVS or something else,
just ask...
It's not swapping, I have 256MB RAM and I tried using hashsize of 5MB,
10MB, 40MB ... it is enough to increase HASHSLOTS only (with PAWNSLOTS
left on default) to trigger slowing.
Screenshots should be self-explanatory:
=======================================
(1) default with HASHSLOTS 1024:
Transposition table: Entries=1K Size=40K
Pawn hash table: Entries=0K Size=28K
White (1) : book add 2700.pgn
Created new book book.dat!
Got 95 hash collisions
Time = 2 seconds
Games compiled: 2154
Games per second: 1077.000000
Positions scanned: 40063
Positions per second: 20031.500000
and now with runtime changing of hashsize:
White (1) : hashsize 1000000
Adjusting HashSize to 524288 slots
Transposition table: Entries=512K Size=20480K
Pawn hash table: Entries=0K Size=28K
White (1) : book add 2700.pgn
Opened existing book!
Read 11926 book positions
Got 64 hash collisions
Got 182 hash collisions
Time = 2 seconds
Games compiled: 2154
Games per second: 1077.000000
Positions scanned: 40063
Positions per second: 20031.500000
=========================================
(2) compiled with HASHSLOTS 1024*1024:
Transposition table: Entries=1024K Size=40960K
Pawn hash table: Entries=0K Size=28K
White (1) : book add 2700.pgn
Created new book book.dat!
Got 95 hash collisions
Time = 257 seconds
Games compiled: 2154
Games per second: 8.381323
Positions scanned: 40063
Positions per second: 155.887160
and now with runtime decreasing hashsize:
White (1) : hashsize 1024
Adjusting HashSize to 1024 slots
Transposition table: Entries=1K Size=40K
Pawn hash table: Entries=0K Size=28K
White (1) : book add 2700.pgn
Created new book book.dat!
zsh: segmentation fault ./gnuchess
gdb reveals:
Program received signal SIGSEGV, Segmentation fault.
0x40117760 in memset () from /lib/libc.so.6
(gdb) bt
#0 0x40117760 in memset () from /lib/libc.so.6
#1 0xbfffe96c in ?? ()
#2 0x0805c213 in NewPosition () at init.c:801
#3 0x080612f8 in BookPGNReadFromFile (file=0x806bae0 "2700.pgn") at pgn.c:331
#4 0x0804d03e in InputCmd () at cmd.c:141
#5 0x0805d17c in main (argc=1, argv=0xbffff294) at main.c:330
#6 0x400ab280 in __libc_start_main () from /lib/libc.so.6
===========================================
(3) and now with something in between, HASHSLOTS 128*1024:
Transposition table: Entries=128K Size=5120K
Pawn hash table: Entries=0K Size=28K
White (1) : book add 2700.pgn
Created new book book.dat!
Got 95 hash collisions
Time = 34 seconds
Games compiled: 2154
Games per second: 63.352941
Positions scanned: 40063
Positions per second: 1178.323529
===================================
Summary:
HASHSLOTS TIME
1024 2 s
128*1024 34 s
1024*1024 257 s
I hope it helps
P.S. and regarding to the real effect of increasing the hashsize
checked with "post, depth 10, go" from the initial position:
HASHSLOTS TIME
1024 36.5 s
128*1024 17.6 s
1024*1024 17.5 s
--
Martin Mačok http://underground.cz/
address@hidden http://Xtrmntr.org/ORBman/