Computer Chess Club Archives


Search

Terms

Messages

Subject: Programming: speed of my engine.

Author: Matthias Gemuh

Date: 12:04:53 03/16/04





I am trying to find out why my engine is 6...10 times slower than others at
runtime (got no profiler).  Is the speed of this Perft() acceptable on 2.0 GHz ?
Note that attack boards and hash keys are also calculated/updated.



void Perft(int nPerft, int nPly, *nCount, nSideToMove, ChsStrct, nMethod)
{
    if (nPerft <= 0) return;
    CalculateAttackBoards(ChsStrct, &AtkInfo1);
    GenerateMoves(ChsStrct, nSideToMove, nMoveOffset, &AtkInfo1);
    for (i= 0; i < ChsStrct->MoveCount; i++) {
        Move = ChsStrct->MoveList[nMoveOffset+i];
        if (!MiniMakeMove(ChsStrct, Move, true)) continue;
        *nCount += 1;
        Perft(nPerft-1, nPly+1, nCount, nOtherSide, ChsStrct, nMethod);
        MiniUnmakeMove(ChsStrct, Move);
    }
}


rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
PerftPly = 3
nCount = 9322
nps = 932200
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
PerftPly = 4
nCount = 206603
nps = 1147794
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
PerftPly = 5
nCount = 5072212
nps = 1249313
r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1
PerftPly = 3
nCount = 99949
nps = 1249362
r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1
PerftPly = 4
nCount = 4185552
nps = 1260708
8/PPP4k/8/8/8/8/4Kppp/8 w - - 0 1
PerftPly = 4
nCount = 94715
nps = 861045
8/PPP4k/8/8/8/8/4Kppp/8 w - - 0 1
PerftPly = 5
nCount = 1840260
nps = 1082505
8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1
PerftPly = 4
nCount = 46255
nps = 1156375
8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1
PerftPly = 5
nCount = 720879
nps = 1310689
8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1
PerftPly = 6
nCount = 11750962
nps = 1304213




This page took 0.01 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.