Author: Ulrich Tuerke
Date: 05:04:35 01/09/01
Go up one level in this thread
On January 09, 2001 at 07:27:22, Steffen Jakob wrote:
>On January 09, 2001 at 06:47:16, Ulrich Tuerke wrote:
>
>>On January 09, 2001 at 06:18:29, Steffen Jakob wrote:
>>
>>>On January 09, 2001 at 05:36:26, Ulrich Tuerke wrote:
>>>
>>>>On January 09, 2001 at 04:55:19, Jouni Uski wrote:
>>>>
>>>>>On January 09, 2001 at 04:08:38, Ulrich Tuerke wrote:
>>>>>
>>>>>>On January 09, 2001 at 03:09:39, Jouni Uski wrote:
>>>>>>
>>>>>>>If I am not complete wrong please note:
>>>>>>>
>>>>>>>Because Gandalf is so slow in NPS sense (about 1/4 of many top engines) it needs
>>>>>>>much less HASH table RAM than other programs and if You give too much HASH it
>>>>>>>weakens engine! So my recommendation:
>>>>>>>
>>>>>>> 500 Mhz PC 32MB
>>>>>>> 1000 Mhz PC 56MB
>>>>>>>
>>>>>>>The readme.txt to use 104MB for >128MB PC is not wise at all.
>>>>>>>
>>>>>>>Jouni
>>>>>>
>>>>>>I don't see, why "too much" hash could do any harm.
>>>>>>Uli
>>>>>
>>>>>I am not sure may be there is minor bug in hashing code. With 104MB (or similar)
>>>>>clearing of hash seems to take 5-10 seconds in my PC!
>>>>
>>>>This sounds weird. You shouldn't need 5-10 seconds for memory operations.
>>>>Perhaps your hash size is too close to your memory size and Windows starts
>>>>paging ?
>>>
>>>It depends if you simply clean the whole memory with zeroes or if you set a flag
>>>for each hash entry. In that case it is indeed better not to use large hash
>>>tables if you are low on time (e.g. in bullet games).
>>>
>>>Best wishes,
>>>Steffen.
>>
>>Come on, 5-10 seconds ! This must be massive hard disk access. A "memset" for
>>hundreds of MB can't take that long.
>
>Setting a flag takes some time especially if its part of a bitset in a data
>type. I wrote a little example where setting the flags of 160 MB takes 1.75
>seconds on my machine. Clearing the whole table with memset() takes 1.02
>seconds. I dont know, but if Steend does something additionally it might take 5
>seconds (or if the RAM is slower).
Okay, your numbers are not unreasonable. You are still far below Jouni's 5 - 10
seconds. I got ~ 0.5 secs to clear 64 MB with memset on my machine.
I think that you must really do a lot per entry in order to make it take 5-10
seconds. Wouldn't you agree to this, Steffen ?
>
>Here's my program:
>
>#include <stdlib.h>
>#include <string.h>
>#include <stdio.h>
>#include <time.h>
>#include <sys/time.h>
>
>static long get_centi_seconds();
>
>main()
>{
> typedef struct
> {
> int flag:1;
> long data;
> } entry;
>
> entry *hash;
> int i;
> long num = 20 * 1024 * 1024;
> long start;
>
> printf("allocating %ld entries (%ld MB)\n", num, num * sizeof(entry) / (1024
>* 1024));
> hash = (entry *)malloc(num * sizeof(entry));
> if(hash == NULL)
> {
> fprintf(stderr, "not enough memory\n");
> exit(1);
> }
>
> // set some values
> for(i=0; i<num; i++)
> {
> hash[i].flag = 1;
> hash[i].data = i;
> }
>
> // set the flag for all entries
> start = get_centi_seconds();
> for(i=0; i<num; i++)
> {
> hash[i].flag = 0;
> }
> printf("set flags: %ld\n", get_centi_seconds()-start);
>
> // clear the whole hash table
> start = get_centi_seconds();
> memset(hash, 0, num * sizeof(entry));
> printf("clear hash table: %ld\n", get_centi_seconds()-start);
>}
>
>static long get_centi_seconds()
>{
> struct timeval tv;
>
> gettimeofday(&tv, NULL);
>
> return (tv.tv_sec%1000000)*100 + tv.tv_usec/10000;
>}
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.