Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -169,7 +169,12 @@ static QTimer identityPacketTimer; · 168 unmodified lines | |||
| 169 | static QTimer pingTimer; | 169 | static QTimer pingTimer; |
| 170 | 170 | ||
| 171 | static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16; | 171 | static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16; |
| 172 | static const int PROCESSING_THREAD_POOL_SIZE = 6; | 172 | |
| 173 | // For processing on QThreadPool, target 2 less than the ideal number of threads, leaving | ||
| 174 | // 2 logical cores available for time sensitive tasks. | ||
| 175 | static const int MIN_PROCESSING_THREAD_POOL_SIZE = 2; | ||
| 176 | static const int PROCESSING_THREAD_POOL_SIZE = std::max(MIN_PROCESSING_THREAD_POOL_SIZE, | ||
| 177 | QThread::idealThreadCount() - 2); | ||
| 173 | 178 | ||
| 174 | static const QString SNAPSHOT_EXTENSION = ".jpg"; | 179 | static const QString SNAPSHOT_EXTENSION = ".jpg"; |
| 175 | static const QString SVO_EXTENSION = ".svo"; | 180 | static const QString SVO_EXTENSION = ".svo"; |
| @@ -514,12 +519,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 338 unmodified lines | |||
| 514 | PluginContainer* pluginContainer = dynamic_cast<PluginContainer*>(this); // set the container for any plugins that care | 519 | PluginContainer* pluginContainer = dynamic_cast<PluginContainer*>(this); // set the container for any plugins that care |
| 515 | PluginManager::getInstance()->setContainer(pluginContainer); | 520 | PluginManager::getInstance()->setContainer(pluginContainer); |
| 516 | 521 | ||
| 517 | // FIXME this may be excessively conservative. On the other hand | ||
| 518 | // maybe I'm used to having an 8-core machine | ||
| 519 | // Perhaps find the ideal thread count and subtract 2 or 3 | ||
| 520 | // (main thread, present thread, random OS load) | ||
| 521 | // More threads == faster concurrent loads, but also more concurrent | ||
| 522 | // load on the GPU until we can serialize GPU transfers (off the main thread) | ||
| 523 | QThreadPool::globalInstance()->setMaxThreadCount(PROCESSING_THREAD_POOL_SIZE); | 522 | QThreadPool::globalInstance()->setMaxThreadCount(PROCESSING_THREAD_POOL_SIZE); |
| 524 | thread()->setPriority(QThread::HighPriority); | 523 | thread()->setPriority(QThread::HighPriority); |
| 525 | thread()->setObjectName("Main Thread"); | 524 | thread()->setObjectName("Main Thread"); |