2024-12-30 16:49:40 +00:00
2024-12-17 17:53:54 +01:00
2024-12-30 16:37:45 +00:00
2024-11-25 13:49:54 +01:00
2024-11-19 18:43:10 +01:00
2024-12-11 14:04:46 +01:00
2024-12-10 10:39:49 +01:00
2024-11-19 18:43:10 +01:00
2024-11-19 18:43:10 +01:00
2024-11-19 19:24:56 +01:00
2024-11-25 13:26:23 +01:00
2024-12-30 16:49:40 +00:00
2024-11-19 18:43:10 +01:00
2024-12-30 16:09:20 +00:00

Bring Powersort to Java

Gradle

Setup

The development dependencies (JDK23, Gradle, IntelliJ) can e.g. be installed with nix by running nix-shell.

Commandline

Check which Java toolchains Gradle finds:

./gradlew javaToolchains

This should include version >= 23, e.g.:

 + N/A JDK 23-ga
     | Location:           /nix/store/48290hnlb13xmwjw9y16a1s785993bv7-openjdk-23-ga/lib/openjdk
     | Language Version:   23
     | Vendor:             N/A
     | Architecture:       amd64
     | Is JDK:             true
     | Detected by:        Current JVM

IntelliJ

When using nix-shell, some manual configuration is necessary:

  • STRG ALT SHIFT s -> SDK -> add JDK ->
    • home path: /usr/lib/openjdk
    • name: usr-lib-jdk
  • STRG ALT s -> build tools -> gradle ->
    • local installation: /usr/lib/gradle
    • Gradle JVM: usr-lib-jdk

Tasks

List all Gradle tasks which can be run:

./gradlew tasks

This can also be done graphically in IntelliJ:

intellij-gradle.png

Test Cases

Run the task "test":

./gradlew test

Benchmark

There are two different benchmarks. One is based on the JMH benchmark framework, the other one is a custom benchmark implementation.

./gradlew jmh
./gradlew runCustomBenchmark
Description
Implementation of Powersort with the aim of integrating it into OpenJDK. Benchmarks are used to ensure that the runtime of the new sorting algorithm is never slower than the current Timsort implementation.
Readme 672 KiB
Languages
Java 97%
Nix 3%