Review and performance test thread pool sizes

Instead of using the default values, test for good thread pool sizes on different devices. Use pool sizes
compatible with the tasks carried out by the threads.