mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 14:17:56 +00:00
perf[executor]: specified map initial size
This commit is contained in:
1 parent
1c20b6236a
commit
cd55de2b37
3 files changed
+13
-5
No files matched your search
@@ -43,7 +43,7 @@ public final class TaskBus {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TaskBus.class);
|
||||
|
||||
// 线程池的大小
|
||||
// 线程池的大小,也可以通过provider thread配置指定
|
||||
public static final int EXECUTOR_SIZE;
|
||||
|
||||
private static final ITaskDispatch taskDispatch;
|
||||
@@ -54,8 +54,6 @@ public final class TaskBus {
|
||||
*/
|
||||
private static final ExecutorService[] executors;
|
||||
|
||||
private static final CopyOnWriteHashMapLongObject<ExecutorService> threadMap = new CopyOnWriteHashMapLongObject<>();
|
||||
|
||||
static {
|
||||
var localConfig = NetContext.getConfigManager().getLocalConfig();
|
||||
var providerConfig = localConfig.getProvider();
|
||||
@@ -74,6 +72,8 @@ public final class TaskBus {
|
||||
}
|
||||
}
|
||||
|
||||
private static final CopyOnWriteHashMapLongObject<ExecutorService> threadMap = new CopyOnWriteHashMapLongObject<>(EXECUTOR_SIZE);
|
||||
|
||||
public static class TaskThreadFactory implements ThreadFactory {
|
||||
private final int poolNumber;
|
||||
private final AtomicInteger threadNumber = new AtomicInteger(1);
|
||||
|
||||
Reference in new issue
Block a user