Browse Source

Update Helidon Nima to 4.0.0-ALPHA6 (#8234)

* Update Helidon Nima to 4.0.0-ALPHA6
Java to JDK 20.
Postgresql jdbc driver to: 42.6.0 (with loom fixes)
Use hikaria db connection pool.

* use pgclient to keep changes to a minimum.

* Update helidon-nima.dockerfile

Remove the DisableExplicitGC flag.

* Update helidon-nima.dockerfile

Remove string de-duplication.
Colin Redmond 2 years ago
parent
commit
f0726d9456

+ 1 - 1
frameworks/Java/helidon/README.md

@@ -2,7 +2,7 @@
 
 This is the Helidon portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
 Two Helidon APIs are implemented: Reactive and Nima. The Reactive API has been around since the first
-version of Helidon while Nima is a new, blocking API based on JDK 19 virtual threads. 
+version of Helidon while Nima is a new, blocking API based on JDK 20 virtual threads. 
 
 The code is organized into two Maven modules, namely, *reactive* and *nima*. Both modules implement the
 same set of tests outlined below. 

+ 4 - 2
frameworks/Java/helidon/helidon-nima.dockerfile

@@ -1,10 +1,10 @@
-FROM docker.io/maven:3.8.6-eclipse-temurin-19 as maven
+FROM docker.io/maven:3.9.2-eclipse-temurin-20 as maven
 WORKDIR /helidon
 COPY nima/src src
 COPY nima/pom.xml pom.xml
 RUN mvn package -q
 
-FROM openjdk:19-jdk-slim
+FROM openjdk:20-jdk-slim
 WORKDIR /helidon
 COPY --from=maven /helidon/target/libs libs
 COPY --from=maven /helidon/target/benchmark-nima.jar app.jar
@@ -12,4 +12,6 @@ COPY --from=maven /helidon/target/benchmark-nima.jar app.jar
 EXPOSE 8080
 
 CMD java --enable-preview \
+    -XX:+UseNUMA \
+    -XX:+UseParallelGC \
     -jar app.jar

+ 5 - 5
frameworks/Java/helidon/nima/pom.xml

@@ -21,7 +21,7 @@
     <parent>
         <groupId>io.helidon.applications</groupId>
         <artifactId>helidon-se</artifactId>
-        <version>4.0.0-ALPHA1</version>
+        <version>4.0.0-ALPHA6</version>
         <relativePath/>
     </parent>
 
@@ -33,10 +33,10 @@
 
     <properties>
         <mainClass>io.helidon.benchmark.nima.Main</mainClass>
-        <version.java>19</version.java>
-        <version.plugin.compiler>3.8.1</version.plugin.compiler>
+        <version.java>20</version.java>
+        <version.plugin.compiler>3.11.0</version.plugin.compiler>
         <rocker.version>1.3.0</rocker.version>
-        <vertx-pg-client.version>4.2.0</vertx-pg-client.version>
+        <vertx-pg-client.version>4.4.2</vertx-pg-client.version>
         <jsoniter.version>0.9.23</jsoniter.version>
     </properties>
 
@@ -75,7 +75,7 @@
         <dependency>
             <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
-            <version>42.5.1</version>
+            <version>42.6.0</version>
         </dependency>
         <dependency>
             <groupId>com.fizzed</groupId>

+ 7 - 7
frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/Main.java

@@ -29,13 +29,13 @@ import io.helidon.benchmark.nima.models.HikariJdbcRepository;
 import io.helidon.benchmark.nima.models.PgClientRepository;
 import io.helidon.benchmark.nima.services.DbService;
 import io.helidon.benchmark.nima.services.FortuneHandler;
-import io.helidon.common.LogConfig;
 import io.helidon.common.http.Http;
 import io.helidon.common.http.Http.Header;
 import io.helidon.common.http.Http.HeaderValue;
 import io.helidon.common.http.Http.HeaderValues;
 import io.helidon.config.Config;
 import io.helidon.config.ConfigException;
+import io.helidon.logging.common.LogConfig;
 import io.helidon.nima.webserver.WebServer;
 import io.helidon.nima.webserver.http.Handler;
 import io.helidon.nima.webserver.http.HttpRules;
@@ -51,8 +51,8 @@ public final class Main {
     private static final Logger LOGGER = Logger.getLogger(Main.class.getName());
 
     public static final Http.HeaderValue CONTENT_TYPE_HTML =
-            Http.HeaderValue.createCached(Http.Header.CONTENT_TYPE, "text/html; charset=UTF-8");
-    public static final Http.HeaderValue SERVER = Http.HeaderValue.createCached(Http.Header.SERVER, "Nima");
+            Http.Header.createCached(Http.Header.CONTENT_TYPE, "text/html; charset=UTF-8");
+    public static final Http.HeaderValue SERVER = Http.Header.createCached(Http.Header.SERVER, "Nima");
 
     private Main() {
     }
@@ -107,9 +107,9 @@ public final class Main {
     }
 
     static class PlaintextHandler implements Handler {
-        static final HeaderValue CONTENT_TYPE = HeaderValue.createCached(Header.CONTENT_TYPE,
+        static final HeaderValue CONTENT_TYPE = Header.createCached(Header.CONTENT_TYPE,
                 "text/plain; charset=UTF-8");
-        static final HeaderValue CONTENT_LENGTH = HeaderValue.createCached(Header.CONTENT_LENGTH, "13");
+        static final HeaderValue CONTENT_LENGTH = Header.createCached(Header.CONTENT_LENGTH, "13");
 
         private static final byte[] RESPONSE_BYTES = "Hello, World!".getBytes(StandardCharsets.UTF_8);
 
@@ -125,7 +125,7 @@ public final class Main {
     static class JsonHandler implements Handler {
         private static final String MESSAGE = "Hello, World!";
         private static final int JSON_LENGTH = serializeMsg(new Message(MESSAGE)).length;
-        static final HeaderValue CONTENT_LENGTH = HeaderValue.createCached(Header.CONTENT_LENGTH,
+        static final HeaderValue CONTENT_LENGTH = Header.createCached(Header.CONTENT_LENGTH,
                 String.valueOf(JSON_LENGTH));
 
         @Override
@@ -148,7 +148,7 @@ public final class Main {
         JsonKHandler(int kilobytes) {
             this.message = "a".repeat(1024 * kilobytes);
             int length = serializeMsg(new Message(message)).length;
-            this.contentLength = HeaderValue.createCached(Header.CONTENT_LENGTH,
+            this.contentLength = Header.createCached(Header.CONTENT_LENGTH,
                     String.valueOf(length));
         }
 

+ 1 - 0
frameworks/Java/helidon/nima/src/main/resources/application.yaml

@@ -15,6 +15,7 @@
 #
 
 server:
+  port: 8080
   sockets:
     - name: "@default"
       host: 0.0.0.0