3 #include "map2/map_delodd.h"
6 CPPUNIT_TEST_SUITE_REGISTRATION( Map_DelOdd );
8 size_t Map_DelOdd::c_nMapSize = 1000000 ; // max map size
9 size_t Map_DelOdd::c_nInsThreadCount = 4 ; // insert thread count
10 size_t Map_DelOdd::c_nDelThreadCount = 4 ; // delete thread count
11 size_t Map_DelOdd::c_nExtractThreadCount = 4 ; // extract thread count
12 size_t Map_DelOdd::c_nMaxLoadFactor = 8 ; // maximum load factor
13 bool Map_DelOdd::c_bPrintGCState = true;
15 void Map_DelOdd::setUpParams( const CppUnitMini::TestCfg& cfg ) {
16 c_nMapSize = cfg.getULong("MapSize", static_cast<unsigned long>(c_nMapSize) );
17 c_nInsThreadCount = cfg.getULong("InsThreadCount", static_cast<unsigned long>(c_nInsThreadCount) );
18 c_nDelThreadCount = cfg.getULong("DelThreadCount", static_cast<unsigned long>(c_nDelThreadCount) );
19 c_nExtractThreadCount = cfg.getULong("ExtractThreadCount", static_cast<unsigned long>(c_nExtractThreadCount) );
20 c_nMaxLoadFactor = cfg.getULong("MaxLoadFactor", static_cast<unsigned long>(c_nMaxLoadFactor) );
21 c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true );
23 if ( c_nInsThreadCount == 0 )
24 c_nInsThreadCount = cds::OS::topology::processor_count();
25 if ( c_nDelThreadCount == 0 && c_nExtractThreadCount == 0 ) {
26 c_nExtractThreadCount = cds::OS::topology::processor_count() / 2;
27 c_nDelThreadCount = cds::OS::topology::processor_count() - c_nExtractThreadCount;
30 m_arrInsert.resize( c_nMapSize );
31 m_arrRemove.resize( c_nMapSize );
32 for ( size_t i = 0; i < c_nMapSize; ++i ) {
36 shuffle( m_arrInsert.begin(), m_arrInsert.end() );
37 shuffle( m_arrRemove.begin(), m_arrRemove.end() );
40 void Map_DelOdd::myRun(const char *in_name, bool invert /*= false*/)
42 setUpParams( m_Cfg.get( "Map_DelOdd" ));
44 run_MichaelMap(in_name, invert);
45 run_SplitList(in_name, invert);
46 run_SkipListMap(in_name, invert);
47 run_EllenBinTreeMap(in_name, invert);
48 run_BronsonAVLTreeMap(in_name, invert);
49 //run_StripedMap(in_name, invert);
50 //run_RefinableMap(in_name, invert);
51 run_CuckooMap(in_name, invert);
52 //run_StdMap(in_name, invert);