mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
Bring Powersort to Java
Gradle
Setup
Commandline
Check which Java toolchains can be found by Gradle:
./gradlew javaToolchains
shell.nix
-> broken (as well forgradle javaToolchains
shell1.nix
-> worksshell2.nix
-> broken (as well forgradle javaToolchains
)
This should include version >= 17, 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
TODO, nothing has worked so far.
Open issue: gradle's toolchain support does not work with IntelliJ
shell.nix
- Solution from 2022 did no longer work: https://github.com/NixOS/nixpkgs/issues/207153#issue-1506967648
shell1.nix
- Instead, we found this: https://discourse.nixos.org/t/overriding-the-jdk-for-gradle-in-a-nix-flake/36541/2
shell2.nix
- Another approach - which did no longer work! https://github.com/utybo/Tegral/blob/main/shell.nix
Tasks
List all Gradle tasks which can be run:
./gradlew tasks
This can also be done graphically in IntelliJ:
Test Cases
Run the task "test":
./gradlew test
TimSort
Imported from
- src/java.base/share/classes/java/util/TimSort.java
- src/java.base/share/classes/java/util/ComparableTimSort.java
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.
Languages
Java
97%
Nix
3%