Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAB committed Apr 27, 2017
0 parents commit eb9391c
Show file tree
Hide file tree
Showing 2,201 changed files with 483,214 additions and 0 deletions.
28 changes: 28 additions & 0 deletions CDS_test/CDS_test.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CDS_test", "CDS_test.vcxproj", "{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Debug|x64.ActiveCfg = Debug|x64
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Debug|x64.Build.0 = Debug|x64
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Debug|x86.ActiveCfg = Debug|Win32
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Debug|x86.Build.0 = Debug|Win32
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Release|x64.ActiveCfg = Release|x64
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Release|x64.Build.0 = Release|x64
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Release|x86.ActiveCfg = Release|Win32
{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
125 changes: 125 additions & 0 deletions CDS_test/CDS_test.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A532CC77-0CBC-47C0-86BD-EB1BFB67880B}</ProjectGuid>
<RootNamespace>CDS_test</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>libcds</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Library Include="libcds-amd64-vcv140.lib" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="safe_ptr.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
12 changes: 12 additions & 0 deletions CDS_test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
benchmark : main.o
g++ -lm -pthread -O3 -o benchmark main.o ./libcds/bin/libcds-s.a


gcc = g++ -std=c++14 -pthread -I./libcds -O3 -c

main.o : main.cpp
$(gcc) main.cpp


clean :
rm main.o benchmark
50 changes: 50 additions & 0 deletions CDS_test/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Benchmark lock-free lib-CDS and `std::map` guarded by contention free shared mutex

Compares:

* `std::mutex + std::map`
* `SkipListMap`
* `BronsonAVLTreeMap`
* `contention_free_shared_mutex<> + std::map`


To build and test do:

```
cd libcds
make
cd ..
make
./bench.sh
```


----

### Results


Performance comparison of different multithread associative arrays on one server-CPU by using different number of threads.

In this benchmarks used this commit of libCDS: https://github.com/khizmax/libcds/tree/5e2a9854b0a8625183818eb8ad91e5511fed5898

Benchmark on Linux (GCC 4.9.2) - **1 x CPU** Intel Xeon E5-2660v3 2.6 GHz (Haswell) 10 Cores (20 HT) - total: 20 Threads

Command line for starting: `numactl --localalloc --cpunodebind=0 ./benchmark 16`


1. **Performance** (the bigger – the better), MOps - millions operations per second


![Performance contention free shared mutex](https://hsto.org/files/2c5/d6c/93b/2c5d6c93b48c464f8c7d2eb2f2254270.png)



2. **Median-latency** (the lower – the better), microseconds

To measure median latency – in the test code main.cpp, you should to set: `const bool measure_latency = true;`

![Latency contention free shared mutex](https://hsto.org/files/299/3f3/904/2993f39048694f9799a520c87dfbd5ac.png)


8 changes: 8 additions & 0 deletions CDS_test/bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#sudo apt-get install numactl
echo ------------------------------- >> bench_cds_log.txt
##date +%F >> bench_cds_log.txt
date +%T >> bench_cds_log.txt

numactl --localalloc --cpunodebind=0 ./benchmark 18 >> bench_cds_log.txt

# ./benchmark >> bench_cds_log.txt
6 changes: 6 additions & 0 deletions CDS_test/bench_show.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#sudo apt-get install numactl


numactl --localalloc --cpunodebind=0 ./benchmark 18

# ./benchmark
Binary file added CDS_test/libcds-amd64-vcv140.dll
Binary file not shown.
Binary file added CDS_test/libcds-amd64-vcv140.lib
Binary file not shown.
27 changes: 27 additions & 0 deletions CDS_test/libcds/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/doc
/sandbox
/projects/Win/vc12/cds.opensdf
/projects/Win/vc12/cds.sdf
/projects/Win/vc12/cds.v12.suo
/tests/cppunit/*.o
*.o
*.d
/tests/data/dictionary.txt
/bin
/obj
/projects/Win/vc12/*.user
/projects/Win/vc14/cds.sdf
/projects/Win/vc14/cds.v14.suo
/projects/Win/vc14/*.user
/projects/Win/vc14/*.opensdf
/projects/Win/vc14/.vs/
/todo-2.1.txt
*.log
/.project
/projects/Win/vc14/*.opendb
/test/stress/data/dictionary.txt
/projects/Win/vc14/cds.VC.db
/todo-2.2.txt
/build/Makefile
/build/build.sh
/build/sample
44 changes: 44 additions & 0 deletions CDS_test/libcds/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

language: cpp
compiler: g++
# - gcc
# - clang

before_install:
- export LIBCDS_BUILD_DIR=`pwd`
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- export GCC_VERSION=4.9
- export BOOST_VERSION=57

install:
- sudo apt-get install -qq g++-${GCC_VERSION}
- export CXX="g++-${GCC_VERSION}"
- wget -O boost_1_${BOOST_VERSION}_0.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.${BOOST_VERSION}.0/boost_1_${BOOST_VERSION}_0.tar.bz2/download
- tar xjf boost_1_${BOOST_VERSION}_0.tar.bz2
- cd boost_1_${BOOST_VERSION}_0
- ./bootstrap.sh
- ./b2 --with-thread --with-atomic --with-date_time --with-system --with-timer --stagedir=stage64 --toolset=gcc-${GCC_VERSION} address-model=64
- cd ..

before_script: cd ./build

script: ./build.sh -b 64 -j 2 -x ${CXX} -z '-Wall -Wextra -pedantic -Wno-unused-local-typedefs' --with-boost ../boost_1_${BOOST_VERSION}_0 -t test_hdr

#after_success:

#after_failure:

after_script: cd ..

# blacklist
#branches:
# except:
# - integration

# whitelist
branches:
only:
- master
- dev
- integration
Loading

0 comments on commit eb9391c

Please sign in to comment.