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

[master] Performance improvement: synchronize to java.util.concurrent.locks switch to improve performance with VirtualThreads #2116

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

rfelcman
Copy link
Contributor

This change improves EclipseLink performance with higher versions of the JDK (21 and above).
It's about replacement of synchronized keyword and wait(), notify() methods by objects from java.util.concurrent.locks.* package.
Additionally there are some new performance tests to verify it.
Performance tests were executed against:

java version "21.0.2" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

and

openjdk version "23-loom" 2024-09-17
OpenJDK Runtime Environment (build 23-loom+2-48)
OpenJDK 64-Bit Server VM (build 23-loom+2-48, mixed mode, sharing)

Test results are there and in the attachment.

::::::::::::::
jmh-core-result_ReentrantLock_23Loom.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.core.ConcurrencyManagerBenchmark.testAcquireRelease","thrpt",50,20,14539906.393462,14499.932272,"ops/s"
::::::::::::::
jmh-core-result_ReentrantLock.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.core.ConcurrencyManagerBenchmark.testAcquireRelease","thrpt",50,20,25688207.297074,289398.625373,"ops/s"
::::::::::::::
jmh-core-result_synchronized_23Loom.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.core.ConcurrencyManagerBenchmark.testAcquireRelease","thrpt",50,20,26326687.706285,27374.470204,"ops/s"
::::::::::::::
jmh-core-result_synchronized.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.core.ConcurrencyManagerBenchmark.testAcquireRelease","thrpt",50,20,14879434.497816,21578.277354,"ops/s"
::::::::::::::
jmh-jpa-result_ReentrantLock_23Loom.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountCacheTests.testReadEntity","thrpt",10,20,26578.825758,37.901222,"ops/s"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountNoCacheTests.testReadEntity","thrpt",10,20,2272.829450,24.614292,"ops/s"
::::::::::::::
jmh-jpa-result_ReentrantLock.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountCacheTests.testReadEntity","thrpt",10,20,18715.361709,39.353958,"ops/s"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountNoCacheTests.testReadEntity","thrpt",10,20,2222.755556,10.028602,"ops/s"
::::::::::::::
jmh-jpa-result_synchronized_23Loom.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountCacheTests.testReadEntity","thrpt",10,20,21450.585389,140.540877,"ops/s"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountNoCacheTests.testReadEntity","thrpt",10,20,2300.783588,16.072768,"ops/s"
::::::::::::::
jmh-jpa-result_synchronized.txt
::::::::::::::
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountCacheTests.testReadEntity","thrpt",10,20,17686.481014,21.467243,"ops/s"
"org.eclipse.persistence.testing.perf.jpa.tests.basic.JPAReadSmallAmmountNoCacheTests.testReadEntity","thrpt",10,20,2207.724608,19.088328,"ops/s"

perfTestsResults.tar.gz

…itch to improve performance with VirtualThreads

Signed-off-by: Radek Felcman <[email protected]>
Signed-off-by: Radek Felcman <[email protected]>
@rfelcman
Copy link
Contributor Author

There are updated tests results for

openjdk version "23-loom" 2024-09-17
OpenJDK Runtime Environment (build 23-loom+2-48)
OpenJDK 64-Bit Server VM (build 23-loom+2-48, mixed mode, sharing)
mvn clean test -pl :org.eclipse.persistence.performance.test -Ptest-performance -Djmh.executor=VIRTUAL_TPE

-Djmh.executor=VIRTUAL_TPE says JMH framework to use virtual threads instead of platform threads

"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"org.eclipse.persistence.testing.perf.core.ConcurrencyManagerBenchmark.testAcquireRelease","thrpt",50,20,25623647.640683,151019.169813,"ops/s"

@rfelcman rfelcman merged commit 1f0cf75 into eclipse-ee4j:master Apr 25, 2024
6 checks passed
rfelcman added a commit to rfelcman/eclipselink that referenced this pull request Apr 25, 2024
…itch to improve performance with VirtualThreads (eclipse-ee4j#2116)

This change improves EclipseLink performance with higher versions of the JDK (21 and above).
It's about replacement of synchronized keyword and wait(), notify() methods by objects from java.util.concurrent.locks.* package.
Additionally there are some new performance tests to verify it.

Signed-off-by: Radek Felcman <[email protected]>

(cherry picked from commit 1f0cf75)
Signed-off-by: Radek Felcman <[email protected]>
rfelcman added a commit that referenced this pull request Apr 25, 2024
…itch to improve performance with VirtualThreads (#2116) (#2118)

This change improves EclipseLink performance with higher versions of the JDK (21 and above).
It's about replacement of synchronized keyword and wait(), notify() methods by objects from java.util.concurrent.locks.* package.
Additionally there are some new performance tests to verify it.


(cherry picked from commit 1f0cf75)

Signed-off-by: Radek Felcman <[email protected]>
rfelcman added a commit to rfelcman/eclipselink that referenced this pull request Apr 26, 2024
…itch to improve performance with VirtualThreads (eclipse-ee4j#2116)

This change improves EclipseLink performance with higher versions of the JDK (21 and above).
It's about replacement of synchronized keyword and wait(), notify() methods by objects from java.util.concurrent.locks.* package.
Additionally, there are some new performance tests to verify it and performance tests refresh.

Signed-off-by: Radek Felcman <[email protected]>

(cherry picked from commit 1f0cf75)
Signed-off-by: Radek Felcman <[email protected]>
@rfelcman rfelcman deleted the benchmarks_performance_fix branch April 30, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants