Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c839883

Browse files
committed
experiment with starting the threadpool at size 1
We currently start threadpools at 50% of max size and let them expand and contract with load. Since this happens pretty quickly, how about starting threadpools at size 1 instead? Simple pipelines would be quicker, heavy pipelines would hardly slow down. Trivial patch for experimentation.
1 parent 9e64179 commit c839883

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libvips/iofuncs/threadpool.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,11 @@ vips_threadpool_run(VipsImage *im,
647647
pool->work = work;
648648
pool->a = a;
649649

650-
/* Start with half of the max number of threads, then let it drift up
650+
/* Start with a single thread, then let it drift up
651651
* and down with load.
652652
*/
653653
for (n_working = 0; n_working < 1 + pool->max_workers / 2; n_working++)
654+
// for (n_working = 0; n_working < 1; n_working++)
654655
if (vips_worker_new(pool)) {
655656
vips_threadpool_free(pool);
656657
return -1;

0 commit comments

Comments
 (0)