Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Source code to measure it - there is something wrong

Author: Gerd Isenberg

Date: 14:58:01 07/15/03

Go up one level in this thread


Ok, i think there is one problem with Vincent's cache benchmark.

There are two similar functions DoNrng and DoNreads. DoNrng is used to mesure
the time without hashread. But the instructions has the potential of faster
execution due to less dependencies and stalls. It may execute parts of two loop
bodies of DoNrng interlaced or simultaniesly - that is not possible in DoNreads.
Therefore the time for N DoNrng is not the time used inside the N DoNrng loop,
and maybe much faster.


int DoNrng(BITBOARD n) {
  BITBOARD i=1,dummyres,nents;
  int t1,t2;

  nents = nentries; /* hopefully this gets into a register */
  dummyres = globaldummy;

  t1 = GetClock();
  do {
    BITBOARD index = RanrotA()%nents;
    dummyres ^= index;
  } while( i++ < n );
  t2 = GetClock();

  globaldummy = dummyres;
  return(t2-t1);
}

int DoNreads(BITBOARD n) {
  BITBOARD i=1,dummyres,nents;
  int t1,t2;

  nents = nentries; /* hopefully this gets into a register */
  dummyres = globaldummy;

  t1 = GetClock();
  do {
    BITBOARD index = RanrotA()%nents;
    dummyres ^= hashtable[index];
  } while( i++ < n );
  t2 = GetClock();

  globaldummy = dummyres;

  return(t2-t1);
}



This page took 0.25 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.