OptaPlanner logo
  • Download
  • Learn
    • Documentation
    • Videos

    • Use cases
    • Compatibility
    • Testimonials and case studies
  • Get help
  • Blog
  • Source
  • Team
  • Services
  • Star
  • T
  • L
  • F
  • YT
Fork me on GitHub

How much faster is Java 15?

Tue 26 January 2021
Avatar Michal Tomčo
Michal Tomčo

GitHub

Quality engineer

Java 15 was released on the 15th of September 2020 and has promised to bring with it a few performance tweaks in its G1GC and ParallelGC garbage collectors.

What does it mean for OptaPlanner? Are there any benefits to be gained from upgrading from JDK11 to JDK15? In 2019, we found out that ParallelGC works better for OptaPlanner. Is that still the case a year later? Let’s put it to the test!

This article is a follow-up on our Java 11 and our Java 8 performance comparison benchmarks.

Benchmark methodology

To run the benchmark we used:

  • A stable machine without any other computational demanding processes running and with Intel® Xeon® Silver 4116 @ 2.1 GHz (12 cores total / 24 threads) and 128 GiB RAM memory, running RHEL 8 x86_64.

  • Both G1 and Parallel GC for both Java versions to compare the impact of garbage collection. Executed org.optaplanner.examples.app.GeneralOptaPlannerBenchmarkApp with the parameters -Xmx3840M -server -XX:+UseG1GC and -Xmx3840M -server -XX:+UseParallelGC respectively. The results presented in this blog represent the average values taken from 10 iterations of each garbage collector and JDK combination.

  • Both OpenJDK 11 version "11.0.6" OpenJDK Runtime Environment 18.9 (build 11.0.6+10-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.6+10-LTS, mixed mode)

  • Both OpenJDK 15 version "15.0.1" OpenJDK Runtime Environment 18.9 (build 15.0.1+9-LTS) OpenJDK 64-Bit Server VM 18.9 (build 15.0.1+9-LTS, mixed mode)

  • OptaPlanner 7.44.0.Final

  • Solving a planning problem involves no IO (except a few milliseconds during startup to load the input). A single CPU is completely saturated. It constantly creates many short-lived objects, and the GC collects them afterwards.

  • Each run solves 11 planning problems with OptaPlanner. Each planning problem runs for 5 minutes and starts with a 30 second JVM warm up which is discarded.

  • The benchmarks measure the number of scores calculated per second. Higher is better. Calculating a score for a proposed planning solution is non-trivial: it involves many calculations, including checking for conflicts between every entity and every other entity.

Executive summary

With Java 15, the average improvement is 11.24% for G1 and 13.85% for Parallel GC. The difference between the two garbage collectors running on JDK 15 is 11.03% leaning in favor of Parallel GC. For more information about difference between various GC algorithms, please see the following article that compares Java garbage collectors performance.

Parallel GC remains to be the preferred GC to be used with OptaPlanner, since the throughput is still the most relevant factor when it comes to garbage collection.

Results

Java 11 vs. Java 15

JDK11andJDK15UsingG1GC
Table 1. Score calculation count per second with G1GC

Cloud balancing

Machine reassignment

Course scheduling

Exam scheduling

Nurse rostering

Traveling Tournament

JDK

200c

800c

B1

B10

c7

c8

s2

s3

m1

mh1

nl14

JDK11

71,524

67,266

253,037

37,346

5,841

7,193

10,600

7,062

2,570

2,359

1,806

JDK15

72,285

70,786

285,668

37,371

8,405

10,049

12,382

8,205

2,952

2,730

1,997

Difference (in %)

1.06

5.23

12.9

0.07

13.42

16.85

16.81

16.19

14.86

15.73

10.58

Average (in %)

11.24

JDK11andJDK15UsingParallelGC
Table 2. Score calculation count per second with ParallelGC

Cloud balancing

Machine reassignment

Course scheduling

Exam scheduling

Nurse rostering

Traveling Tournament

JDK

200c

800c

B1

B10

c7

c8

s2

s3

m1

mh1

nl14

JDK11

76,600

76,954

296,107

49,937

6,244

7,666

12,368

7,904

2,941

2,729

2,090

JDK15

91,131

87,565

301,981

48,518

7,393

9,496

13,964

8,963

3,570

3,294

2,295

Difference (in %)

18.97

13.79

1.98

-2.84

18.40

23.87

12.90

13.40

21.39

20.70

9.81

Average (in %)

13.85

Parallel GC vs. G1 GC on Java 15

G1GCandParallelGCUsingJDK15
Table 3. Comparison of score calculation count per second on JDK15 with ParallelGC and G1GC being used

Cloud balancing

Machine reassignment

Course scheduling

Exam scheduling

Nurse rostering.

Traveling Tournament

Garbage collector

200c

800c

B1

B10

c7

c8

s2

s3

m1

mh1

nl14

JDK15 G1GC

72,285

70,786

285,668

37,371

8,405

10,049

12,382

8,205

2,952

2,730

1,997

JDK15 ParallelGC

91,131

87,565

301,981

48,518

7,393

9,496

13,964

8,963

3,570

3,294

2,295

Difference (in %)

26.07

19.16

5.40

22.97

-13.69

-5.82

11.33

8.46

17.31

17.12

12.98

Average (in %)

11.03

Conclusion

In conclusion, the performance gained in the JDK15 version is well worth considering regarding OptaPlanner. In addition, the preferred garbage collector to use is still ParallelGC, the performance of which is even better in comparison with G1GC than it was in our previous JDK performance comparison.

Updated with minor corrections on April 15, 2021.


Permalink
 tagged as production benchmark

Comments

Visit our forum to comment
AtomNews feed
Don’t want to miss a single blog post?
Follow us on
  • T
  • L
  • F
Blog archive
Latest release
  • 8.35.0.Final released
    Fri 3 March 2023
Upcoming events
    Add event / Archive
Latest blog posts
  • OptaPlanner 9 is coming
    Tue 21 February 2023
    Lukáš Petrovický
  • Farewell - a new lead
    Tue 15 November 2022
    Geoffrey De Smet
  • Run OptaPlanner workloads on OpenShift, part II
    Wed 9 November 2022
    Radovan Synek
  • Bavet - A faster score engine for OptaPlanner
    Tue 6 September 2022
    Geoffrey De Smet
  • Run OptaPlanner workloads on OpenShift, part I.
    Thu 9 June 2022
    Radovan Synek
  • OptaPlanner deprecates score DRL
    Thu 26 May 2022
    Lukáš Petrovický
  • Real-time planning meets SolverManager
    Mon 7 March 2022
    Radovan Synek
  • Blog archive
Latest videos
  • The Vehicle Routing Problem
    Fri 23 September 2022
    Geoffrey De Smet
  • Introduction to OptaPlanner AI constraint solver
    Thu 25 August 2022
    Anna Dupliak
  • On schedule: Artificial Intelligence plans that meet expectations
    Sat 23 July 2022
    Geoffrey De Smet
  • Host your OptaPlanner app on OpenShift (Kubernetes)
    Mon 7 February 2022
    Geoffrey De Smet
  • OptaPlanner - A fast, easy-to-use, open source AI constraint solver for software developers
    Mon 31 January 2022
  • Order picking planning with OptaPlanner
    Fri 31 December 2021
    Anna Dupliak
  • AI lesson scheduling on Quarkus with OptaPlanner
    Thu 18 November 2021
    Geoffrey De Smet
  • Video archive

OptaPlanner is open. All dependencies of this project are available under the Apache Software License 2.0 or a compatible license. OptaPlanner is trademarked.

This website was built with JBake and is open source.

Community

  • Blog
  • Get Help
  • Team
  • Governance
  • Academic research

Code

  • Build from source
  • Issue tracker
  • Release notes
  • Upgrade recipes
  • Logo and branding
CC by 3.0 | Privacy Policy
Sponsored by Red Hat