3 #include "map2/map_insdelfind.h"
4 #include <cds/os/topology.h>
7 CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDelFind );
9 void Map_InsDelFind::setUpParams( const CppUnitMini::TestCfg& cfg )
11 c_nMapSize = cfg.getSizeT("InitialMapSize", c_nMapSize );
12 c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
13 c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
14 c_nInsertPercentage = cfg.getUInt("InsertPercentage", c_nInsertPercentage );
15 c_nDeletePercentage = cfg.getUInt("DeletePercentage", c_nDeletePercentage );
16 c_nDuration = cfg.getUInt("Duration", c_nDuration );
17 c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
19 c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize);
20 c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize);
21 c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold);
23 c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits);
24 c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits);
26 if ( c_nThreadCount == 0 )
27 c_nThreadCount = std::thread::hardware_concurrency() * 2;
29 CPPUNIT_ASSERT( c_nInsertPercentage + c_nDeletePercentage <= 100 );
31 actions * pFirst = m_arrShuffle;
32 actions * pLast = m_arrShuffle + c_nInsertPercentage;
33 std::fill( pFirst, pLast, do_insert );
35 pLast += c_nDeletePercentage;
36 std::fill( pFirst, pLast, do_delete );
38 pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
39 std::fill( pFirst, pLast, do_find );
40 shuffle( m_arrShuffle, pLast );