diff options
| author | Samuel Yvon <samuelyvon9@gmail.com> | 2024-01-12 11:16:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-12 20:16:13 +0100 |
| commit | 22b960ada294a87d5cf60c2dc1b13585287cab73 (patch) | |
| tree | 09df0397ca8345a721e988cea028b46a1a2e6caa /prepare_SamuelYvon.sh | |
| parent | a6e401317070fe9763ac8541f93f6599a6d15d45 (diff) | |
Graal Native for SamuelYvon (#332)
* Graal Native
* I need a GC :(
* Fix slash lolz
* Fix god damn output lol
I forgot java :D
* Custom hash, custom key
* More optimisations
* I don't need "optimize-build"
I don't care about image size! :D
Diffstat (limited to 'prepare_SamuelYvon.sh')
| -rwxr-xr-x | prepare_SamuelYvon.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/prepare_SamuelYvon.sh b/prepare_SamuelYvon.sh index f83a3ff..11fe5e8 100755 --- a/prepare_SamuelYvon.sh +++ b/prepare_SamuelYvon.sh @@ -15,5 +15,22 @@ # limitations under the License. # +# THIS IS A DIRECT COPY OF royvanrijn's PREPARE SCRIPT; I AM NOT FAMILIAR WITH AOT STUFF ON JAVA. +# THANKS royvanrijn!! + source "$HOME/.sdkman/bin/sdkman-init.sh" sdk use java 21.0.1-graal 1>&2 + +# ./mvnw clean verify removes target/ and will re-trigger native image creation. +if [ ! -f target/CalculateAverage_SamuelYvon_image ]; then + + JAVA_OPTS="--enable-preview -dsa" + + # No vector API because it does not link :( +# JAVA_OPTS="--enable-preview -dsa --add-modules jdk.incubator.vector" + +# Enable the GC because I need memory :D + NATIVE_IMAGE_OPTS="--gc=G1 -O3 -march=native --strict-image-heap $JAVA_OPTS" + + native-image $NATIVE_IMAGE_OPTS -cp target/average-1.0.0-SNAPSHOT.jar -o target/CalculateAverage_SamuelYvon_image dev.morling.onebrc.CalculateAverage_SamuelYvon +fi |
