Agreed. Default should be more than 1. The simplest is to default to all. Actually the command should be able to parse a command like:
set threads all Then a setting file can be transferred from on computer to another without having to manually change that setting. -Øystein On Sun, 6 Sept 2026, 10:30 Ian Shaw, <[email protected]> wrote: > I usually set gnubg to use the max threads - 1 so that it doesn't > completely slug performance of other tasks during rollouts. > > Definitely, the default should be greater than 1. > > Regards, > Ian > > On Sat, 5 Sept 2026, 16:31 TAKAHASHI Kaoru, <[email protected]> > wrote: > >> Currently, the default number of threads for gnubg is 1, but considering >> today’s typical PCs, I believe this is a rather conservative setting. >> >> In particular, users trying gnubg for the first time are likely to >> attempt an analysis without changing the thread count setting; in that >> case, even on a PC with a multi-core CPU, only one thread will be >> used. As a result, this may give the first impression that gnubg’s >> analysis is slower than it actually is. >> >> >> Since the number of threads explicitly set by a user is saved as >> "set threads", changing the default value will not overwrite existing >> users' saved settings. The change will primarily affect the initial value >> for new users or environments where the number of threads has not yet >> been set. >> >> Therefore, I propose determining the default number of evaluation >> threads based on the number of available CPUs. >> >> One proposal, for example, is to use >> >> MIN(g_get_num_processors(), 4) >> >> which utilizes the number of schedulable threads returned by GLib while >> capping the default at a maximum of 4 threads. >> >> This way, in environments where only one or two threads are available, >> the program will adapt accordingly, while in typical multi-core >> environments, it will run significantly faster than the current >> single-threaded version. On the other hand, even on machines with a >> large number of logical CPUs, this approach prevents gnubg from using up >> nearly all available CPU resources by default. >> >> >> Another option is to use g_get_num_processors() as-is and use all >> threads deemed available as the default. >> >> This approach is straightforward in terms of prioritizing analysis speed >> and allows us to more directly show first-time users the performance >> achievable on their machine. However, in environments capable of using >> 8, 16, 32, or more threads, gnubg will place a significantly high CPU >> load even if the user hasn’t configured anything. >> >> I believe that if we want to address the issue where the default setting >> of 1 thread gives the impression that "gnubg is slow", while also >> ensuring the default setting does not consume an excessive amount of CPU >> resources, >> >> MIN(g_get_num_processors(), 4) >> >> would be a reasonable choice. >> >> On the other hand, if the priority is for the analysis software to use >> the maximum number of available CPUs by default, using >> g_get_num_processors() as-is is also a viable option. >> >> Which approach do you think is better? >> >> Best regards, >> -- >> TAKAHASHI Kaoru >> >
