perf[event]: enlarge event executor size

This commit is contained in:
godotg
2024-03-28 11:04:31 +08:00
parent 2f55bbb387
commit cfc41181e3
@@ -47,7 +47,7 @@ public abstract class EventBus {
* EN: The size of the thread pool. Event's thread pool is often used to do time-consuming operations, so set it a little bigger
* CN: 线程池的大小. event的线程池经常用来做一些耗时的操作,所以要设置大一点
*/
private static final int EXECUTORS_SIZE = Runtime.getRuntime().availableProcessors() * 2 + 1;
private static final int EXECUTORS_SIZE = Math.max(Runtime.getRuntime().availableProcessors(), 4) * 2 + 1;
private static final ExecutorService[] executors = new ExecutorService[EXECUTORS_SIZE];