From 48211d04ba8aeae7c6dca982391054269adddac2 Mon Sep 17 00:00:00 2001 From: Alessandro Pio Ardizio Date: Tue, 21 Jan 2020 23:56:13 +0100 Subject: [PATCH] Update README.MD --- README.MD | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.MD b/README.MD index 48d6a30f..af80d5d0 100644 --- a/README.MD +++ b/README.MD @@ -11,6 +11,8 @@ · API · + Choose a pool + · Contribute · Compatibility @@ -108,6 +110,15 @@ This method will call the terminate method on each worker. `opts` (optional) An object with these properties : - `maxInactiveTime` - Max time to wait tasks to work on ( in ms) , after this period the new worker threads will die. +

Choose your pool

+Performance is one of the main target of these thread pool implementation, we want to have a strong focus on this.
+We already have a bench folder where you can find some comparisons. +To choose your pool consider that with a FixedThreadPool or a DynamicThreadPool ( in this case is important the min parameter passed to the constructor) your application memory footprint will increase .
+Increasing the memory footprint your application will be ready to accept more CPU bound tasks, but during idle time your application will consume more memory.
+One good choose from my point of view is to profile your application using Fixed/Dynamic thread pool , and to see your application metrics when you increase/decrease the num of threads.
+For example you could keep the memory footprint low choosing a DynamicThreadPool with 5 threads, and allow to create new threads until 50/100 when requests, this is the advantage to use the DynamicThreadPool.
+But in general , always profile your application +

Contribute

See guidelines [CONTRIBUTING](./.github/CONTRIBUTING.md) -- 2.34.1