Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace old MPSC/SPSC queues with JCTools #1413

Closed
wants to merge 3 commits into from
Closed

Conversation

jponge
Copy link
Member

@jponge jponge commented Oct 25, 2023

  • Refactored the Queues class and made all queue creations converge to it (except for tests).
  • Introduced Infrastructure#useUnsafeForQueues to decide when to use unpadded vs atomic variants.
  • Introduced native compilation smoke tests.

Issue: #1330

BREAKING CHANGE: constants and methods have been removed from io.smallrye.mutiny.helpers.queues.Queues
as well as previous MPSC/SPSC classes in the io.smallrye.mutiny.helpers.queues package.

@jponge jponge added enhancement New feature or request noteworthy-feature Noteworthy feature technical-debt Technical debt reduction internal Some internal enhancement labels Oct 25, 2023
@jponge jponge added this to the 2.6.0 milestone Oct 25, 2023
This was referenced Oct 25, 2023
@jponge jponge force-pushed the feat/use-jctools branch 2 times, most recently from 2725372 to becbf47 Compare October 25, 2023 13:04
@jponge jponge changed the title refactor: replace old MPSC/SPSC queues with JCTools refactor!: replace old MPSC/SPSC queues with JCTools Oct 25, 2023
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #1413 (c4523f4) into main (3af3da1) will decrease coverage by 0.30%.
Report is 6 commits behind head on main.
The diff coverage is 79.78%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1413      +/-   ##
============================================
- Coverage     89.37%   89.07%   -0.30%     
+ Complexity     3368     3268     -100     
============================================
  Files           459      456       -3     
  Lines         13454    13234     -220     
  Branches       1655     1640      -15     
============================================
- Hits          12024    11788     -236     
- Misses          794      805      +11     
- Partials        636      641       +5     
Files Coverage Δ
...n/java/io/smallrye/mutiny/groups/MultiFlatten.java 100.00% <100.00%> (ø)
...e/mutiny/operators/multi/MultiCombineLatestOp.java 86.02% <100.00%> (+0.07%) ⬆️
...smallrye/mutiny/operators/multi/MultiEmitOnOp.java 92.38% <100.00%> (ø)
...mallrye/mutiny/operators/multi/MultiGroupByOp.java 83.25% <100.00%> (ø)
...smallrye/mutiny/operators/multi/MultiWindowOp.java 91.66% <100.00%> (ø)
...ny/operators/multi/builders/EmitterBasedMulti.java 94.33% <100.00%> (ø)
...y/operators/multi/processors/UnicastProcessor.java 95.68% <100.00%> (ø)
...smallrye/mutiny/infrastructure/Infrastructure.java 71.75% <95.83%> (+2.01%) ⬆️
...erators/multi/builders/BufferItemMultiEmitter.java 91.13% <93.75%> (-0.97%) ⬇️
...rators/multi/overflow/MultiOnOverflowBufferOp.java 83.62% <80.00%> (-0.46%) ⬇️
... and 1 more

... and 13 files with indirect coverage changes

@jponge jponge linked an issue Oct 25, 2023 that may be closed by this pull request
@jponge
Copy link
Member Author

jponge commented Oct 26, 2023

We can fix the JPMS issue with a release of JCTools:

diff --git a/implementation/src/main/java/module-info.java b/implementation/src/main/java/module-info.java
index 13191b46..15f97369 100644
--- a/implementation/src/main/java/module-info.java
+++ b/implementation/src/main/java/module-info.java
@@ -1,7 +1,7 @@
 open module io.smallrye.mutiny {
 
     requires transitive io.smallrye.common.annotation;
-    requires jctools.core;
+    requires org.jctools.core;
 
     exports io.smallrye.mutiny;
     exports io.smallrye.mutiny.converters.multi;
diff --git a/pom.xml b/pom.xml
index be9044f1..b2f4b8c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,7 +78,7 @@
     </modules>
 
     <properties>
-        <jctools-core.version>4.0.1</jctools-core.version>
+        <jctools-core.version>4.0.2-SNAPSHOT</jctools-core.version>
         <mutiny-zero.version>1.0.0</mutiny-zero.version>
         <reactive-streams.version>1.0.4</reactive-streams.version>
         <rxjava3.version>3.1.8</rxjava3.version>

@jponge
Copy link
Member Author

jponge commented Nov 6, 2023

Switched to our friendly fork at https://github.com/jponge/jct

@jponge jponge changed the title refactor!: replace old MPSC/SPSC queues with JCTools Replace old MPSC/SPSC queues with JCTools Nov 17, 2023
- Refactored the Queues class and made all queue creations converge to it (except for tests).
- Introduced Infrastructure#useUnsafeForQueues to decide when to use unpadded vs atomic variants.
- Introduced native compilation smoke tests.

Issue: #1330

BREAKING CHANGE: constants and methods have been removed from
io.smallrye.mutiny.helpers.queues.Queues as well as previous MPSC/SPSC classes
in the io.smallrye.mutiny.helpers.queues package.
@jponge
Copy link
Member Author

jponge commented Nov 22, 2023

JCTools 4.0.2 has been released so we can go back to the upstream

@jponge jponge modified the milestones: 2.6.0, 2.7.0 (or 3.0.0?) Dec 1, 2023
@jponge
Copy link
Member Author

jponge commented Jan 19, 2024

We will eventually go with the simplified PR

@jponge jponge closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal Some internal enhancement noteworthy-feature Noteworthy feature technical-debt Technical debt reduction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use JCTools queues
1 participant