From 498411c2f35240013f69cc7e319e303a36b53860 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 30 May 2016 19:05:38 +0300 Subject: [PATCH] Migrated map-ins-del-find stress test to gtest --- projects/Win/vc14/cds.sln | 59 ++-- .../Win/vc14/stress-map-insdelfind.vcxproj | 273 +++++++++++++++ .../stress-map-insdelfind.vcxproj.filters | 60 ++++ .../Win/vc14/unit-map-insdel-item.vcxproj | 317 ----------------- .../vc14/unit-map-insdel-item.vcxproj.filters | 42 --- projects/Win/vc14/unit-map-insdelfind.vcxproj | 318 ------------------ projects/source.unit.map.mk | 19 -- test/include/cds_test/thread.h | 14 +- test/stress/data/test-debug.conf | 21 +- test/stress/data/test-express.conf | 21 +- test/stress/data/test.conf | 16 - test/stress/map/CMakeLists.txt | 2 + test/stress/map/insdelfind/CMakeLists.txt | 31 ++ test/stress/map/insdelfind/map_insdelfind.cpp | 134 ++++++++ test/stress/map/insdelfind/map_insdelfind.h | 262 +++++++++++++++ .../map_insdelfind_bronsonavltree.cpp | 38 +++ .../map/insdelfind/map_insdelfind_cuckoo.cpp | 38 +++ .../insdelfind/map_insdelfind_ellentree.cpp | 38 +++ .../map_insdelfind_feldman_hashset.cpp | 38 +++ .../map/insdelfind/map_insdelfind_michael.cpp | 38 +++ .../map/insdelfind/map_insdelfind_skip.cpp | 38 +++ .../map/insdelfind/map_insdelfind_split.cpp | 38 +++ .../map/insdelfind/map_insdelfind_std.cpp | 38 +++ .../map/insdelfind/map_insdelfind_striped.cpp | 38 +++ test/stress/set/insdel_find/set_insdelfind.h | 7 + 25 files changed, 1147 insertions(+), 791 deletions(-) create mode 100644 projects/Win/vc14/stress-map-insdelfind.vcxproj create mode 100644 projects/Win/vc14/stress-map-insdelfind.vcxproj.filters delete mode 100644 projects/Win/vc14/unit-map-insdel-item.vcxproj delete mode 100644 projects/Win/vc14/unit-map-insdel-item.vcxproj.filters delete mode 100644 projects/Win/vc14/unit-map-insdelfind.vcxproj create mode 100644 test/stress/map/insdelfind/CMakeLists.txt create mode 100644 test/stress/map/insdelfind/map_insdelfind.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind.h create mode 100644 test/stress/map/insdelfind/map_insdelfind_bronsonavltree.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_cuckoo.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_ellentree.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_feldman_hashset.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_michael.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_skip.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_split.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_std.cpp create mode 100644 test/stress/map/insdelfind/map_insdelfind_striped.cpp diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index f4da0054..91cdfc6e 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cds", "cds.vcxproj", "{408FE9BC-44F0-4E6A-89FA-D6F952584239}" EndProject @@ -54,18 +54,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-find", "unit-map-f {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-insdel-item", "unit-map-insdel-item.vcxproj", "{7521DD92-56FF-4ECA-93E5-CCE50862354B}" - ProjectSection(ProjectDependencies) = postProject - {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} - {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-insdelfind", "unit-map-insdelfind.vcxproj", "{CA6F0834-0628-4CD7-8800-AEABCD636360}" - ProjectSection(ProjectDependencies) = postProject - {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} - {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{810490B7-31E5-49AE-8455-CAF99A9658B6}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\test-hdr\size_check.h = ..\..\..\tests\test-hdr\size_check.h @@ -270,6 +258,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-map-insdel-item-int" {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-map-insdelfind", "stress-map-insdelfind.vcxproj", "{1BB746AC-7856-4E59-9430-51177621DC35}" + ProjectSection(ProjectDependencies) = postProject + {A34CED07-A442-4FA1-81C4-F8B9CD3C832B} = {A34CED07-A442-4FA1-81C4-F8B9CD3C832B} + {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -328,30 +322,6 @@ Global {BA2A9239-0299-4069-BB0E-16DACE87ADE0}.Release|Win32.Build.0 = Release|Win32 {BA2A9239-0299-4069-BB0E-16DACE87ADE0}.Release|x64.ActiveCfg = Release|x64 {BA2A9239-0299-4069-BB0E-16DACE87ADE0}.Release|x64.Build.0 = Release|x64 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|Win32.ActiveCfg = Debug|Win32 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|Win32.Build.0 = Debug|Win32 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|x64.ActiveCfg = Debug|x64 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|x64.Build.0 = Debug|x64 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.DebugVLD|x64.Build.0 = DebugVLD|x64 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Release|Win32.ActiveCfg = Release|Win32 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Release|Win32.Build.0 = Release|Win32 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Release|x64.ActiveCfg = Release|x64 - {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Release|x64.Build.0 = Release|x64 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Debug|Win32.ActiveCfg = Debug|Win32 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Debug|Win32.Build.0 = Debug|Win32 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Debug|x64.ActiveCfg = Debug|x64 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Debug|x64.Build.0 = Debug|x64 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.DebugVLD|x64.Build.0 = DebugVLD|x64 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|Win32.ActiveCfg = Release|Win32 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|Win32.Build.0 = Release|Win32 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|x64.ActiveCfg = Release|x64 - {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|x64.Build.0 = Release|x64 {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Debug|Win32.ActiveCfg = Debug|Win32 {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Debug|Win32.Build.0 = Debug|Win32 {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Debug|x64.ActiveCfg = Debug|x64 @@ -676,6 +646,18 @@ Global {50387CA5-F5B2-4C40-ACFD-FC3C9EE2CD6B}.Release|Win32.Build.0 = Release|Win32 {50387CA5-F5B2-4C40-ACFD-FC3C9EE2CD6B}.Release|x64.ActiveCfg = Release|x64 {50387CA5-F5B2-4C40-ACFD-FC3C9EE2CD6B}.Release|x64.Build.0 = Release|x64 + {1BB746AC-7856-4E59-9430-51177621DC35}.Debug|Win32.ActiveCfg = Debug|Win32 + {1BB746AC-7856-4E59-9430-51177621DC35}.Debug|Win32.Build.0 = Debug|Win32 + {1BB746AC-7856-4E59-9430-51177621DC35}.Debug|x64.ActiveCfg = Debug|x64 + {1BB746AC-7856-4E59-9430-51177621DC35}.Debug|x64.Build.0 = Debug|x64 + {1BB746AC-7856-4E59-9430-51177621DC35}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 + {1BB746AC-7856-4E59-9430-51177621DC35}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 + {1BB746AC-7856-4E59-9430-51177621DC35}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 + {1BB746AC-7856-4E59-9430-51177621DC35}.DebugVLD|x64.Build.0 = DebugVLD|x64 + {1BB746AC-7856-4E59-9430-51177621DC35}.Release|Win32.ActiveCfg = Release|Win32 + {1BB746AC-7856-4E59-9430-51177621DC35}.Release|Win32.Build.0 = Release|Win32 + {1BB746AC-7856-4E59-9430-51177621DC35}.Release|x64.ActiveCfg = Release|x64 + {1BB746AC-7856-4E59-9430-51177621DC35}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -685,8 +667,6 @@ Global {77350FDC-9E51-438B-9A8F-D2FEA11D46B2} = {B30CA283-1796-4763-92C3-2E4848D443F7} {6BB7A27F-FC59-4267-B6FA-D034176D1459} = {B30CA283-1796-4763-92C3-2E4848D443F7} {BA2A9239-0299-4069-BB0E-16DACE87ADE0} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} - {7521DD92-56FF-4ECA-93E5-CCE50862354B} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} - {CA6F0834-0628-4CD7-8800-AEABCD636360} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} {5407E9D2-67D9-4266-976E-7A90BDE2541D} = {810490B7-31E5-49AE-8455-CAF99A9658B6} {EA5D825A-83A4-4A36-83C1-3D048D21D55B} = {810490B7-31E5-49AE-8455-CAF99A9658B6} {ED94B1D1-2442-43C2-A71C-A757122408A6} = {810490B7-31E5-49AE-8455-CAF99A9658B6} @@ -718,6 +698,7 @@ Global {46649F79-2919-4B4C-B243-08C724901F58} = {7D3EE35B-185D-40B5-88C2-7F9933426978} {2D0E651D-058D-4D69-9A44-12149E6CA5BE} = {7D3EE35B-185D-40B5-88C2-7F9933426978} {50387CA5-F5B2-4C40-ACFD-FC3C9EE2CD6B} = {7D3EE35B-185D-40B5-88C2-7F9933426978} + {1BB746AC-7856-4E59-9430-51177621DC35} = {7D3EE35B-185D-40B5-88C2-7F9933426978} EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} diff --git a/projects/Win/vc14/stress-map-insdelfind.vcxproj b/projects/Win/vc14/stress-map-insdelfind.vcxproj new file mode 100644 index 00000000..6f7fb2bb --- /dev/null +++ b/projects/Win/vc14/stress-map-insdelfind.vcxproj @@ -0,0 +1,273 @@ + + + + + DebugVLD + Win32 + + + DebugVLD + x64 + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + + + + + + + + + {1BB746AC-7856-4E59-9430-51177621DC35} + Win32Proj + stress_map_insdelfind + 8.1 + stress-map-insdelfind + + + + Application + true + v140 + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + false + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + true + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtest.lib;stress-framework.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\map;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + true + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtest.lib;stress-framework.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/projects/Win/vc14/stress-map-insdelfind.vcxproj.filters b/projects/Win/vc14/stress-map-insdelfind.vcxproj.filters new file mode 100644 index 00000000..7ad17bf3 --- /dev/null +++ b/projects/Win/vc14/stress-map-insdelfind.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/projects/Win/vc14/unit-map-insdel-item.vcxproj b/projects/Win/vc14/unit-map-insdel-item.vcxproj deleted file mode 100644 index 5be8898b..00000000 --- a/projects/Win/vc14/unit-map-insdel-item.vcxproj +++ /dev/null @@ -1,317 +0,0 @@ - - - - - DebugVLD - Win32 - - - DebugVLD - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - {7521DD92-56FF-4ECA-93E5-CCE50862354B} - unitmap - Win32Proj - 8.1 - - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - v140 - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4520;4503 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4520;4503 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - 4520;4503 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - 4520;4503 - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4520;4503 - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX86 - $(TargetPath) - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4520;4503 - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX64 - $(TargetPath) - MultiplyDefinedSymbolOnly - - - - - - \ No newline at end of file diff --git a/projects/Win/vc14/unit-map-insdel-item.vcxproj.filters b/projects/Win/vc14/unit-map-insdel-item.vcxproj.filters deleted file mode 100644 index 69e374d6..00000000 --- a/projects/Win/vc14/unit-map-insdel-item.vcxproj.filters +++ /dev/null @@ -1,42 +0,0 @@ - - - - - {bd71af30-f7c6-4e9c-810f-dd0d5a6e64b0} - - - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - map_insdel_item_string - - - - - map_insdel_item_string - - - \ No newline at end of file diff --git a/projects/Win/vc14/unit-map-insdelfind.vcxproj b/projects/Win/vc14/unit-map-insdelfind.vcxproj deleted file mode 100644 index f74c581d..00000000 --- a/projects/Win/vc14/unit-map-insdelfind.vcxproj +++ /dev/null @@ -1,318 +0,0 @@ - - - - - DebugVLD - Win32 - - - DebugVLD - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - {CA6F0834-0628-4CD7-8800-AEABCD636360} - unitmap - Win32Proj - 8.1 - - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - v140 - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4503;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4503;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - 4503;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;NOMINMAX;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - 4503;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4503;%(DisableSpecificWarnings) - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX86 - $(TargetPath) - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NOMINMAX;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4503;%(DisableSpecificWarnings) - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX64 - $(TargetPath) - MultiplyDefinedSymbolOnly - - - - - - \ No newline at end of file diff --git a/projects/source.unit.map.mk b/projects/source.unit.map.mk index 9a7bb618..8a4371c0 100644 --- a/projects/source.unit.map.mk +++ b/projects/source.unit.map.mk @@ -10,22 +10,3 @@ CDSUNIT_MAP_SOURCES := \ tests/unit/map2/map_insfind_int_split.cpp \ tests/unit/map2/map_insfind_int_striped.cpp \ tests/unit/map2/map_insfind_int_std.cpp \ - tests/unit/map2/map_insdel_item_string.cpp \ - tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp \ - tests/unit/map2/map_insdel_item_string_cuckoo.cpp \ - tests/unit/map2/map_insdel_item_string_ellentree.cpp \ - tests/unit/map2/map_insdel_item_string_michael.cpp \ - tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp \ - tests/unit/map2/map_insdel_item_string_skip.cpp \ - tests/unit/map2/map_insdel_item_string_split.cpp \ - tests/unit/map2/map_insdel_item_string_striped.cpp \ - tests/unit/map2/map_insdelfind.cpp \ - tests/unit/map2/map_insdelfind_bronsonavltree.cpp \ - tests/unit/map2/map_insdelfind_cuckoo.cpp \ - tests/unit/map2/map_insdelfind_ellentree.cpp \ - tests/unit/map2/map_insdelfind_michael.cpp \ - tests/unit/map2/map_insdelfind_feldmanhashmap.cpp \ - tests/unit/map2/map_insdelfind_skip.cpp \ - tests/unit/map2/map_insdelfind_split.cpp \ - tests/unit/map2/map_insdelfind_striped.cpp \ - tests/unit/map2/map_insdelfind_std.cpp \ diff --git a/test/include/cds_test/thread.h b/test/include/cds_test/thread.h index 00ed2b36..8d2f55a8 100644 --- a/test/include/cds_test/thread.h +++ b/test/include/cds_test/thread.h @@ -138,7 +138,10 @@ namespace cds_test { std::this_thread::yield(); m_bTimeElapsed.store( false, std::memory_order_release ); + + auto native_duration = std::chrono::duration_cast(duration); auto time_start = std::chrono::steady_clock::now(); + auto const expected_end = time_start + native_duration; { scoped_lock l( m_cvMutex ); @@ -146,8 +149,15 @@ namespace cds_test { m_cvStart.notify_all(); } - if ( duration != std::chrono::seconds::zero() ) - std::this_thread::sleep_for( duration ); + if ( duration != std::chrono::seconds::zero() ) { + for ( ;; ) { + std::this_thread::sleep_for( native_duration ); + auto time_now = std::chrono::steady_clock::now(); + if ( time_now >= expected_end ) + break; + native_duration = expected_end - time_now; + } + } m_bTimeElapsed.store( true, std::memory_order_release ); { diff --git a/test/stress/data/test-debug.conf b/test/stress/data/test-debug.conf index f445688b..7e3c050b 100644 --- a/test/stress/data/test-debug.conf +++ b/test/stress/data/test-debug.conf @@ -270,23 +270,6 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDel_Item_string] -ThreadCount=4 -MapSize=10000 -GoalItemIndex=5000 -AttemptCount=1000 -MaxLoadFactor=4 -PrintGCStateFlag=1 -# *** Cuckoo map properties -CuckooInitialSize=256 -CuckooProbesetSize=8 -# 0 - use default -CuckooProbesetThreshold=0 - -# *** FeldmanHashMap properties -FeldmanMapHeadBits=8 -FeldmanMapArrayBits=4 - [Map_InsFind_int] ThreadCount=0 MapSize=1000 @@ -306,8 +289,8 @@ FeldmanMapArrayBits=4 InitialMapSize=50000 ThreadCount=4 MaxLoadFactor=8 -InsertPercentage=5 -DeletePercentage=5 +InsertPercentage=10 +DeletePercentage=10 Duration=5 # *** Cuckoo map properties diff --git a/test/stress/data/test-express.conf b/test/stress/data/test-express.conf index 01e996cd..a08ee2d4 100644 --- a/test/stress/data/test-express.conf +++ b/test/stress/data/test-express.conf @@ -264,23 +264,6 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDel_Item_string] -ThreadCount=8 -MapSize=100000 -GoalItemIndex=50000 -AttemptCount=100 -MaxLoadFactor=4 -PrintGCStateFlag=1 -# *** Cuckoo map properties -CuckooInitialSize=1024 -CuckooProbesetSize=16 -# 0 - use default -CuckooProbesetThreshold=0 - -# *** FeldmanHashMap properties -FeldmanMapHeadBits=8 -FeldmanMapArrayBits=4 - [Map_InsFind_int] ThreadCount=0 MapSize=1000 @@ -300,8 +283,8 @@ FeldmanMapArrayBits=4 InitialMapSize=500000 ThreadCount=8 MaxLoadFactor=4 -InsertPercentage=5 -DeletePercentage=5 +InsertPercentage=10 +DeletePercentage=10 Duration=5 # *** Cuckoo map properties diff --git a/test/stress/data/test.conf b/test/stress/data/test.conf index a87943b7..f165f44f 100644 --- a/test/stress/data/test.conf +++ b/test/stress/data/test.conf @@ -261,22 +261,6 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=10 FeldmanMapArrayBits=4 -[Map_InsDel_Item_string] -ThreadCount=8 -MapSize=10000 -GoalItemIndex=5000 -AttemptCount=10000 -MaxLoadFactor=4 -PrintGCStateFlag=1 -# *** Cuckoo map properties -CuckooInitialSize=1024 -CuckooProbesetSize=16 -# 0 - use default -CuckooProbesetThreshold=0 -# *** FeldmanHashMap properties -FeldmanMapHeadBits=10 -FeldmanMapArrayBits=4 - [Map_InsFind_int] ThreadCount=0 MapSize=5000 diff --git a/test/stress/map/CMakeLists.txt b/test/stress/map/CMakeLists.txt index 031ac67c..133079ab 100644 --- a/test/stress/map/CMakeLists.txt +++ b/test/stress/map/CMakeLists.txt @@ -8,6 +8,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_int) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_string) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_item_int) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdelfind) #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_find) #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func) #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_string) @@ -21,4 +22,5 @@ add_custom_target( stress-map stress-map-insdel-int stress-map-insdel-string stress-map-insdel-item-int + stress-map-insdelfind ) diff --git a/test/stress/map/insdelfind/CMakeLists.txt b/test/stress/map/insdelfind/CMakeLists.txt new file mode 100644 index 00000000..c02765ee --- /dev/null +++ b/test/stress/map/insdelfind/CMakeLists.txt @@ -0,0 +1,31 @@ +set(PACKAGE_NAME stress-map-insdelfind) + +set(CDSSTRESS_MAP_INSDELFIND_SOURCES + ../../main.cpp + map_insdelfind.cpp + map_insdelfind_bronsonavltree.cpp + map_insdelfind_cuckoo.cpp + map_insdelfind_ellentree.cpp + map_insdelfind_feldman_hashset.cpp + map_insdelfind_michael.cpp + map_insdelfind_skip.cpp + map_insdelfind_split.cpp + map_insdelfind_std.cpp + map_insdelfind_striped.cpp +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + +add_executable(${PACKAGE_NAME} ${CDSSTRESS_MAP_INSDELFIND_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} + ${CDS_SHARED_LIBRARY} + ${GTEST_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} +) + +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) \ No newline at end of file diff --git a/test/stress/map/insdelfind/map_insdelfind.cpp b/test/stress/map/insdelfind/map_insdelfind.cpp new file mode 100644 index 00000000..581bb9f3 --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind.cpp @@ -0,0 +1,134 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" + +namespace map { + + size_t Map_InsDelFind::s_nMapSize = 500000; + size_t Map_InsDelFind::s_nThreadCount = 8; + size_t Map_InsDelFind::s_nMaxLoadFactor = 8; + unsigned int Map_InsDelFind::s_nInsertPercentage = 5; + unsigned int Map_InsDelFind::s_nDeletePercentage = 5; + unsigned int Map_InsDelFind::s_nDuration = 30; + + + size_t Map_InsDelFind::s_nCuckooInitialSize = 1024;// initial size for CuckooSet + size_t Map_InsDelFind::s_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) + size_t Map_InsDelFind::s_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) + + size_t Map_InsDelFind::s_nFeldmanMap_HeadBits = 10; + size_t Map_InsDelFind::s_nFeldmanMap_ArrayBits = 4; + + size_t Map_InsDelFind::s_nLoadFactor = 1; + Map_InsDelFind::actions Map_InsDelFind::s_arrShuffle[Map_InsDelFind::c_nShuffleSize]; + + void Map_InsDelFind::SetUpTestCase() + { + cds_test::config const& cfg = get_config( "map_insdelfind" ); + + s_nMapSize = cfg.get_size_t( "InitialMapSize", s_nMapSize ); + if ( s_nMapSize < 1000 ) + s_nMapSize = 1000; + + s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); + if ( s_nThreadCount == 0 ) + s_nThreadCount = std::thread::hardware_concurrency() * 2; + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + s_nInsertPercentage = cfg.get_uint( "InsertPercentage", s_nInsertPercentage ); + if ( s_nInsertPercentage >= 100 ) + s_nInsertPercentage = 99; + + s_nDeletePercentage = cfg.get_uint( "DeletePercentage", s_nDeletePercentage ); + if ( s_nDeletePercentage >= 100 ) + s_nDeletePercentage = 99; + + if ( s_nInsertPercentage + s_nDeletePercentage > 100 ) { + unsigned int total = s_nInsertPercentage + s_nDeletePercentage; + s_nInsertPercentage = s_nInsertPercentage * 100 / total; + s_nDeletePercentage = s_nDeletePercentage * 100 / total; + } + + s_nDuration = cfg.get_uint( "Duration", s_nDuration ); + if ( s_nDuration < 5 ) + s_nDuration = 5; + + s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize ); + if ( s_nCuckooInitialSize < 256 ) + s_nCuckooInitialSize = 256; + + s_nCuckooProbesetSize = cfg.get_size_t( "CuckooProbesetSize", s_nCuckooProbesetSize ); + if ( s_nCuckooProbesetSize < 8 ) + s_nCuckooProbesetSize = 8; + + s_nCuckooProbesetThreshold = cfg.get_size_t( "CuckooProbesetThreshold", s_nCuckooProbesetThreshold ); + + s_nFeldmanMap_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanMap_HeadBits ); + if ( s_nFeldmanMap_HeadBits == 0 ) + s_nFeldmanMap_HeadBits = 2; + + s_nFeldmanMap_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanMap_ArrayBits ); + if ( s_nFeldmanMap_ArrayBits == 0 ) + s_nFeldmanMap_ArrayBits = 2; + + actions * pFirst = s_arrShuffle; + actions * pLast = s_arrShuffle + s_nInsertPercentage; + std::fill( pFirst, pLast, do_insert ); + pFirst = pLast; + pLast += s_nDeletePercentage; + std::fill( pFirst, pLast, do_delete ); + pFirst = pLast; + pLast = s_arrShuffle + sizeof( s_arrShuffle ) / sizeof( s_arrShuffle[0] ); + if ( pFirst < pLast ) + std::fill( pFirst, pLast, do_find ); + shuffle( s_arrShuffle, pLast ); + } + + std::vector Map_InsDelFind_LF::get_load_factors() + { + cds_test::config const& cfg = get_config( "map_insdelfind" ); + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + std::vector lf; + for ( size_t n = 1; n <= s_nMaxLoadFactor; n *= 2 ) + lf.push_back( n ); + + return lf; + } + + INSTANTIATE_TEST_CASE_P( a, Map_InsDelFind_LF, ::testing::ValuesIn( Map_InsDelFind_LF::get_load_factors())); +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind.h b/test/stress/map/insdelfind/map_insdelfind.h new file mode 100644 index 00000000..844e2b94 --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind.h @@ -0,0 +1,262 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_type.h" + +namespace map { + + + class Map_InsDelFind: public cds_test::stress_fixture + { + public: + static size_t s_nMapSize; // initial map size + static size_t s_nThreadCount; // thread count + static size_t s_nMaxLoadFactor; // maximum load factor + static unsigned int s_nInsertPercentage; + static unsigned int s_nDeletePercentage; + static unsigned int s_nDuration; // test duration, seconds + + static size_t s_nCuckooInitialSize; // initial size for CuckooMap + static size_t s_nCuckooProbesetSize; // CuckooMap probeset size (only for list-based probeset) + static size_t s_nCuckooProbesetThreshold; // CuckooMap probeset threshold (o - use default) + + static size_t s_nFeldmanMap_HeadBits; + static size_t s_nFeldmanMap_ArrayBits; + + static size_t s_nLoadFactor; // current load factor + + static void SetUpTestCase(); + //static void TearDownTestCase(); + + public: + enum actions + { + do_find, + do_insert, + do_delete + }; + static const unsigned int c_nShuffleSize = 100; + static actions s_arrShuffle[c_nShuffleSize]; + + protected: + typedef size_t key_type; + typedef size_t value_type; + + template + class Worker: public cds_test::thread + { + typedef cds_test::thread base_class; + Map& m_Map; + + public: + size_t m_nInsertSuccess = 0; + size_t m_nInsertFailed = 0; + size_t m_nDeleteSuccess = 0; + size_t m_nDeleteFailed = 0; + size_t m_nFindSuccess = 0; + size_t m_nFindFailed = 0; + + public: + Worker( cds_test::thread_pool& pool, Map& map ) + : base_class( pool ) + , m_Map( map ) + {} + + Worker( Worker& src ) + : base_class( src ) + , m_Map( src.m_Map ) + {} + + virtual thread * clone() + { + return new Worker( *this ); + } + + typedef std::pair< key_type const, value_type > map_value_type; + + struct update_functor { + template + void operator()( bool /*bNew*/, map_value_type& /*cur*/, Q const& /*val*/ ) + {} + + // FeldmanHashMap + void operator()( map_value_type& /*cur*/, map_value_type * /*old*/) + {} + + // MichaelMap + void operator()( bool /*bNew*/, map_value_type& /*cur*/ ) + {} + + // BronsonAVLTreeMap + void operator()( bool /*bNew*/, key_type /*key*/, value_type& /*val*/ ) + {} + }; + + virtual void test() + { + Map& rMap = m_Map; + + unsigned int i = 0; + size_t const nNormalize = size_t(-1) / ( s_nMapSize * 2 ); + + size_t nRand = 0; + while ( !time_elapsed() ) { + nRand = cds::bitop::RandXorShift( nRand ); + size_t n = nRand / nNormalize; + switch ( s_arrShuffle[i] ) { + case do_find: + if ( rMap.contains( n )) + ++m_nFindSuccess; + else + ++m_nFindFailed; + break; + case do_insert: + if ( n % 2 ) { + if ( rMap.insert( n, n )) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + } + else { + if ( rMap.update( n, update_functor(), true ).first ) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + } + break; + case do_delete: + if ( rMap.erase( n )) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + break; + } + + if ( ++i >= c_nShuffleSize ) + i = 0; + } + } + }; + + protected: + template + void do_test( Map& testMap ) + { + typedef Worker worker; + + // fill map - only odd number + { + std::vector arr; + arr.reserve( s_nMapSize ); + for ( size_t i = 0; i < s_nMapSize; ++i ) + arr.push_back( i * 2 + 1); + shuffle( arr.begin(), arr.end() ); + for ( size_t i = 0; i < s_nMapSize; ++i ) + testMap.insert( arr[i], arr[i] ); + } + + cds_test::thread_pool& pool = get_pool(); + pool.add( new worker( pool, testMap ), s_nThreadCount ); + + propout() << std::make_pair( "thread_count", s_nThreadCount ) + << std::make_pair( "insert_percentage", s_nInsertPercentage ) + << std::make_pair( "delete_percentage", s_nDeletePercentage ) + << std::make_pair( "map_size", s_nMapSize ); + + std::chrono::milliseconds duration = pool.run( std::chrono::seconds( s_nDuration )); + + propout() << std::make_pair( "duration", duration ); + + size_t nInsertSuccess = 0; + size_t nInsertFailed = 0; + size_t nDeleteSuccess = 0; + size_t nDeleteFailed = 0; + size_t nFindSuccess = 0; + size_t nFindFailed = 0; + for ( size_t i = 0; i < pool.size(); ++i ) { + worker& thr = static_cast( pool.get( i )); + + nInsertSuccess += thr.m_nInsertSuccess; + nInsertFailed += thr.m_nInsertFailed; + nDeleteSuccess += thr.m_nDeleteSuccess; + nDeleteFailed += thr.m_nDeleteFailed; + nFindSuccess += thr.m_nFindSuccess; + nFindFailed += thr.m_nFindFailed; + } + + propout() + << std::make_pair( "insert_success", nInsertSuccess ) + << std::make_pair( "insert_failed", nInsertFailed ) + << std::make_pair( "delete_success", nDeleteSuccess ) + << std::make_pair( "delete_failed", nDeleteFailed ) + << std::make_pair( "find_success", nFindSuccess ) + << std::make_pair( "find_failed", nFindFailed ) + << std::make_pair( "finish_map_size", testMap.size() ); + + { + ASSERT_TRUE( std::chrono::duration_cast(duration).count() > 0 ); + size_t nTotalOps = nInsertSuccess + nInsertFailed + nDeleteSuccess + nDeleteFailed + nFindSuccess + nFindFailed; + propout() << std::make_pair( "avg_speed", nTotalOps / std::chrono::duration_cast( duration ).count()); + } + + check_before_cleanup( testMap ); + + testMap.clear(); + EXPECT_TRUE( testMap.empty()); + + additional_check( testMap ); + print_stat( propout(), testMap ); + additional_cleanup( testMap ); + } + + template + void run_test() + { + Map testMap( *this ); + do_test( testMap ); + } + }; + + class Map_InsDelFind_LF: public Map_InsDelFind + , public ::testing::WithParamInterface + { + public: + template + void run_test() + { + s_nLoadFactor = GetParam(); + propout() << std::make_pair( "load_factor", s_nLoadFactor ); + Map_InsDelFind::run_test(); + } + + static std::vector get_load_factors(); + }; + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_bronsonavltree.cpp b/test/stress/map/insdelfind/map_insdelfind_bronsonavltree.cpp new file mode 100644 index 00000000..1502e0a6 --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_bronsonavltree.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_bronson_avltree.h" + +namespace map { + + CDSSTRESS_BronsonAVLTreeMap( Map_InsDelFind, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_cuckoo.cpp b/test/stress/map/insdelfind/map_insdelfind_cuckoo.cpp new file mode 100644 index 00000000..89a84f9b --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_cuckoo.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_cuckoo.h" + +namespace map { + + CDSSTRESS_CuckooMap( Map_InsDelFind, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_ellentree.cpp b/test/stress/map/insdelfind/map_insdelfind_ellentree.cpp new file mode 100644 index 00000000..a279b14e --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_ellentree.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_ellen_bintree.h" + +namespace map { + + CDSSTRESS_EllenBinTreeMap( Map_InsDelFind, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_feldman_hashset.cpp b/test/stress/map/insdelfind/map_insdelfind_feldman_hashset.cpp new file mode 100644 index 00000000..0f7ebcc4 --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_feldman_hashset.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_feldman_hashmap.h" + +namespace map { + + CDSSTRESS_FeldmanHashMap_fixed( Map_InsDelFind, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_michael.cpp b/test/stress/map/insdelfind/map_insdelfind_michael.cpp new file mode 100644 index 00000000..da6e16ab --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_michael.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_michael.h" + +namespace map { + + CDSSTRESS_MichaelMap( Map_InsDelFind_LF, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_skip.cpp b/test/stress/map/insdelfind/map_insdelfind_skip.cpp new file mode 100644 index 00000000..4bbd6346 --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_skip.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_skip_list.h" + +namespace map { + + CDSSTRESS_SkipListMap( Map_InsDelFind, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_split.cpp b/test/stress/map/insdelfind/map_insdelfind_split.cpp new file mode 100644 index 00000000..febb310f --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_split.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_split_list.h" + +namespace map { + + CDSSTRESS_SplitListMap( Map_InsDelFind_LF, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_std.cpp b/test/stress/map/insdelfind/map_insdelfind_std.cpp new file mode 100644 index 00000000..013091da --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_std.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_std.h" + +namespace map { + + CDSSTRESS_StdMap( Map_InsDelFind, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/map/insdelfind/map_insdelfind_striped.cpp b/test/stress/map/insdelfind/map_insdelfind_striped.cpp new file mode 100644 index 00000000..46ed0def --- /dev/null +++ b/test/stress/map/insdelfind/map_insdelfind_striped.cpp @@ -0,0 +1,38 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + 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: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + 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. +*/ + +#include "map_insdelfind.h" +#include "map_type_striped.h" + +namespace map { + + CDSSTRESS_StripedMap( Map_InsDelFind_LF, run_test, size_t, size_t ) + +} // namespace map diff --git a/test/stress/set/insdel_find/set_insdelfind.h b/test/stress/set/insdel_find/set_insdelfind.h index d8fc0fed..a262a877 100644 --- a/test/stress/set/insdel_find/set_insdelfind.h +++ b/test/stress/set/insdel_find/set_insdelfind.h @@ -193,6 +193,13 @@ namespace set { << std::make_pair( "find_success", nFindSuccess ) << std::make_pair( "find_failed", nFindFailed ); + { + ASSERT_TRUE( std::chrono::duration_cast(duration).count() > 0 ); + size_t nTotalOps = nInsertSuccess + nInsertFailed + nDeleteSuccess + nDeleteFailed + nFindSuccess + nFindFailed; + propout() << std::make_pair( "avg_speed", nTotalOps / std::chrono::duration_cast(duration).count() ); + } + + testSet.clear(); EXPECT_TRUE( testSet.empty()) << "set size=" << testSet.size(); -- 2.34.1