Permalink
Browse files

Merge branch 'master' into swhs-improvements

  • Loading branch information...
qwwdfsad committed Oct 1, 2017
2 parents c225457 + b006bc9 commit fe30b5e72a962b51be4fc356005772bbb0ad9d0e
Showing with 15,663 additions and 5,539 deletions.
  1. +1 −4 .gitignore
  2. +11 −4 README.md
  3. +30 −0 RELEASE-NOTES.md
  4. +260 −256 ides/eclipse/formatter.xml
  5. +51 −0 ides/idea/JavaCodeStyle.xml
  6. +7 −2 jctools-benchmarks/pom.xml
  7. +126 −0 jctools-benchmarks/src/main/java/org/jctools/channels/spsc/QueueThroughputBaseline.java
  8. +10 −15 jctools-benchmarks/src/main/java/org/jctools/channels/spsc/SpscProxyChannelBenchmark.java
  9. +83 −75 jctools-benchmarks/src/main/java/org/jctools/jmh/latency/MpqBurstCost.java
  10. +168 −94 jctools-benchmarks/src/main/java/org/jctools/jmh/latency/QueueBurstCost.java
  11. +1 −1 jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/RingBurstRoundTripWithGroups.java
  12. +1 −1 jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/RingCqBurstRoundTripWithGroups.java
  13. +6 −15 jctools-benchmarks/src/main/java/org/jctools/jmh/throughput/IntrusiveQueueThroughputBackoffNone.java
  14. +17 −27 jctools-benchmarks/src/main/java/org/jctools/jmh/throughput/MpqDrainFillThroughputBackoffNone.java
  15. +28 −36 jctools-benchmarks/src/main/java/org/jctools/jmh/throughput/MpqThroughputBackoffNone.java
  16. +18 −26 jctools-benchmarks/src/main/java/org/jctools/jmh/throughput/QueueThroughputBackoffNone.java
  17. +10 −10 ...ls-benchmarks/src/main/java/org/jctools/jmh/throughput/channels/ChannelThroughputBackoffNone.java
  18. +42 −0 jctools-benchmarks/src/main/java/org/jctools/queues/MessagePassingQueueByTypeFactory.java
  19. +4 −1 jctools-benchmarks/src/main/java/org/jctools/queues/QueueByTypeFactory.java
  20. +23 −0 jctools-build/pom.xml
  21. +564 −0 jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicArrayQueueGenerator.java
  22. +651 −0 jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicLinkedQueueGenerator.java
  23. +676 −0 jctools-build/src/main/java/org/jctools/queues/atomic/TraceVisitor.java
  24. +38 −0 jctools-channels/pom.xml
  25. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/Channel.java
  26. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/ChannelConsumer.java
  27. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/ChannelProducer.java
  28. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/ChannelReceiver.java
  29. +36 −16 ...tal → jctools-channels}/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java
  30. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/WaitStrategy.java
  31. 0 ...s-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/ClassViewModel.java
  32. 0 ...tal → jctools-channels}/src/main/java/org/jctools/channels/mapping/InvalidInterfaceException.java
  33. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/Mapper.java
  34. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/Primitive.java
  35. 0 ...ls-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/TypeInspector.java
  36. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/Variable.java
  37. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscChannel.java
  38. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscChannelConsumer.java
  39. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscChannelProducer.java
  40. +2 −2 ...ls-channels}/src/main/java/org/jctools/channels/mpsc/MpscFFLamportOffHeapFixedSizeRingBuffer.java
  41. +2 −2 ...l → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscOffHeapFixedSizeRingBuffer.java
  42. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/LocalsHelper.java
  43. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/ProxyChannel.java
  44. +38 −10 ...xperimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/ProxyChannelFactory.java
  45. +4 −2 ...rimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/ProxyChannelRingBuffer.java
  46. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/package-info.java
  47. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscChannel.java
  48. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscChannelConsumer.java
  49. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscChannelProducer.java
  50. +1 −1 ...l → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscOffHeapFixedSizeRingBuffer.java
  51. +2 −3 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/CompilationResult.java
  52. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/SimpleCompiler.java
  53. +1 −2 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/StringWrappingJavaFile.java
  54. {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/Template.java
  55. +2 −44 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/UnsafeDirectByteBuffer.java
  56. 0 ...rimental → jctools-channels}/src/main/resources/org/jctools/channels/ChannelConsumerTemplate.java
  57. 0 ...rimental → jctools-channels}/src/main/resources/org/jctools/channels/ChannelProducerTemplate.java
  58. 0 ... jctools-channels}/src/test/java/org/jctools/channels/AbstractOffHeapFixedSizeRingBufferTest.java
  59. 0 ...rimental → jctools-channels}/src/test/java/org/jctools/channels/mapping/InvalidInterfaceTest.java
  60. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/channels/mapping/MapperTest.java
  61. 0 ...ls-experimental → jctools-channels}/src/test/java/org/jctools/channels/mapping/StubFlyweight.java
  62. 0 ...jctools-channels}/src/test/java/org/jctools/channels/mpsc/MpscOffHeapFixedSizeRingBufferTest.java
  63. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/channels/proxy/DemoIFace.java
  64. +6 −6 ...ls-experimental → jctools-channels}/src/test/java/org/jctools/channels/proxy/DemoProxyResult.java
  65. 0 ...-experimental → jctools-channels}/src/test/java/org/jctools/channels/proxy/ProxyCreationTest.java
  66. 0 ...ols-experimental → jctools-channels}/src/test/java/org/jctools/channels/spsc/SpscChannelTest.java
  67. 0 ...jctools-channels}/src/test/java/org/jctools/channels/spsc/SpscOffHeapFixedSizeRingBufferTest.java
  68. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/util/CompilerTest.java
  69. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/util/TemplateTest.java
  70. 0 ...xperimental → jctools-channels}/src/test/resources/org/jctools/channels/mapping/StubTemplate.java
  71. +1 −1 jctools-concurrency-test/pom.xml
  72. +86 −30 jctools-core/pom.xml
  73. +1 −1 jctools-core/src/main/java/org/jctools/maps/AbstractEntry.java
  74. +9 −4 jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMap.java
  75. +18 −4 jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMapLong.java
  76. +3 −2 jctools-core/src/main/java/org/jctools/maps/NonBlockingIdentityHashMap.java
  77. +4 −2 jctools-core/src/main/java/org/jctools/maps/NonBlockingSetInt.java
  78. +130 −69 jctools-core/src/main/java/org/jctools/queues/BaseLinkedQueue.java
  79. +417 −309 jctools-core/src/main/java/org/jctools/queues/BaseMpscLinkedArrayQueue.java
  80. +265 −103 jctools-core/src/main/java/org/jctools/queues/BaseSpscLinkedArrayQueue.java
  81. +11 −7 jctools-core/src/main/java/org/jctools/queues/CircularArrayOffsetCalculator.java
  82. +44 −38 jctools-core/src/main/java/org/jctools/queues/ConcurrentCircularArrayQueue.java
  83. +27 −12 jctools-core/src/main/java/org/jctools/queues/ConcurrentSequencedCircularArrayQueue.java
  84. +25 −12 jctools-core/src/main/java/org/jctools/queues/IndexedQueueSizeUtil.java
  85. +31 −0 jctools-core/src/main/java/org/jctools/queues/LinkedArrayQueueUtil.java
  86. +27 −13 jctools-core/src/main/java/org/jctools/queues/LinkedQueueNode.java
  87. +22 −21 jctools-core/src/main/java/org/jctools/queues/MessagePassingQueue.java
  88. +74 −0 jctools-core/src/main/java/org/jctools/queues/MessagePassingQueueUtil.java
  89. +200 −116 jctools-core/src/main/java/org/jctools/queues/MpmcArrayQueue.java
  90. +214 −112 jctools-core/src/main/java/org/jctools/queues/MpscArrayQueue.java
  91. +34 −25 jctools-core/src/main/java/org/jctools/queues/MpscChunkedArrayQueue.java
  92. +189 −100 jctools-core/src/main/java/org/jctools/queues/MpscCompoundQueue.java
  93. +19 −14 jctools-core/src/main/java/org/jctools/queues/MpscGrowableArrayQueue.java
  94. +135 −37 jctools-core/src/main/java/org/jctools/queues/MpscLinkedQueue.java
  95. +10 −8 jctools-core/src/main/java/org/jctools/queues/MpscLinkedQueue7.java
  96. +6 −6 jctools-core/src/main/java/org/jctools/queues/MpscLinkedQueue8.java
  97. +799 −0 jctools-core/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java
  98. +27 −16 jctools-core/src/main/java/org/jctools/queues/MpscUnboundedArrayQueue.java
  99. +14 −10 jctools-core/src/main/java/org/jctools/queues/PaddedCircularArrayOffsetCalculator.java
  100. +29 −17 jctools-core/src/main/java/org/jctools/queues/QueueFactory.java
  101. +5 −5 jctools-core/src/main/java/org/jctools/queues/QueueProgressIndicators.java
  102. +179 −95 jctools-core/src/main/java/org/jctools/queues/SpmcArrayQueue.java
  103. +156 −82 jctools-core/src/main/java/org/jctools/queues/SpscArrayQueue.java
  104. +37 −29 jctools-core/src/main/java/org/jctools/queues/SpscChunkedArrayQueue.java
  105. +66 −41 jctools-core/src/main/java/org/jctools/queues/SpscGrowableArrayQueue.java
  106. +44 −30 jctools-core/src/main/java/org/jctools/queues/SpscLinkedQueue.java
  107. +23 −13 jctools-core/src/main/java/org/jctools/queues/SpscUnboundedArrayQueue.java
  108. +24 −14 jctools-core/src/main/java/org/jctools/queues/atomic/AtomicQueueFactory.java
  109. +90 −22 jctools-core/src/main/java/org/jctools/queues/atomic/AtomicReferenceArrayQueue.java
  110. +209 −29 jctools-core/src/main/java/org/jctools/queues/atomic/BaseLinkedAtomicQueue.java
  111. +606 −0 jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java
  112. +370 −0 jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java
  113. +64 −0 jctools-core/src/main/java/org/jctools/queues/atomic/LinkedAtomicArrayQueueUtil.java
  114. +20 −9 jctools-core/src/main/java/org/jctools/queues/atomic/LinkedQueueAtomicNode.java
  115. +328 −118 jctools-core/src/main/java/org/jctools/queues/atomic/MpmcAtomicArrayQueue.java
  116. +395 −112 jctools-core/src/main/java/org/jctools/queues/atomic/MpscAtomicArrayQueue.java
  117. +99 −0 jctools-core/src/main/java/org/jctools/queues/atomic/MpscChunkedAtomicArrayQueue.java
  118. +69 −0 jctools-core/src/main/java/org/jctools/queues/atomic/MpscGrowableAtomicArrayQueue.java
  119. +140 −31 jctools-core/src/main/java/org/jctools/queues/atomic/MpscLinkedAtomicQueue.java
  120. +703 −0 jctools-core/src/main/java/org/jctools/queues/atomic/MpscRelaxedAtomicArrayQueue.java
  121. +88 −0 jctools-core/src/main/java/org/jctools/queues/atomic/MpscUnboundedAtomicArrayQueue.java
  122. +18 −8 jctools-core/src/main/java/org/jctools/queues/atomic/SequencedAtomicReferenceArrayQueue.java
  123. +267 −64 jctools-core/src/main/java/org/jctools/queues/atomic/SpmcAtomicArrayQueue.java
  124. +293 −60 jctools-core/src/main/java/org/jctools/queues/atomic/SpscAtomicArrayQueue.java
  125. +104 −0 jctools-core/src/main/java/org/jctools/queues/atomic/SpscChunkedAtomicArrayQueue.java
  126. +147 −0 jctools-core/src/main/java/org/jctools/queues/atomic/SpscGrowableAtomicArrayQueue.java
  127. +74 −29 jctools-core/src/main/java/org/jctools/queues/atomic/SpscLinkedAtomicQueue.java
  128. +41 −224 jctools-core/src/main/java/org/jctools/queues/atomic/SpscUnboundedAtomicArrayQueue.java
  129. +25 −12 jctools-core/src/main/java/org/jctools/queues/spec/ConcurrentQueueSpec.java
  130. +2 −1 jctools-core/src/main/java/org/jctools/queues/spec/Ordering.java
  131. +2 −1 jctools-core/src/main/java/org/jctools/queues/spec/Preference.java
  132. +17 −0 jctools-core/src/main/java/org/jctools/util/InternalAPI.java
  133. +0 −7 jctools-core/src/main/java/org/jctools/util/JvmInfo.java
  134. +12 −0 jctools-core/src/main/java/org/jctools/util/PortableJvmInfo.java
  135. +1 −3 jctools-core/src/main/java/org/jctools/util/Pow2.java
  136. +68 −0 jctools-core/src/main/java/org/jctools/util/RangeUtil.java
  137. +23 −10 jctools-core/src/main/java/org/jctools/util/UnsafeAccess.java
  138. +6 −0 jctools-core/src/main/java/org/jctools/util/UnsafeJvmInfo.java
  139. +26 −16 jctools-core/src/main/java/org/jctools/util/UnsafeRefArrayAccess.java
  140. +122 −0 jctools-core/src/test/java/org/jctools/maps/NonBlockingHashMapTest.java
  141. +675 −533 jctools-core/src/test/java/org/jctools/maps/nbhm_test/NBHMID_Tester2.java
  142. +609 −494 jctools-core/src/test/java/org/jctools/maps/nbhm_test/NBHML_Tester2.java
  143. +660 −531 jctools-core/src/test/java/org/jctools/maps/nbhm_test/NBHM_Tester2.java
  144. +153 −127 jctools-core/src/test/java/org/jctools/maps/nbhs_test/nbhs_tester.java
  145. +226 −183 jctools-core/src/test/java/org/jctools/maps/nbhs_test/nbsi_tester.java
  146. +0 −501 jctools-core/src/test/java/org/jctools/queues/MessagePassingQueueSanityTest.java
  147. +650 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTest.java
  148. +27 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestMpmcArray.java
  149. +27 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestMpscArray.java
  150. +18 −13 ...rg/jctools/queues/{MpscChunkedMessagePassingQueueSanityTest.java → MpqSanityTestMpscChunked.java}
  151. +30 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestMpscCompound.java
  152. +12 −10 .../jctools/queues/{MpscGrowableMessagePassingQueueSanityTest.java → MpqSanityTestMpscGrowable.java}
  153. +26 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestMpscLinked.java
  154. +44 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestMpscRelaxedArray.java
  155. +12 −10 ...ctools/queues/{MpscUnboundedMessagePassingQueueSanityTest.java → MpqSanityTestMpscUnbounded.java}
  156. +27 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestSpmcArray.java
  157. +27 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestSpscArray.java
  158. +38 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestSpscChunked.java
  159. +29 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestSpscGrowable.java
  160. +26 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestSpscLinked.java
  161. +28 −0 jctools-core/src/test/java/org/jctools/queues/MpqSanityTestSpscUnbounded.java
  162. +8 −16 ...est/java/org/jctools/queues/{MpscArrayQueueTest.java → MpscArrayQueueOfferWithThresholdTest.java}
  163. +10 −0 jctools-core/src/test/java/org/jctools/queues/MpscLinkedQueueRemoveTest.java
  164. +193 −127 jctools-core/src/test/java/org/jctools/queues/QueueSanityTest.java
  165. +96 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestMpmcArray.java
  166. +87 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestMpscArray.java
  167. +13 −10 .../test/java/org/jctools/queues/{MpscChunkedQueueSanityTest.java → QueueSanityTestMpscChunked.java}
  168. +33 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestMpscCompound.java
  169. +13 −10 ...est/java/org/jctools/queues/{MpscGrowableQueueSanityTest.java → QueueSanityTestMpscGrowable.java}
  170. +28 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestMpscLinked.java
  171. +33 −24 ...ueues/{MpscOfferBelowThresholdQueueSanityTest.java → QueueSanityTestMpscOfferBelowThreshold.java}
  172. +44 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestMpscRelaxed.java
  173. +13 −10 ...a/org/jctools/queues/{MpscUnboundedQueueSanityTest.java → QueueSanityTestMpscUnboundedArray.java}
  174. +31 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestSpmcArray.java
  175. +29 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestSpscArray.java
  176. +39 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestSpscChunked.java
  177. +30 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestSpscGrowable.java
  178. +28 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestSpscLinked.java
  179. +29 −0 jctools-core/src/test/java/org/jctools/queues/QueueSanityTestSpscUnbounded.java
  180. +188 −0 jctools-core/src/test/java/org/jctools/queues/ScQueueRemoveTest.java
  181. +7 −7 jctools-core/src/test/java/org/jctools/queues/SpscArrayQueueTest.java
  182. +0 −30 jctools-core/src/test/java/org/jctools/queues/SpscLinkedArrayQueueSanityTest.java
  183. +0 −46 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTest.java
  184. +33 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpmcArray.java
  185. +31 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpscArray.java
  186. +30 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpscChunked.java
  187. +29 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpscGrowable.java
  188. +29 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpscLinked.java
  189. +47 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpscRelaxedArray.java
  190. +30 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestMpscUnboundedArray.java
  191. +31 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestSpmcArray.java
  192. +31 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestSpscArray.java
  193. +29 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestSpscChunked.java
  194. +31 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestSpscGrowable.java
  195. +29 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestSpscLinked.java
  196. +30 −0 jctools-core/src/test/java/org/jctools/queues/atomic/AtomicQueueSanityTestSpscUnbounded.java
  197. +12 −0 jctools-core/src/test/java/org/jctools/queues/atomic/MpscLinkedAtomicQueueRemoveTest.java
  198. +10 −10 ...st/java/org/jctools/queues/atomic/{AtomicSpscArrayQueueTest.java → SpscAtomicArrayQueueTest.java}
  199. +7 −7 jctools-core/src/test/java/org/jctools/queues/matchers/Matchers.java
  200. +17 −9 jctools-core/src/test/java/org/jctools/util/Pow2Test.java
  201. +128 −0 jctools-core/src/test/java/org/jctools/util/RangeUtilTest.java
  202. +6 −1 jctools-experimental/pom.xml
  203. +4 −4 jctools-experimental/src/main/java/org/jctools/counters/FixedSizeStripedLongCounter.java
  204. +2 −2 jctools-experimental/src/main/java/org/jctools/queues/FFBuffer.java
  205. +7 −7 jctools-experimental/src/main/java/org/jctools/queues/SpscOffHeapIntQueue.java
  206. +3 −3 jctools-experimental/src/test/java/org/jctools/counters/FixedSizeStripedLongCounterTest.java
  207. +4 −2 pom.xml
View
@@ -8,10 +8,7 @@
/jctools-benchmarks/target
/jctools-experimental/target/
/.project
jctools-parent.iml
/jctools-core/jctools-core.iml
/jctools-benchmarks/jctools-benchmarks.iml
/jctools-experimental/jctools-experimental.iml
*.iml
.idea
View
@@ -29,7 +29,7 @@ Add the latest version as a dependency using Maven:
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
<version>2.0.1</version>
<version>2.1.1</version>
</dependency>
```
@@ -46,11 +46,11 @@ And setup the following dependency:
<dependency>
<groupId>com.github.JCTools.JCTools</groupId>
<artifactId>jctools-core</artifactId>
<version>v2.0.1</version>
<version>v2.1.1</version>
</dependency>
```
You can also depend on latest snapshot from this repository (live on the edge) by setting the version to '2.1-SNAPSHOT'.
You can also depend on latest snapshot from this repository (live on the edge) by setting the version to '2.2-SNAPSHOT'.
Build it from source
@@ -75,10 +75,11 @@ found in the jctools-benchmarks module README. Go wild and please let us know ho
Concurrency Testing
===========
```
mvn package
cd jctools-concurrency-test
java -jar target/concurrency-test.jar -v
```
Come up to the lab...
==========
Experimental work is available under the jctools-experimental module. Most of the stuff is developed with an eye to
@@ -88,3 +89,9 @@ Have Questions? Suggestions?
==========
The best way to discuss JCTools is on the GitHub issues system. Any question is good, and GitHub provides a better
platform for knowledge sharing than twitter/mailing-list/gitter (or at least that's what we think).
Thanks!!!
=====
We have kindly been awarded [IntelliJ IDEA](https://www.jetbrains.com/idea/) licences by [JetBrains](https://www.jetbrains.com/) to aid in the development of JCTools. It's an great suite of tools which has benefited the developers and ultimately the community. It's an awesome and inspiring company, **BUY THEIR PRODUCTS NOW!!!**
JCTools has enjoyed a steady stream of PRs, suggestions and user feedback. It's a community! Thank you all for getting involved!
View
@@ -1,3 +1,33 @@
2.1.1
=========
PR #193 : Fix API break on release in MpscLinkedAtomicQueue
Issue #194 : Fix MpscCompoundQueue::relaxedOffer bug
Issue #196 : Fix MpscLinkedArray::fill bug
Issue #197 : Fix MpscChunkedQueue:fill bug
2.1.0
==========
Bug fixes:
- PR #188 JvmInfo called from Atomic queues invokes Unsafe methods (thanks @kay )
Features:
- PR #187 + #186 + #185 Atomic queues are now generated from source (thanks @kay )
- PR #184 + #190 MpscLinked supports a remove method (thanks @Scottmitch )
- PR #183 Make SpscLinkedArray queues support the MPQ interface (thanks @franz1981 )
- PR #181 Testing was expanded for NBHM, and minor issue fixed (thanks @qwwdfsad )
Some further improvements to formatting, javadoc and testing and general tending to the garden by @nitsanw
2.0.2
==========
- PR #168 from @maseev - unifying the approach to queue size range checks and exceptions
- PR #173 #174 #176 from @neomatrix369 - porting the SPSC linked array queues to non-unsafe versions
- PR #172 #175 from @chbatey - porting the MPSC linked array queues to non-unsafe versions
- Fix #179 - bug in MpmcArrayQueue and MpmcAtomicArrayQueue leading to false reporting of queue full on offer which races with a poll, reported by Sharath Gururaj (I think that is @flipsha)
- JCStress testing support added by @victorparmar
- Code tidy up by @avalanche123
- Experimental support for MPSC proxy channels by @kay
2.0.1
==========
BUG: #143 - toString() didn't work for many of the queues because the default implemetation relied on iterators.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,51 @@
<code_scheme name="Project">
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="120" />
<option name="BRACE_STYLE" value="2" />
<option name="CLASS_BRACE_STYLE" value="2" />
<option name="METHOD_BRACE_STYLE" value="2" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="SPACE_BEFORE_ANNOTATION_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="RESOURCE_LIST_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
<option name="WRAP_FIRST_METHOD_IN_CALL_CHAIN" value="true" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<groups>
<group>
<type>GETTERS_AND_SETTERS</type>
<order>KEEP</order>
</group>
<group>
<type>OVERRIDDEN_METHODS</type>
<order>KEEP</order>
</group>
</groups>
</arrangement>
</codeStyleSettings>
</code_scheme>
@@ -4,15 +4,15 @@
<parent>
<groupId>org.jctools</groupId>
<artifactId>jctools-parent</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
</parent>
<artifactId>jctools-benchmarks</artifactId>
<packaging>jar</packaging>
<name>Benchmarks</name>
<properties>
<jmh-core.version>1.14</jmh-core.version>
<jmh-core.version>1.19</jmh-core.version>
</properties>
<dependencies>
@@ -21,6 +21,11 @@
<artifactId>jctools-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-channels</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-experimental</artifactId>
@@ -0,0 +1,126 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jctools.channels.spsc;
import org.jctools.queues.MessagePassingQueue;
import org.jctools.queues.MessagePassingQueueByTypeFactory;
import org.jctools.queues.QueueByTypeFactory;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
@State(Scope.Group)
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
public class QueueThroughputBaseline {
Integer ONE = 777;
@Param(value = { "SpscArrayQueue" })
String qType;
@Param(value = { "128000" })
String qCapacity;
MessagePassingQueue<Integer> q;
@Setup()
public void createQandPrimeCompilation() {
final String qType = this.qType;
q = MessagePassingQueueByTypeFactory.createQueue(qType, 128);
// stretch the queue to the limit, working through resizing and full
for (int i = 0; i < 128+100; i++) {
q.relaxedOffer(ONE);
}
for (int i = 0; i < 128+100; i++) {
q.relaxedPoll();
}
// make sure the important common case is exercised
for (int i = 0; i < 20000; i++) {
q.relaxedOffer(ONE);
q.relaxedPoll();
}
final String qCapacity = this.qCapacity;
this.q = MessagePassingQueueByTypeFactory.buildQ(qType, qCapacity);
}
@AuxCounters
@State(Scope.Thread)
public static class PollCounters {
public int pollsFailed;
public int pollsMade;
@Setup(Level.Iteration)
public void clean() {
pollsFailed = pollsMade = 0;
}
}
@AuxCounters
@State(Scope.Thread)
public static class OfferCounters {
public int offersFailed;
public int offersMade;
@Setup(Level.Iteration)
public void clean() {
offersFailed = offersMade = 0;
}
}
private static ThreadLocal<Object> marker = new ThreadLocal<Object>();
@State(Scope.Thread)
public static class ConsumerMarker {
public ConsumerMarker() {
marker.set(this);
}
}
@Benchmark
@Group("tpt")
public void offer(OfferCounters counters) {
if (!q.relaxedOffer(ONE)) {
counters.offersFailed++;
} else {
counters.offersMade++;
}
}
@Benchmark
@Group("tpt")
public void poll(PollCounters counters, ConsumerMarker cm, Blackhole bh) {
Integer e = q.relaxedPoll();
if (e == null) {
counters.pollsFailed++;
} else {
bh.consume(e);
counters.pollsMade++;
}
}
@TearDown(Level.Iteration)
public void emptyQ() {
if (marker.get() == null)
return;
// sadly the iteration tear down is performed from each participating thread, so we need to guess
// which is which (can't have concurrent access to poll).
q.clear();
}
}
@@ -18,20 +18,7 @@
import org.jctools.channels.proxy.ProxyChannel;
import org.jctools.channels.proxy.ProxyChannelFactory;
import org.openjdk.jmh.annotations.AuxCounters;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Group;
import org.openjdk.jmh.annotations.GroupThreads;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.infra.Control;
import org.openjdk.jmh.runner.Runner;
@@ -45,7 +32,7 @@
@Measurement(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
public class SpscProxyChannelBenchmark {
private static final int CAPACITY = 10000;
private static final int CAPACITY = 128000;
private static final int PRODUCER_THREADS = 1;
private static final int CONSUMER_THREADS = 1;
@@ -127,31 +114,37 @@ public BenchImpl(final long tokens) {
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void noArgs() {
Blackhole.consumeCPU(this.tokens);
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void onePrimitiveArg(final int x) {
Blackhole.consumeCPU(this.tokens);
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void twoMixedLengthPrimitiveArgs(final int x, final long y) {
Blackhole.consumeCPU(this.tokens);
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void oneObjectArg(final Object x) {
Blackhole.consumeCPU(this.tokens);
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void oneReferenceArg(final CustomType x) {
Blackhole.consumeCPU(this.tokens);
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void tenMixedArgs(final int i,
final Object o,
final long l,
@@ -166,6 +159,7 @@ public void tenMixedArgs(final int i,
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void unalignedPrimitiveArgs(
long l1,
double d1,
@@ -188,6 +182,7 @@ public void unalignedPrimitiveArgs(
}
@Override
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void alignedPrimitiveArgs(int i,
long l1,
double d1,
Oops, something went wrong.

0 comments on commit fe30b5e

Please sign in to comment.