General guidelines
October 6, 2023 ยท View on GitHub
Performance is one of the main target of these worker pool implementations,
poolifier team wants to have a strong focus on this.
Poolifier already has benchmarks where you can find
some comparisons.
Table of contents
Fixed vs Dynamic pools
To choose your pool consider first that with a FixedThreadPool or a
DynamicThreadPool your application memory footprint will increase.
By doing so, your application will be ready to execute in parallel more tasks,
but during idle time your application will consume more memory.
One good choice from poolifier team point of view is to profile your application
using a fixed or dynamic worker pool, and analyze your application metrics when
you increase/decrease the number of workers.
For example you could keep the memory footprint low by choosing a
DynamicThreadPool with a minimum of 5 workers, and allowing it to create new
workers until a maximum of 50 workers if needed. This is the advantage of using
a DynamicThreadPool.
But in general, always profile your application.