Skip to content

Commit f75d096

Browse files
committed
Initial commit
0 parents  commit f75d096

304 files changed

Lines changed: 20761 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/obj
2+
/bin
3+
/lib
4+
/build
5+
.vs

‎CMakeLists.txt‎

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
project(Disruptor)
2+
cmake_minimum_required(VERSION 2.6)
3+
4+
set(DISRUPTOR_VERSION_MAJOR "1")
5+
set(DISRUPTOR_VERSION_MINOR "0")
6+
set(DISRUPTOR_VERSION_PATCH "0")
7+
set(DISRUPTOR_VERSION
8+
"${DISRUPTOR_VERSION_MAJOR}.${DISRUPTOR_VERSION_MINOR}.${DISRUPTOR_VERSION_PATCH}"
9+
)
10+
11+
enable_testing()
12+
13+
# enable gcc specific stuff
14+
if(CMAKE_COMPILER_IS_GNUCXX)
15+
if(NOT CXX11_ENABLED)
16+
message(STATUS "Checking for g++ version >= 4.8")
17+
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
18+
19+
if(GCC_VERSION VERSION_LESS 4.8)
20+
message(FATAL_ERROR "g++ version is ${GCC_VERSION}")
21+
endif()
22+
23+
include(CheckCXXCompilerFlag)
24+
check_cxx_compiler_flag(-std=c++14 FLAG_CXX11)
25+
if(FLAG_CXX11)
26+
message(STATUS "C++11 features enabled")
27+
set(CXX11_ENABLED ON CACHE INTERNAL "C++11 features enabled")
28+
else()
29+
message(FATAL_ERROR "g++ does not support the -std=c++14 flag")
30+
endif()
31+
endif()
32+
33+
set(COMPILER_FLAGS "-std=c++14")
34+
set(WARNING_FLAGS "-W -Wall")
35+
36+
if(CMAKE_BUILD_TYPE STREQUAL "debug")
37+
message(STATUS "Enabling debugging symbols")
38+
set(COMPILER_FLAGS "${COMPILER_FLAGS} -g")
39+
else()
40+
set(COMPILER_FLAGS "${COMPILER_FLAGS} -O2")
41+
endif()
42+
43+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
44+
add_definitions(-fPIC)
45+
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
46+
47+
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
48+
if(NOT CXX11_ENABLED)
49+
include(CheckCXXCompilerFlag)
50+
check_cxx_compiler_flag(-std=c++14 FLAG_CXX11)
51+
if(FLAG_CXX11)
52+
message(STATUS "C++11 features enabled")
53+
set(CXX11_ENABLED ON CACHE INTERNAL "C++11 features enabled")
54+
else()
55+
message(FATAL_ERROR "Clang does not support the -std=c++14 flag")
56+
endif()
57+
endif()
58+
59+
set(COMPILER_FLAGS "-std=c++14")
60+
set(WARNING_FLAGS "-W -Wall")
61+
62+
if(CMAKE_BUILD_TYPE STREQUAL "debug")
63+
message(STATUS "Enabling debugging symbols")
64+
set(COMPILER_FLAGS "${COMPILER_FLAGS} -g")
65+
else()
66+
set(COMPILER_FLAGS "${COMPILER_FLAGS} -O2")
67+
endif()
68+
69+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
70+
add_definitions(-fPIC)
71+
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
72+
73+
endif()
74+
75+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} ${WARNING_FLAGS}")
76+
77+
find_package(GTest)
78+
79+
add_subdirectory(Disruptor)
80+
add_subdirectory(Disruptor.PerfTests)
81+
add_subdirectory(Disruptor.TestTools)
82+
add_subdirectory(Disruptor.Tests)
83+
84+
85+
# uninstall target
86+
##################
87+
#
88+
89+
configure_file(
90+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
91+
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
92+
IMMEDIATE @ONLY
93+
)
94+
95+
add_custom_target(uninstall
96+
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
97+
)
98+
99+
100+
# Packaging stuff
101+
#################
102+
#
103+
104+
set(CPACK_PACKAGE_VERSION_MAJOR "${DISRUPTOR_VERSION_MAJOR}")
105+
set(CPACK_PACKAGE_VERSION_MINOR "${DISRUPTOR_VERSION_MINOR}")
106+
set(CPACK_PACKAGE_VERSION_PATCH "${DISRUPTOR_VERSION_PATCH}")
107+
108+
set(CPACK_SOURCE_PACKAGE_FILE_NAME
109+
"${CMAKE_PROJECT_NAME}-${DISRUPTOR_VERSION}"
110+
)
111+
112+
set(CPACK_SOURCE_GENERATOR "TBZ2")
113+
set(CPACK_SOURCE_IGNORE_FILES
114+
"build/"
115+
"ipch/"
116+
"/resources/"
117+
".sdf$;.suo$;.tss$"
118+
)
119+
120+
include(CPack)
121+
add_custom_target(distr COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
122+

‎Disruptor-all.sln‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 14
3+
VisualStudioVersion = 14.0.25420.1
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Disruptor", "Disruptor\Disruptor.vcxproj", "{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}"
6+
EndProject
7+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Disruptor.Tests", "Disruptor.Tests\Disruptor.Tests.vcxproj", "{31883900-84FA-4EA0-B33A-0FDE44979F13}"
8+
ProjectSection(ProjectDependencies) = postProject
9+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588} = {0A1FF4F2-CD19-4B2B-944A-F14B849A2588}
10+
EndProjectSection
11+
EndProject
12+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Disruptor.PerfTests", "Disruptor.PerfTests\Disruptor.PerfTests.vcxproj", "{E580C3C4-C69D-4F84-B023-68DB76080186}"
13+
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0222BD82-4B1B-4D6F-8A35-8805B1087033}"
15+
EndProject
16+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Disruptor.TestTools", "Disruptor.TestTools\Disruptor.TestTools.vcxproj", "{636795CA-A154-4C4B-B054-658F333F27E7}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|x64 = Debug|x64
21+
Release|x64 = Release|x64
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Debug|x64.ActiveCfg = Debug|x64
25+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Debug|x64.Build.0 = Debug|x64
26+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Release|x64.ActiveCfg = Release|x64
27+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Release|x64.Build.0 = Release|x64
28+
{31883900-84FA-4EA0-B33A-0FDE44979F13}.Debug|x64.ActiveCfg = Debug|x64
29+
{31883900-84FA-4EA0-B33A-0FDE44979F13}.Debug|x64.Build.0 = Debug|x64
30+
{31883900-84FA-4EA0-B33A-0FDE44979F13}.Release|x64.ActiveCfg = Release|x64
31+
{31883900-84FA-4EA0-B33A-0FDE44979F13}.Release|x64.Build.0 = Release|x64
32+
{E580C3C4-C69D-4F84-B023-68DB76080186}.Debug|x64.ActiveCfg = Debug|x64
33+
{E580C3C4-C69D-4F84-B023-68DB76080186}.Debug|x64.Build.0 = Debug|x64
34+
{E580C3C4-C69D-4F84-B023-68DB76080186}.Release|x64.ActiveCfg = Release|x64
35+
{E580C3C4-C69D-4F84-B023-68DB76080186}.Release|x64.Build.0 = Release|x64
36+
{636795CA-A154-4C4B-B054-658F333F27E7}.Debug|x64.ActiveCfg = Debug|x64
37+
{636795CA-A154-4C4B-B054-658F333F27E7}.Debug|x64.Build.0 = Debug|x64
38+
{636795CA-A154-4C4B-B054-658F333F27E7}.Release|x64.ActiveCfg = Release|x64
39+
{636795CA-A154-4C4B-B054-658F333F27E7}.Release|x64.Build.0 = Release|x64
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
GlobalSection(NestedProjects) = preSolution
45+
{31883900-84FA-4EA0-B33A-0FDE44979F13} = {0222BD82-4B1B-4D6F-8A35-8805B1087033}
46+
{E580C3C4-C69D-4F84-B023-68DB76080186} = {0222BD82-4B1B-4D6F-8A35-8805B1087033}
47+
{636795CA-A154-4C4B-B054-658F333F27E7} = {0222BD82-4B1B-4D6F-8A35-8805B1087033}
48+
EndGlobalSection
49+
EndGlobal

‎Disruptor-lib.sln‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.27004.2006
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Disruptor", "Disruptor\Disruptor.vcxproj", "{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}"
6+
EndProject
7+
Global
8+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|x64 = Debug|x64
10+
Release|x64 = Release|x64
11+
EndGlobalSection
12+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Debug|x64.ActiveCfg = Debug|x64
14+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Debug|x64.Build.0 = Debug|x64
15+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Release|x64.ActiveCfg = Release|x64
16+
{0A1FF4F2-CD19-4B2B-944A-F14B849A2588}.Release|x64.Build.0 = Release|x64
17+
EndGlobalSection
18+
GlobalSection(SolutionProperties) = preSolution
19+
HideSolutionNode = FALSE
20+
EndGlobalSection
21+
GlobalSection(ExtensibilityGlobals) = postSolution
22+
SolutionGuid = {6BE09E8D-A408-4BC1-97CD-D761CC2E301E}
23+
EndGlobalSection
24+
EndGlobal

‎Disruptor.PerfTests.Results.txt‎

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
Latency Test to run => PingPongSequencedLatencyTest, Runs => 3
2+
Starting latency tests
3+
Run: Duration (s): 24.3, Latency: min: 2.85 us, mean: 6.74 us, max: 438 us, Q99.99: 79.5 us, Q99.9: 27.9 us, Q99: 9.69 us, Q98: 7.7 us, Q95: 6.84 us, Q93: 6.84 us, Q90: 6.84 us, Q50: 6.56 us
4+
Run: Duration (s): 23.9, Latency: min: 3.42 us, mean: 6.65 us, max: 2.21 ms, Q99.99: 75.6 us, Q99.9: 21.1 us, Q99: 8.27 us, Q98: 7.41 us, Q95: 6.84 us, Q93: 6.84 us, Q90: 6.84 us, Q50: 6.56 us
5+
Run: Duration (s): 24.1, Latency: min: 570 ns, mean: 6.73 us, max: 541 us, Q99.99: 72.7 us, Q99.9: 25.9 us, Q99: 9.41 us, Q98: 7.41 us, Q95: 6.84 us, Q93: 6.84 us, Q90: 6.84 us, Q50: 6.56 us
6+
Throughput Test to run => OneToOneRawBatchThroughputTest, Runs => 7
7+
Starting throughput tests
8+
Run: Ops: 426 757 799 - Duration (s): 4.69
9+
Run: Ops: 454 229 558 - Duration (s): 4.4
10+
Run: Ops: 292 227 536 - Duration (s): 6.84
11+
Run: Ops: 350 759 165 - Duration (s): 5.7
12+
Run: Ops: 473 021 569 - Duration (s): 4.23
13+
Run: Ops: 473 122 613 - Duration (s): 4.23
14+
Run: Ops: 471 120 102 - Duration (s): 4.25
15+
Throughput Test to run => OneToOneRawThroughputTest, Runs => 7
16+
Starting throughput tests
17+
Run: Ops: 44 937 518 - Duration (s): 4.45
18+
Run: Ops: 44 301 517 - Duration (s): 4.51
19+
Run: Ops: 44 922 257 - Duration (s): 4.45
20+
Run: Ops: 44 927 938 - Duration (s): 4.45
21+
Run: Ops: 44 935 105 - Duration (s): 4.45
22+
Run: Ops: 44 890 284 - Duration (s): 4.46
23+
Run: Ops: 44 811 590 - Duration (s): 4.46
24+
Throughput Test to run => OneToOneSequencedBatchThroughputTest, Runs => 7
25+
Starting throughput tests
26+
Run: Ops: 37 028 390 - Duration (s): 27
27+
Run: Ops: 37 155 526 - Duration (s): 26.9
28+
Run: Ops: 37 217 579 - Duration (s): 26.9
29+
Run: Ops: 37 176 588 - Duration (s): 26.9
30+
Run: Ops: 37 274 187 - Duration (s): 26.8
31+
Run: Ops: 37 216 046 - Duration (s): 26.9
32+
Run: Ops: 37 173 062 - Duration (s): 26.9
33+
Throughput Test to run => OneToOneSequencedLongArrayThroughputTest, Runs => 7
34+
Starting throughput tests
35+
Run: Ops: 473 630 703 - Duration (s): 4.32
36+
Run: Ops: 466 345 371 - Duration (s): 4.39
37+
Run: Ops: 473 989 589 - Duration (s): 4.32
38+
Run: Ops: 473 911 057 - Duration (s): 4.32
39+
Run: Ops: 473 403 200 - Duration (s): 4.33
40+
Run: Ops: 473 712 210 - Duration (s): 4.32
41+
Run: Ops: 474 411 433 - Duration (s): 4.32
42+
Throughput Test to run => OneToOneSequencedPollerThroughputTest, Runs => 7
43+
Starting throughput tests
44+
Run: Ops: 15 717 727 - Duration (s): 6.36
45+
Run: Ops: 15 573 759 - Duration (s): 6.42
46+
Run: Ops: 16 150 290 - Duration (s): 6.19
47+
Run: Ops: 16 162 849 - Duration (s): 6.19
48+
Run: Ops: 16 309 858 - Duration (s): 6.13
49+
Run: Ops: 16 474 782 - Duration (s): 6.07
50+
Run: Ops: 16 208 309 - Duration (s): 6.17
51+
Throughput Test to run => OneToOneSequencedThroughputTest, Runs => 7
52+
Starting throughput tests
53+
Run: Ops: 15 204 126 - Duration (s): 6.58
54+
Run: Ops: 15 409 897 - Duration (s): 6.49
55+
Run: Ops: 15 289 596 - Duration (s): 6.54
56+
Run: Ops: 15 200 296 - Duration (s): 6.58
57+
Run: Ops: 15 186 697 - Duration (s): 6.58
58+
Run: Ops: 15 197 538 - Duration (s): 6.58
59+
Run: Ops: 15 218 117 - Duration (s): 6.57
60+
Throughput Test to run => OneToOneTranslatorThroughputTest, Runs => 7
61+
Starting throughput tests
62+
Run: Ops: 13 026 354 - Duration (s): 7.68
63+
Run: Ops: 13 890 494 - Duration (s): 7.2
64+
Run: Ops: 13 523 725 - Duration (s): 7.39
65+
Run: Ops: 13 782 653 - Duration (s): 7.26
66+
Run: Ops: 13 564 643 - Duration (s): 7.37
67+
Run: Ops: 13 861 754 - Duration (s): 7.21
68+
Run: Ops: 13 076 534 - Duration (s): 7.65
69+
Throughput Test to run => OneToThreeDiamondSequencedThroughputTest, Runs => 7
70+
Starting throughput tests
71+
Run: Ops: 26 492 796 - Duration (s): 3.77
72+
Run: Ops: 27 129 208 - Duration (s): 3.69
73+
Run: Ops: 26 384 695 - Duration (s): 3.79
74+
Run: Ops: 25 786 893 - Duration (s): 3.88
75+
Run: Ops: 25 026 171 - Duration (s): 4
76+
Run: Ops: 26 587 733 - Duration (s): 3.76
77+
Run: Ops: 26 054 218 - Duration (s): 3.84
78+
Throughput Test to run => OneToThreePipelineSequencedThroughputTest, Runs => 7
79+
Starting throughput tests
80+
Run: Ops: 16 133 083 - Duration (s): 6.2
81+
Run: Ops: 16 245 293 - Duration (s): 6.16
82+
Run: Ops: 13 155 011 - Duration (s): 7.6
83+
Run: Ops: 16 370 539 - Duration (s): 6.11
84+
Run: Ops: 16 140 460 - Duration (s): 6.2
85+
Run: Ops: 15 980 534 - Duration (s): 6.26
86+
Run: Ops: 16 220 923 - Duration (s): 6.16
87+
Throughput Test to run => OneToThreeReleasingWorkerPoolThroughputTest, Runs => 7
88+
Starting throughput tests
89+
Run: Ops: 7 390 895 - Duration (s): 1.35
90+
Run: Ops: 7 511 517 - Duration (s): 1.33
91+
Run: Ops: 7 744 187 - Duration (s): 1.29
92+
Run: Ops: 7 456 026 - Duration (s): 1.34
93+
Run: Ops: 7 455 514 - Duration (s): 1.34
94+
Run: Ops: 7 405 651 - Duration (s): 1.35
95+
Run: Ops: 7 483 567 - Duration (s): 1.34
96+
Throughput Test to run => OneToThreeSequencedThroughputTest, Runs => 7
97+
Starting throughput tests
98+
Run: Ops: 58 361 773 - Duration (s): 5.14
99+
Run: Ops: 59 481 499 - Duration (s): 5.04
100+
Run: Ops: 61 742 318 - Duration (s): 4.86
101+
Run: Ops: 58 333 221 - Duration (s): 5.14
102+
Run: Ops: 58 785 434 - Duration (s): 5.1
103+
Run: Ops: 60 284 434 - Duration (s): 4.98
104+
Run: Ops: 76 568 779 - Duration (s): 3.92
105+
Throughput Test to run => OneToThreeWorkerPoolThroughputTest, Runs => 7
106+
Starting throughput tests
107+
Run: Ops: 6 783 512 - Duration (s): 14.7
108+
Run: Ops: 6 775 174 - Duration (s): 14.8
109+
Run: Ops: 6 807 026 - Duration (s): 14.7
110+
Run: Ops: 6 655 154 - Duration (s): 15
111+
Run: Ops: 6 801 565 - Duration (s): 14.7
112+
Run: Ops: 6 864 575 - Duration (s): 14.6
113+
Run: Ops: 6 816 324 - Duration (s): 14.7
114+
Throughput Test to run => ThreeToOneSequencedBatchThroughputTest, Runs => 7
115+
Starting throughput tests
116+
Run: Ops: 36 118 059 - Duration (s): 2.77
117+
Run: Ops: 36 206 133 - Duration (s): 2.76
118+
Run: Ops: 36 036 204 - Duration (s): 2.77
119+
Run: Ops: 36 126 019 - Duration (s): 2.77
120+
Run: Ops: 33 903 373 - Duration (s): 2.95
121+
Run: Ops: 35 800 706 - Duration (s): 2.79
122+
Run: Ops: 35 998 092 - Duration (s): 2.78
123+
Throughput Test to run => ThreeToOneSequencedThroughputTest, Runs => 7
124+
Starting throughput tests
125+
Run: Ops: 3 877 429 - Duration (s): 5.16
126+
Run: Ops: 3 871 247 - Duration (s): 5.17
127+
Run: Ops: 3 889 003 - Duration (s): 5.14
128+
Run: Ops: 3 950 586 - Duration (s): 5.06
129+
Run: Ops: 3 875 670 - Duration (s): 5.16
130+
Run: Ops: 3 883 537 - Duration (s): 5.15
131+
Run: Ops: 3 943 268 - Duration (s): 5.07
132+
Throughput Test to run => ThreeToThreeSequencedThroughputTest, Runs => 7
133+
Starting throughput tests
134+
Run: Ops: 89 202 043 - Duration (s): 6.05
135+
Run: Ops: 89 222 102 - Duration (s): 6.05
136+
Run: Ops: 91 820 088 - Duration (s): 5.88
137+
Run: Ops: 92 930 261 - Duration (s): 5.81
138+
Run: Ops: 93 027 855 - Duration (s): 5.8
139+
Run: Ops: 94 548 193 - Duration (s): 5.71
140+
Run: Ops: 94 892 248 - Duration (s): 5.69
141+
Throughput Test to run => TwoToTwoWorkProcessorThroughputTest, Runs => 7
142+
Starting throughput tests
143+
Run: Ops: 5 314 399 - Duration (ms): 188
144+
Run: Ops: 5 202 236 - Duration (ms): 192
145+
Run: Ops: 5 317 762 - Duration (ms): 188
146+
Run: Ops: 5 181 427 - Duration (ms): 193
147+
Run: Ops: 5 218 716 - Duration (ms): 192
148+
Run: Ops: 5 268 787 - Duration (ms): 190
149+
Run: Ops: 5 218 226 - Duration (ms): 192

0 commit comments

Comments
 (0)