/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "map_delodd.h"
namespace map {
-
- size_t Map_DelOdd::s_nMapSize = 1000000;
+
+ size_t Map_DelOdd::s_nMapSize = 10000;
size_t Map_DelOdd::s_nInsThreadCount = 4;
size_t Map_DelOdd::s_nDelThreadCount = 4;
size_t Map_DelOdd::s_nExtractThreadCount = 4;
+ size_t Map_DelOdd::s_nFindThreadCount = 2;
size_t Map_DelOdd::s_nMaxLoadFactor = 8;
+ size_t Map_DelOdd::s_nInsertPassCount = 100;
size_t Map_DelOdd::s_nCuckooInitialSize = 1024;
size_t Map_DelOdd::s_nCuckooProbesetSize = 16;
size_t Map_DelOdd::s_nFeldmanMap_HeadBits = 10;
size_t Map_DelOdd::s_nFeldmanMap_ArrayBits = 4;
-
size_t Map_DelOdd::s_nLoadFactor = 1;
- std::vector<size_t> Map_DelOdd::m_arrInsert;
- std::vector<size_t> Map_DelOdd::m_arrRemove;
+ std::vector<size_t> Map_DelOdd::m_arrElements;
void Map_DelOdd::SetUpTestCase()
{
s_nDelThreadCount = cfg.get_size_t( "DelThreadCount", s_nDelThreadCount );
s_nExtractThreadCount = cfg.get_size_t( "ExtractThreadCount", s_nExtractThreadCount );
+ s_nFindThreadCount = cfg.get_size_t( "FindThreadCount", s_nFindThreadCount );
s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
if ( s_nMaxLoadFactor == 0 )
s_nMaxLoadFactor = 1;
+ s_nInsertPassCount = cfg.get_size_t( "PassCount", s_nInsertPassCount );
+ if ( s_nInsertPassCount == 0 )
+ s_nInsertPassCount = 100;
+
s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize );
if ( s_nCuckooInitialSize < 256 )
s_nCuckooInitialSize = 256;
if ( s_nFeldmanMap_ArrayBits == 0 )
s_nFeldmanMap_ArrayBits = 2;
-
- m_arrInsert.resize( s_nMapSize );
- m_arrRemove.resize( s_nMapSize );
- for ( size_t i = 0; i < s_nMapSize; ++i ) {
- m_arrInsert[i] = i;
- m_arrRemove[i] = i;
- }
- shuffle( m_arrInsert.begin(), m_arrInsert.end() );
- shuffle( m_arrRemove.begin(), m_arrRemove.end() );
+ m_arrElements.resize( s_nMapSize );
+ for ( size_t i = 0; i < s_nMapSize; ++i )
+ m_arrElements[i] = i;;
+ shuffle( m_arrElements.begin(), m_arrElements.end());
}
void Map_DelOdd::TearDownTestCase()
{
- m_arrInsert.clear();
- m_arrRemove.clear();
+ m_arrElements.clear();
}
std::vector<size_t> Map_DelOdd_LF::get_load_factors()
return lf;
}
- INSTANTIATE_TEST_CASE_P( a, Map_DelOdd_LF, ::testing::ValuesIn( Map_DelOdd_LF::get_load_factors() ) );
+ INSTANTIATE_TEST_CASE_P( a, Map_DelOdd_LF, ::testing::ValuesIn( Map_DelOdd_LF::get_load_factors()));
} // namespace map