Naive port of Go solution to Java#4
Open
thomasdarimont wants to merge 1 commit intofredoverflow:masterfrom
Open
Naive port of Go solution to Java#4thomasdarimont wants to merge 1 commit intofredoverflow:masterfrom
thomasdarimont wants to merge 1 commit intofredoverflow:masterfrom
Conversation
# Results with Java 18.0.2 ``` $ java -version openjdk version "18.0.2" 2022-07-19 OpenJDK Runtime Environment Temurin-18.0.2+9 (build 18.0.2+9) OpenJDK 64-Bit Server VM Temurin-18.0.2+9 (build 18.0.2+9, mixed mode, sharing) ``` ``` $ java -cp . Wordle4GoPort 2. jumby waqfs vozhd pling treck 1. jumpy waqfs vozhd bling treck 3. jumby waqfs vozhd clipt kreng 4. jumpy waqfs vozhd brick glent 5. jumby waqfs vozhd prick glent 6. fjord gymps chunk waltz vibex 7. fjord gucks nymph waltz vibex 8. waqfs blunk vozhd grypt cimex 9. waqfs clunk vozhd grypt bemix 10. waqfs vozhd cylix/xylic brung kempt 33ms prepare words 70ms compute tables 209ms find solutions 312ms total ``` # Setup for GraalVM native-image ``` sdk install java 22.2.r17-grl sdk use java 22.2.r17-grl gu install native-image $ java -version openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06) OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing) ``` # Create native image ``` javac Wordle4GoPort.java native-image Wordle4GoPort ``` # Results with GraalVM 22.2.r17-grl ``` $ ./wordle4goport 1. jumpy waqfs vozhd bling treck 3. jumpy waqfs vozhd brick glent 2. jumby waqfs vozhd pling treck 4. jumby waqfs vozhd clipt kreng 5. jumby waqfs vozhd prick glent 6. fjord gymps chunk waltz vibex 7. fjord gucks nymph waltz vibex 8. waqfs blunk vozhd grypt cimex 9. waqfs clunk vozhd grypt bemix 10. waqfs vozhd cylix/xylic brung kempt 5ms prepare words 54ms compute tables 149ms find solutions 208ms total ``` Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Author
|
I wonder if this could be made faster with Project Panama https://gavinray97.github.io/blog/panama-not-so-foreign-memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Fred,
Many thanks for your many instructive videos! As a long time fan of your Advent of Code series, I have naively ported your Go solution one-to-one to Java and tested it with Java 18 as well as GraalVM native-image. As expected, you can't match the speed of your Go solution without some adjustments.
Perhaps you find this interesting nevertheless :)
Cheers,
Thomas
Machine
Dell XPS 15 (2018) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Results with Java 18.0.2
Setup for GraalVM native-image
Create native image
Results with GraalVM 22.2.r17-grl
Signed-off-by: Thomas Darimont thomas.darimont@googlemail.com