Skip to content

Commit

Permalink
Increase worker threads
Browse files Browse the repository at this point in the history
1. As we delegate more things to background jobs we should increase the number of
   worker threads for sufficient systems.
2. 8GB systems are accepted as sufficient
3. Simplify test for backthumbs crawler and accept 8GB systems this way
  • Loading branch information
jenshannoschwalm authored and TurboGit committed Aug 21, 2024
1 parent 79bd641 commit b312aa3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/common/darktable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1736,8 +1736,7 @@ int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load

darktable.backthumbs.running = FALSE;
darktable.backthumbs.capable =
dt_get_num_procs() >= 4
&& darktable.dtresources.total_memory / 1024lu / 1024lu >= 8000
dt_worker_threads() > 4
&& !(dbfilename_from_command && !strcmp(dbfilename_from_command, ":memory:"));
if(init_gui)
{
Expand Down Expand Up @@ -2089,9 +2088,7 @@ void dt_show_times_f(const dt_times_t *start,

int dt_worker_threads()
{
const int threads = dt_get_num_threads();
const int gbytes = (int)(_get_total_memory() / (1lu << 20));
const int wthreads = (gbytes >= 8 && threads >= 4) ? 6 : 3;
const int wthreads = (_get_total_memory() >> 19) >= 15 && dt_get_num_threads() >= 4 ? 7 : 4;
dt_print(DT_DEBUG_DEV, "[dt_worker_threads] using %i worker threads\n", wthreads);
return wthreads;
}
Expand Down

0 comments on commit b312aa3

Please sign in to comment.