X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Fstress%2Fmap%2Finsdelfind%2Fmap_insdelfind.cpp;h=9594011b8636e0329cf6f0610afc13cc7249168f;hb=325f100f413398761a38f844f49b45c7e1855643;hp=581bb9f3f5447f6320aca8094b3e997494391913;hpb=7448008aa977fe42a83738fbbc63ce11d8ab86f9;p=libcds.git diff --git a/test/stress/map/insdelfind/map_insdelfind.cpp b/test/stress/map/insdelfind/map_insdelfind.cpp index 581bb9f3..9594011b 100644 --- a/test/stress/map/insdelfind/map_insdelfind.cpp +++ b/test/stress/map/insdelfind/map_insdelfind.cpp @@ -1,11 +1,11 @@ /* 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: @@ -25,7 +25,7 @@ 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_insdelfind.h" @@ -34,6 +34,21 @@ namespace map { size_t Map_InsDelFind::s_nMapSize = 500000; size_t Map_InsDelFind::s_nThreadCount = 8; + size_t Map_InsDelFind::s_nPassCount = 100000; + size_t Map_InsDelFind::s_nBronsonAVLTreeMapPassCount = 100; + + size_t Map_InsDelFind::s_nHpFeldmanPassCount = 100; + size_t Map_InsDelFind::s_nHpEllenBinTreeMapPassCount = 100; + size_t Map_InsDelFind::s_nHpMichaelMapPassCount = 100; + size_t Map_InsDelFind::s_nHpSkipListMapPassCount = 100; + size_t Map_InsDelFind::s_nHpSplitListMapPassCount = 100; + + size_t Map_InsDelFind::s_nRcuFeldmanPassCount = 100; + size_t Map_InsDelFind::s_nRcuEllenBinTreeMapPassCount = 100; + size_t Map_InsDelFind::s_nRcuMichaelMapPassCount = 100; + size_t Map_InsDelFind::s_nRcuSkipListMapPassCount = 100; + size_t Map_InsDelFind::s_nRcuSplitListMapPassCount = 100; + size_t Map_InsDelFind::s_nMaxLoadFactor = 8; unsigned int Map_InsDelFind::s_nInsertPercentage = 5; unsigned int Map_InsDelFind::s_nDeletePercentage = 5; @@ -60,7 +75,61 @@ namespace map { s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); if ( s_nThreadCount == 0 ) - s_nThreadCount = std::thread::hardware_concurrency() * 2; + s_nThreadCount = std::min( 16u, std::thread::hardware_concurrency() * 2 ); + + s_nPassCount = cfg.get_size_t( "PassCount", s_nPassCount ); + if ( s_nPassCount == 0 ) + s_nPassCount = 1000; + + s_nHpFeldmanPassCount = + cfg.get_size_t("HpFeldmanPassCount", s_nHpFeldmanPassCount); + if (s_nHpFeldmanPassCount == 0) + s_nHpFeldmanPassCount = 500; + + s_nRcuFeldmanPassCount = + cfg.get_size_t("RcuFeldmanPassCount", s_nRcuFeldmanPassCount); + if (s_nRcuFeldmanPassCount == 0) + s_nRcuFeldmanPassCount = 500; + + s_nHpEllenBinTreeMapPassCount = cfg.get_size_t( + "HpEllenBinTreeMapPassCount", s_nHpEllenBinTreeMapPassCount); + if (s_nHpEllenBinTreeMapPassCount == 0) + s_nHpEllenBinTreeMapPassCount = 500; + + s_nRcuEllenBinTreeMapPassCount = cfg.get_size_t( + "RcuEllenBinTreeMapPassCount", s_nRcuEllenBinTreeMapPassCount); + if (s_nRcuEllenBinTreeMapPassCount == 0) + s_nRcuEllenBinTreeMapPassCount = 500; + + s_nHpMichaelMapPassCount = + cfg.get_size_t("HpMichaelMapPassCount", s_nHpMichaelMapPassCount); + if (s_nHpMichaelMapPassCount == 0) + s_nHpMichaelMapPassCount = 500; + + s_nRcuMichaelMapPassCount = + cfg.get_size_t("RcuMichaelMapPassCount", s_nRcuMichaelMapPassCount); + if (s_nRcuMichaelMapPassCount == 0) + s_nRcuMichaelMapPassCount = 500; + + s_nHpSkipListMapPassCount = + cfg.get_size_t("HpSkipListMapPassCount", s_nHpSkipListMapPassCount); + if (s_nHpSkipListMapPassCount == 0) + s_nHpSkipListMapPassCount = 500; + + s_nRcuSkipListMapPassCount = + cfg.get_size_t("RcuSkipListMapPassCount", s_nRcuSkipListMapPassCount); + if (s_nRcuSkipListMapPassCount == 0) + s_nRcuSkipListMapPassCount = 500; + + s_nHpSplitListMapPassCount = + cfg.get_size_t("HpSplitListMapPassCount", s_nHpSplitListMapPassCount); + if (s_nHpSplitListMapPassCount == 0) + s_nHpSplitListMapPassCount = 500; + + s_nRcuSplitListMapPassCount = + cfg.get_size_t("RcuSplitListMapPassCount", s_nRcuSplitListMapPassCount); + if (s_nRcuSplitListMapPassCount == 0) + s_nRcuSplitListMapPassCount = 500; s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); if ( s_nMaxLoadFactor == 0 ) @@ -130,5 +199,14 @@ namespace map { return lf; } +#ifdef CDSTEST_GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG + static std::string get_test_parameter_name( testing::TestParamInfo const& p ) + { + return std::to_string( p.param ); + } + INSTANTIATE_TEST_CASE_P( a, Map_InsDelFind_LF, ::testing::ValuesIn( Map_InsDelFind_LF::get_load_factors()), get_test_parameter_name ); +#else INSTANTIATE_TEST_CASE_P( a, Map_InsDelFind_LF, ::testing::ValuesIn( Map_InsDelFind_LF::get_load_factors())); +#endif + } // namespace map