A comparison of some Perft programs 

Discussion of chess software programming and technical issues.

Moderator: Ras

Sopel
Posts: 397
Joined: Tue Oct 08, 2019 11:39 pm
Full name: Tomasz Sobczyk

Re: A comparison of some Perft programs 

Post by Sopel »

phhnguyen wrote: Mon Jan 12, 2026 11:30 am
Sopel wrote: Sun Jan 11, 2026 9:42 pm FWIW on 7800x3d on windows I get ~300Mnps for SF 17.1 and 1650Mnps for gigantua on perft 7
Your information is ambiguous to me. SF doesn't print out both elapsed and speed when computing Perft. How can you get the speed of 300 Mbps? If it is the speed of normal search, we cannot use it to compare with Gigantua since (AFAK) it uses leave nodes from bulk counting, but not nodes by making/undoing to calculate Perft speed.

The best if you could do, please measure the time for calculating Perft 8 for both programs. SF doesn't print out elapsed, but you can easily add a few commands to SF code (e.g., such as: TimePoint startPoint = now();... elapsed = now() - startPoint;), recompile and run. You may find a 3rd party program to run it for timing, too. For Gigantua, you can download its 64-bit exe file from its GitHub and run it as below. It will calculate elapsed time itself:

Code: Select all

Gigantua.exe "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" 8
FYI: I have just re-run some Perft programs from my PC after resetting. There is no chance for Gigantua on my old PC: it is still lagging behind SF. Hope it performs better on your PC.
time can be measured by outside forces, and I can do division
dangi12012 wrote:No one wants to touch anything you have posted. That proves you now have negative reputations since everyone knows already you are a forum troll.

Maybe you copied your stockfish commits from someone else too?
I will look into that.
abulmo2
Posts: 487
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: A comparison of some Perft programs 

Post by abulmo2 »

phhnguyen wrote: Mon Jan 12, 2026 11:03 am
petero2 wrote: Sun Jan 11, 2026 8:51 pm
phhnguyen wrote: Sat Jan 10, 2026 11:25 pm 7) MPerft by Richard Delorme
https://github.com/abulmo/MPerft

The project was updated 6 years ago. I downloaded and compiled it via the make command.

It is the fastest and significantly faster than other programs in this comparison, 17 times faster than Stockfish. On the screen, it prints clearly that it uses hashing and multithreading.
Are you sure it is using multithreading? On my computer it says it is using hashing and bulk counting, but it doesn't say anything about multiple threads, and only uses one thread. Also looking at the source code I see nothing about threads in it.
You are right! It is my mistake! MPerft uses bulk counting and hashing only!
I fixed this in version 3.0. Now mperft uses also multithreading. On my old ryzen 9 5950:

Code: Select all

$ mperft-3.0-x86-64-v3 -d 8 -b -h 256 -t 32 -q
perft  8 :     84998978956 leaves in      0.553 s 153729146951 leaves/s
Richard Delorme
abulmo2
Posts: 487
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: A comparison of some Perft programs 

Post by abulmo2 »

phhnguyen wrote: Mon Jan 12, 2026 10:59 am
hgm wrote: Sun Jan 11, 2026 11:46 am The key to doing fast perfts seems to be hashing.
Agreed. Hashing is one of the largest gain methods for Perft.

However, from my experience as well as reading somewhere, hashing may give a factor of about 2 times speed. My computer has 8 cores, and multithreading could bring me a factor of 8 times faster :D
With the latest MPerft that implement multithreading, I got this on an AMD Ryzen 9 5950x.
  • bulk counting: x10
  • multithreading with 16 threads: x14
  • transposition table of 256Mbytes (16M entries): x17
Richard Delorme