예제 #1
0
    void Set_InsDelFind::setUpParams( const CppUnitMini::TestCfg& cfg )
    {
        c_nSetSize = cfg.getSizeT("InitialMapSize", c_nSetSize );
        c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
        c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
        c_nInsertPercentage = cfg.getUInt("InsertPercentage", c_nInsertPercentage );
        c_nDeletePercentage = cfg.getUInt("DeletePercentage", c_nDeletePercentage );
        c_nDuration = cfg.getUInt("Duration", c_nDuration );
        c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );

        c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize );
        c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize );
        c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold );

        c_nFeldmanSet_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanSet_HeadBits);
        c_nFeldmanSet_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanSet_ArrayBits);

        if ( c_nThreadCount == 0 )
            c_nThreadCount = std::thread::hardware_concurrency();

        CPPUNIT_ASSERT( c_nInsertPercentage + c_nDeletePercentage <= 100 );

        actions * pFirst = m_arrShuffle;
        actions * pLast = m_arrShuffle + c_nInsertPercentage;
        std::fill( pFirst, pLast, do_insert );
        pFirst = pLast;
        pLast += c_nDeletePercentage;
        std::fill( pFirst, pLast, do_delete );
        pFirst = pLast;
        pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
        std::fill( pFirst, pLast, do_find );
        shuffle( m_arrShuffle, pLast );
    }
예제 #2
0
파일: random.cpp 프로젝트: IMCG/CDS
 void setUpParams( const CppUnitMini::TestCfg& cfg )
 {
     s_nDataSize = cfg.getULong( "DataSize", 1000 )          ;
     s_nPassCount = cfg.getULong( "PassCount", 100000 )      ;
     s_nMinBlockSize = cfg.getUInt( "MinBlockSize", 8 )      ;
     s_nMaxBlockSize = cfg.getUInt( "MaxBlockSize", 1024 )   ;
     s_nMaxThreadCount = cfg.getUInt( "MaxThreadCount", 32 ) ;
     if ( s_nMaxThreadCount == 0 )
         s_nMaxThreadCount = cds::OS::topology::processor_count() * 2    ;
     if ( s_nMaxThreadCount < 2 )
         s_nMaxThreadCount = 2   ;
 }