MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / prepareWorkers

Method prepareWorkers

deps/memkind/src/test/performance/framework.cpp:211–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

setIdMethod · 0.80
initMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected