Stockfish slowdown

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Werewolf
Posts: 2035
Joined: Thu Sep 18, 2008 10:24 pm

Stockfish slowdown

Post by Werewolf »

Has anyone else found this:

Running SF I get a normal nps, but if my PC is on for a few days and then I load SF I get about a 50% reduction in nps. A restart resets everything back to normal.

This is happening within Aquarium. I'm not noticing anything odd in Task Manager. Processor usage drops to 50% explaining the lower nps, but I've no idea why.
smatovic
Posts: 3331
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Stockfish slowdown

Post by smatovic »

Just a guess, Windows memory fragmentation:

What is memory fragmentation?
https://stackoverflow.com/questions/377 ... gmentation

What is Memory Fragmentation? (and How To Avoid It)
https://www.edn.com/handling-memory-fragmentation/

Is your swap partition/virtual memory big enough? Old rule was double the RAM.

--
Srdja
Werewolf
Posts: 2035
Joined: Thu Sep 18, 2008 10:24 pm

Re: Stockfish slowdown

Post by Werewolf »

Thanks for this. So adding more RAM makes it worse? I added a lot recently (256 GB) and my virtual memory is only 16 GB.
But the thing is my hard drive isn't very big so I'm not sure what to do.
Modern Times
Posts: 3748
Joined: Thu Jun 07, 2012 11:02 pm

Re: Stockfish slowdown

Post by Modern Times »

There are programs that claim to defragment the memory without rebooting - can't recall the name but google it and see what you find. Assuming that is actually the problem - sounds very weird. How much RAM are you giving Stockfish ?
Werewolf
Posts: 2035
Joined: Thu Sep 18, 2008 10:24 pm

Re: Stockfish slowdown

Post by Werewolf »

Modern Times wrote: Sun Dec 10, 2023 6:58 pm There are programs that claim to defragment the memory without rebooting - can't recall the name but google it and see what you find. Assuming that is actually the problem - sounds very weird. How much RAM are you giving Stockfish ?
32 GB
smatovic
Posts: 3331
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Stockfish slowdown

Post by smatovic »

Werewolf wrote: Sun Dec 10, 2023 6:46 pm Thanks for this. So adding more RAM makes it worse? I added a lot recently (256 GB) and my virtual memory is only 16 GB.
But the thing is my hard drive isn't very big so I'm not sure what to do.
It was just a guess, one OS technique to defrag memory is to use virtual memory, so you will need a 1:1 ratio in worst case.

If you use only 32GB Hash for SF, and then your machine is idle for days, memory fragmentation does not sound like the issue, depends on your software beside Stockfish.

--
Srdja
Modern Times
Posts: 3748
Joined: Thu Jun 07, 2012 11:02 pm

Re: Stockfish slowdown

Post by Modern Times »

Werewolf wrote: Sat Dec 09, 2023 11:07 pm Has anyone else found this:

Running SF I get a normal nps, but if my PC is on for a few days and then I load SF I get about a 50% reduction in nps. A restart resets everything back to normal.

This is happening within Aquarium. I'm not noticing anything odd in Task Manager. Processor usage drops to 50% explaining the lower nps, but I've no idea why.
Do other engines do the same?
Jouni
Posts: 3656
Joined: Wed Mar 08, 2006 8:15 pm
Full name: Jouni Uski

Re: Stockfish slowdown

Post by Jouni »

Which CPU and OS? Obviously Aquarium bug.
Jouni
syzygy
Posts: 5726
Joined: Tue Feb 28, 2012 11:56 pm

Re: Stockfish slowdown

Post by syzygy »

Werewolf wrote: Sat Dec 09, 2023 11:07 pm Has anyone else found this:

Running SF I get a normal nps, but if my PC is on for a few days and then I load SF I get about a 50% reduction in nps. A restart resets everything back to normal.

This is happening within Aquarium. I'm not noticing anything odd in Task Manager. Processor usage drops to 50% explaining the lower nps, but I've no idea why.
What fixes it? A restart of your PC or a restart of Aquarium?

With 256 GB of RAM, I would just disable that 16GB swapfile altogether. You don't need it, and if it is used, it just slows you down.

Memory fragmentation is only an issue if it results in large pages not being available. No large pages can easily decrease nps by 10%, but 50% seems too high.
Werewolf
Posts: 2035
Joined: Thu Sep 18, 2008 10:24 pm

Re: Stockfish slowdown

Post by Werewolf »

Thanks for all your suggestions everyone. I'm looking into this. On the basis of a post by someone else on the Forum I'm looking into the possibility the cause of the issue is Fritz 19 which may be running in the background...