glinscott / leela-chess

**MOVED TO https://github.com/LeelaChessZero/leela-chess ** A chess adaption of GCP's Leela Zero
http://lczero.org
GNU General Public License v3.0
760 stars 301 forks source link

Optimisation idea: skip showing info on the command line #704

Open Wak017 opened 6 years ago

Wak017 commented 6 years ago

Title says it all, almost.

I saw on the forum that the new lc0 was performing around 50 games in 3 minutes, a huge progress relative to what most contributors do right now. With these infos I calculated that if infos are still shown on the command line for every move played, like they are for the main project, there should be a lot of prints. Quick mafs.

So it came to my mind that maybe the prints on the command line are taking some process and can slow down the whole thing (I'm talking about the info depth nps score etc). Yes, it may not seem like it, I know, but I learned the hard way that printing can slow down a running program when there is a good amount of prints per second (which the new lc0 is guilty of doing)**. I had a project recently that the whole thing would take 35 minutes to run on my PC, and when I took away all the prints on the command line the whole thing was taking 2 minutes. Of course there were a lot of differences between my project and this one, being 1. My project was in java (Eclipse), 2. I was printing everytime one of my 2^21 nodes connected. So, printing was slowing everything down a LOT.

Of course, with this idea I'm not expecting the whole thing to go much faster, but on the other hand, contributors don't really need to see all these infos, so it may be turned off by default, with the exception of the info that a game finished in x minutes and y seconds. It's a relatively easy optimization fix I would suppose, also, so why not try it?

**Note that I am still only participating on the main network right now, so this may have been already taken care of and I'm not aware of it. If so, ignore what I just said.

simlu commented 5 years ago

Gist here is that it would be nice to have different log level. This might or might not have an impact on performance.