bisq2
bisq2 copied to clipboard
Optimize Scheduler to use less threads
The Scheduler creates a new ScheduledExecutorService each time it gets created. We should avoid creating new ScheduledExecutorServices each time. Using a pool does not work well as there is only one API with a fixed pool core pool size but it is hard to estimate the right number for that. We can use a cache where idle ScheduledExecutorService instances are retired and reused when a new Scheduler is created.