Pārlūkot izejas kodu

[ Kotlin / Hexagon ] Update Hexagon version and disable native image benchmarks (#9819)

* Update dependencies

* Update dependencies

* Update dependencies

* Update dependencies

* Update dependencies

* Fix native image settings

* Change implementations

* Update version

* Add tests for new adapter

* Update dependencies

* Update dependencies

* Update dependencies

* Update dependencies

* Update dependencies

* Update dependencies

* Disable native benchmarks

* Update configuration
Juanjo Aguililla 5 mēneši atpakaļ
vecāks
revīzija
809537ee92
22 mainītis faili ar 54 papildinājumiem un 116 dzēšanām
  1. 0 46
      frameworks/Kotlin/hexagon/benchmark_config.json
  2. 9 8
      frameworks/Kotlin/hexagon/build.gradle
  3. 0 36
      frameworks/Kotlin/hexagon/config.toml
  4. BIN
      frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.jar
  5. 1 1
      frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties
  6. 3 3
      frameworks/Kotlin/hexagon/gradlew
  7. 2 2
      frameworks/Kotlin/hexagon/gradlew.bat
  8. 1 1
      frameworks/Kotlin/hexagon/hexagon-helidon-native.dockerfile
  9. 2 2
      frameworks/Kotlin/hexagon/hexagon-helidon-pgclient.dockerfile
  10. 2 2
      frameworks/Kotlin/hexagon/hexagon-helidon.dockerfile
  11. 2 2
      frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile
  12. 2 2
      frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile
  13. 1 1
      frameworks/Kotlin/hexagon/hexagon-jetty-native.dockerfile
  14. 2 2
      frameworks/Kotlin/hexagon/hexagon-nettyepoll-pgclient.dockerfile
  15. 2 2
      frameworks/Kotlin/hexagon/hexagon-nettyepoll.dockerfile
  16. 1 1
      frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile
  17. 2 2
      frameworks/Kotlin/hexagon/hexagon.dockerfile
  18. 1 0
      frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/kotlin/Benchmark.kt
  19. 2 0
      frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/helidon_pgclient/native-image.properties
  20. 15 1
      frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/src/main/kotlin/Benchmark.kt
  21. 2 1
      frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/src/main/kotlin/Benchmark.kt
  22. 2 1
      frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/src/main/kotlin/Benchmark.kt

+ 0 - 46
frameworks/Kotlin/hexagon/benchmark_config.json

@@ -25,29 +25,6 @@
                 "notes": "http://hexagonkt.com",
                 "versus": "servlet"
             },
-            "jetty-native": {
-                "json_url": "/json",
-                "db_url": "/db",
-                "query_url": "/query?queries=",
-                "fortune_url": "/fortunes",
-                "update_url": "/update?queries=",
-                "cached_query_url": "/cached-queries?count=",
-                "plaintext_url": "/plaintext",
-                "port": 9090,
-                "approach": "Realistic",
-                "classification": "Micro",
-                "database": "postgres",
-                "framework": "Hexagon",
-                "language": "Kotlin",
-                "orm": "Raw",
-                "platform": "Servlet",
-                "webserver": "None",
-                "os": "Linux",
-                "database_os": "Linux",
-                "display_name": "Hexagon Jetty Native PostgreSQL",
-                "notes": "http://hexagonkt.com",
-                "versus": "servlet"
-            },
             "jdk": {
                 "json_url": "/json",
                 "db_url": "/db",
@@ -163,29 +140,6 @@
                 "notes": "http://hexagonkt.com",
                 "versus": "helidon-helidon"
             },
-            "helidon-native": {
-                "json_url": "/json",
-                "db_url": "/db",
-                "query_url": "/query?queries=",
-                "fortune_url": "/fortunes",
-                "update_url": "/update?queries=",
-                "cached_query_url": "/cached-queries?count=",
-                "plaintext_url": "/plaintext",
-                "port": 9090,
-                "approach": "Realistic",
-                "classification": "Micro",
-                "database": "postgres",
-                "framework": "Hexagon",
-                "language": "Kotlin",
-                "orm": "Raw",
-                "platform": "Helidon",
-                "webserver": "None",
-                "os": "Linux",
-                "database_os": "Linux",
-                "display_name": "Hexagon Helidon Native PgClient",
-                "notes": "http://hexagonkt.com",
-                "versus": "helidon-helidon"
-            },
             "helidon-pgclient": {
                 "json_url": "/json",
                 "db_url": "/db",

+ 9 - 8
frameworks/Kotlin/hexagon/build.gradle

@@ -1,7 +1,7 @@
 
 plugins {
-    id "org.jetbrains.kotlin.jvm" version "2.1.0" apply false
-    id "org.graalvm.buildtools.native" version "0.10.5" apply false
+    id "org.jetbrains.kotlin.jvm" version "2.1.20" apply false
+    id "org.graalvm.buildtools.native" version "0.10.6" apply false
 }
 
 version = "1.0.0"
@@ -9,13 +9,13 @@ description = "TFB benchmark"
 group = "com.hexagontk"
 
 ext {
-    hexagonVersion = "4.0.1"
-    jettyVersion = "12.0.16"
-    nettyVersion = "4.1.118.Final"
+    hexagonVersion = "4.1.1"
+    jettyVersion = "12.0.19"
+    nettyVersion = "4.2.0.Final"
 
-    hikariVersion = "6.2.1"
+    hikariVersion = "6.3.0"
     postgresqlVersion = "42.7.5"
-    vertxVersion = "4.5.12"
+    vertxVersion = "5.0.0.CR6"
     cache2kVersion = "2.6.1.Final"
 
     applicationClass = "com.hexagontk.BenchmarkKt"
@@ -30,5 +30,6 @@ subprojects {
 }
 
 tasks.wrapper {
-    gradleVersion = "8.12.1"
+//    gradleVersion = "8.14.0"
+    gradleVersion = "release-candidate"
 }

+ 0 - 36
frameworks/Kotlin/hexagon/config.toml

@@ -73,24 +73,6 @@ platform = "Netty"
 webserver = "None"
 versus = "netty"
 
-[nettyepoll-native]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/query?queries="
-urls.update = "/update?queries="
-urls.fortune = "/fortunes"
-urls.cached_query = "/cached-queries?count="
-approach = "Realistic"
-classification = "Micro"
-database = "postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "Netty"
-webserver = "None"
-versus = "netty"
-
 [nettyepoll-pgclient]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
@@ -127,24 +109,6 @@ platform = "Helidon"
 webserver = "None"
 versus = "helidon-helidon"
 
-[helidon-native]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/query?queries="
-urls.update = "/update?queries="
-urls.fortune = "/fortunes"
-urls.cached_query = "/cached-queries?count="
-approach = "Realistic"
-classification = "Micro"
-database = "postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "Helidon"
-webserver = "None"
-versus = "helidon-helidon"
-
 [helidon-pgclient]
 urls.plaintext = "/plaintext"
 urls.json = "/json"

BIN
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-rc-1-bin.zip
 networkTimeout=10000
 validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME

+ 3 - 3
frameworks/Kotlin/hexagon/gradlew

@@ -114,7 +114,7 @@ case "$( uname )" in                #(
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -205,7 +205,7 @@ fi
 DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 
 # Collect all arguments for the java command:
-#   * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
 #     and any embedded shellness will be escaped.
 #   * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
 #     treated as '${Hostname}' itself on the command line.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
         -classpath "$CLASSPATH" \
-        org.gradle.wrapper.GradleWrapperMain \
+        -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
 # Stop when "xargs" is not available.

+ 2 - 2
frameworks/Kotlin/hexagon/gradlew.bat

@@ -70,11 +70,11 @@ goto fail
 :execute
 @rem Setup the command line
 
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+set CLASSPATH=
 
 
 @rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
 
 :end
 @rem End local scope for the variables with windows NT shell

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon-helidon-native.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM container-registry.oracle.com/graalvm/native-image:21-muslib-ol9 as build
+FROM container-registry.oracle.com/graalvm/native-image:24-muslib-ol9 as build
 USER root
 WORKDIR /hexagon
 

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-helidon-pgclient.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-23-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_helidon_pgclient
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-helidon.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-23-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_helidon_postgresql
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-23-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_jdk_pgclient
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-23-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_jdk_postgresql
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon-jetty-native.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM container-registry.oracle.com/graalvm/native-image:21-muslib-ol9 as build
+FROM container-registry.oracle.com/graalvm/native-image:24-muslib-ol9 as build
 USER root
 WORKDIR /hexagon
 

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-nettyepoll-pgclient.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_nettyepoll_pgclient
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-nettyepoll.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_nettyepoll_postgresql
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-24-cds-musl AS build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
 #
 # RUNTIME
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-24-musl
 ARG PROJECT=hexagon_jetty_postgresql
 
 ENV POSTGRESQL_DB_HOST tfb-database

+ 1 - 0
frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/kotlin/Benchmark.kt

@@ -23,6 +23,7 @@ fun main() {
         validatePath = systemSettingOrNull<Boolean>("validatePath") ?: false,
         validateRequestHeaders = systemSettingOrNull<Boolean>("validateRequestHeaders") ?: false,
         validateResponseHeaders = systemSettingOrNull<Boolean>("validateResponseHeaders") ?: false,
+        smartAsyncWrites = true,
     )
 
     val benchmark = Benchmark(engine, store, templateEngine, templateUrl, Settings())

+ 2 - 0
frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/helidon_pgclient/native-image.properties

@@ -0,0 +1,2 @@
+Args= \
+  --initialize-at-build-time=io.vertx.core.impl.buffer.VertxByteBufAllocator

+ 15 - 1
frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/src/main/kotlin/Benchmark.kt

@@ -1,17 +1,31 @@
 package com.hexagontk
 
+import com.hexagontk.core.Platform.systemSettingOrNull
 import com.hexagontk.core.media.TEXT_HTML
 import com.hexagontk.core.urlOf
 import com.hexagontk.http.server.helidon.HelidonHttpServer
 import com.hexagontk.store.BenchmarkSqlStore
 import com.hexagontk.templates.jte.Jte
+import java.time.Duration
 
 fun main() {
     val settings = Settings()
     val store = BenchmarkSqlStore("postgresql")
     val templateEngine = Jte(TEXT_HTML, precompiled = true)
     val templateUrl = urlOf("classpath:fortunes.jte")
-    val engine = HelidonHttpServer()
+    val engine = HelidonHttpServer(
+        backlog = systemSettingOrNull("backlog") ?: (8 * 1024),
+        writeQueueLength = systemSettingOrNull("writeQueueLength") ?: (8 * 1024),
+        readTimeout = Duration.parse(systemSettingOrNull("readTimeout") ?: "PT0S"),
+        connectTimeout = Duration.parse(systemSettingOrNull("connectTimeout") ?: "PT0S"),
+        tcpNoDelay = systemSettingOrNull<Boolean>("tcpNoDelay") ?: true,
+        receiveLog = systemSettingOrNull<Boolean>("receiveLog") ?: false,
+        sendLog = systemSettingOrNull<Boolean>("sendLog") ?: false,
+        validatePath = systemSettingOrNull<Boolean>("validatePath") ?: false,
+        validateRequestHeaders = systemSettingOrNull<Boolean>("validateRequestHeaders") ?: false,
+        validateResponseHeaders = systemSettingOrNull<Boolean>("validateResponseHeaders") ?: false,
+        smartAsyncWrites = true,
+    )
 
     val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)
     benchmark.server.start()

+ 2 - 1
frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/src/main/kotlin/Benchmark.kt

@@ -1,5 +1,6 @@
 package com.hexagontk
 
+import com.hexagontk.core.Platform.systemSettingOrNull
 import com.hexagontk.core.media.TEXT_HTML
 import com.hexagontk.core.urlOf
 import com.hexagontk.http.server.jdk.JdkHttpServer
@@ -17,7 +18,7 @@ fun main() {
     val templateUrl = urlOf("classpath:fortunes.jte")
     val engine = JdkHttpServer(
         executor = newVirtualThreadPerTaskExecutor(),
-        backlog = 2_048
+        backlog = systemSettingOrNull("backlog") ?: (8 * 1024),
     )
 
     val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)

+ 2 - 1
frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/src/main/kotlin/Benchmark.kt

@@ -1,5 +1,6 @@
 package com.hexagontk
 
+import com.hexagontk.core.Platform.systemSettingOrNull
 import com.hexagontk.core.media.TEXT_HTML
 import com.hexagontk.core.urlOf
 import com.hexagontk.http.server.jdk.JdkHttpServer
@@ -17,7 +18,7 @@ fun main() {
     val templateUrl = urlOf("classpath:fortunes.jte")
     val engine = JdkHttpServer(
         executor = newVirtualThreadPerTaskExecutor(),
-        backlog = 2_048
+        backlog = systemSettingOrNull("backlog") ?: (8 * 1024),
     )
 
     val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)