mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Increase jobpool thread count based on hardware concurrency
The client/server jobpools were previously only using a fixed number of 2 threads. Now the pools use `2 * hardware-concurrency + 2` threads, which should provide better performance overall, as we expect threads to often wait on I/O.
This commit is contained in:
parent
2dcec6496f
commit
ba5a974353
|
@ -4612,7 +4612,7 @@ int main(int argc, const char **argv)
|
|||
});
|
||||
|
||||
// create the components
|
||||
IEngine *pEngine = CreateEngine(GAME_NAME, pFutureConsoleLogger, 2);
|
||||
IEngine *pEngine = CreateEngine(GAME_NAME, pFutureConsoleLogger, 2 * std::thread::hardware_concurrency() + 2);
|
||||
IConsole *pConsole = CreateConsole(CFGFLAG_CLIENT).release();
|
||||
IStorage *pStorage = CreateStorage(IStorage::STORAGETYPE_CLIENT, argc, (const char **)argv);
|
||||
IConfigManager *pConfigManager = CreateConfigManager();
|
||||
|
|
|
@ -112,7 +112,7 @@ int main(int argc, const char **argv)
|
|||
IKernel *pKernel = IKernel::Create();
|
||||
|
||||
// create the components
|
||||
IEngine *pEngine = CreateEngine(GAME_NAME, pFutureConsoleLogger, 2);
|
||||
IEngine *pEngine = CreateEngine(GAME_NAME, pFutureConsoleLogger, 2 * std::thread::hardware_concurrency() + 2);
|
||||
IEngineMap *pEngineMap = CreateEngineMap();
|
||||
IGameServer *pGameServer = CreateGameServer();
|
||||
IConsole *pConsole = CreateConsole(CFGFLAG_SERVER | CFGFLAG_ECON).release();
|
||||
|
|
Loading…
Reference in a new issue