From 398926028525362b20f7115e313e40bede630c04 Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Fri, 5 Jan 2024 20:11:11 +0100 Subject: [PATCH] Add example of how to use sdk --- README.md | 1 + calculate_average_baseline.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 93354ea..ac27ca5 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ To submit your own implementation to 1BRC, follow these steps: * Make that implementation fast. Really fast. * Create a copy of _calculate_average_baseline.sh_, named _calculate\_average\_.sh_, e.g. _calculate\_average\_doloreswilson.sh_. * Adjust that script so that it references your implementation class name. If needed, provide any JVM arguments via the `JAVA_OPTS` variable in that script. + Make sure that script does not write anything to standard output other than calculation results. * OpenJDK 21 is the default. If a custom JDK build is required, include the SDKMAN command `sdk use java [version]` in the launch shell script prior to application start. * (Optional) If you'd like to use native binaries (GraalVM), adjust the _pom.xml_ file so that it builds that binary. * Run the test suite by executing _/test.sh _; if any differences are reported, fix them before submitting your implementation. diff --git a/calculate_average_baseline.sh b/calculate_average_baseline.sh index 5d36397..2428423 100755 --- a/calculate_average_baseline.sh +++ b/calculate_average_baseline.sh @@ -15,6 +15,9 @@ # limitations under the License. # +# Uncomment below to use sdk +# source "$HOME/.sdkman/bin/sdkman-init.sh" +# sdk use java 21.0.1-graal 1>&2 JAVA_OPTS="" time java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage