| 209 | } |
| 210 | |
| 211 | void PerformanceTest::prepareWorkers() |
| 212 | { |
| 213 | for (size_t threadId = 0; threadId < m_threadsCount; threadId++) { |
| 214 | m_workers.push_back( |
| 215 | new Worker( |
| 216 | m_operationsCount, |
| 217 | m_allocationSizes, |
| 218 | m_freeOperation, |
| 219 | m_kinds.size() > 0 ? m_kinds[threadId % m_kinds.size()] : nullptr) |
| 220 | ); |
| 221 | #ifdef __DEBUG |
| 222 | m_workers.back()->setId(threadId); |
| 223 | #endif |
| 224 | if (m_executionMode == ExecutionMode::SingleInteration) { |
| 225 | // In ManyIterations mode, operations will be set for each thread at the beginning of each iteration |
| 226 | m_workers.back()->init(m_testOperations[threadId % m_testOperations.size()], |
| 227 | m_freeOperation); |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | Metrics PerformanceTest::getMetrics() |
| 233 | { |