From 8dff56beb4c7f88dc77ccb8f7f4d78e73568c8d9 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Wed, 30 Oct 2024 12:23:03 +0100 Subject: [PATCH 01/11] Update dependencies --- frameworks/Kotlin/hexagon/build.gradle | 8 ++-- frameworks/Kotlin/hexagon/core/build.gradle | 10 ++--- .../hexagon/core/src/main/kotlin/Benchmark.kt | 12 +++--- .../core/src/main/kotlin/Controller.kt | 40 +++++++++---------- .../src/main/kotlin/store/BenchmarkStore.kt | 10 ++--- .../core/src/main/resources/fortunes.jte | 2 +- .../hexagon_helidon_pgclient/build.gradle | 2 +- .../src/main/kotlin/Benchmark.kt | 18 ++++----- .../hexagon_helidon_postgresql/build.gradle | 2 +- .../src/main/kotlin/Benchmark.kt | 16 ++++---- .../hexagon_jetty_pgclient/build.gradle | 2 +- .../src/main/kotlin/Benchmark.kt | 18 ++++----- .../hexagon_jetty_postgresql/build.gradle | 2 +- .../src/main/kotlin/Benchmark.kt | 18 ++++----- .../hexagon_nettyepoll_pgclient/build.gradle | 2 +- .../src/main/kotlin/Benchmark.kt | 16 ++++---- .../build.gradle | 2 +- .../src/main/kotlin/Benchmark.kt | 16 ++++---- .../hexagon_tomcat_postgresql/build.gradle | 2 +- .../src/main/kotlin/WebListenerServer.kt | 26 ++++++------ frameworks/Kotlin/hexagon/model/build.gradle | 2 +- .../hexagon/model/src/main/kotlin/Settings.kt | 6 +-- .../src/main/kotlin/model/CachedWorld.kt | 2 +- .../model/src/main/kotlin/model/Fortune.kt | 2 +- .../model/src/main/kotlin/model/Message.kt | 2 +- .../model/src/main/kotlin/model/World.kt | 2 +- .../src/main/kotlin/BenchmarkPgClientStore.kt | 20 +++++----- .../src/main/kotlin/BenchmarkSqlStore.kt | 20 +++++----- 28 files changed, 140 insertions(+), 140 deletions(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index c33d231f630..1e2bf3e42aa 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/frameworks/Kotlin/hexagon/build.gradle @@ -6,10 +6,10 @@ plugins { version = "1.0.0" description = "TFB benchmark" -group = "com.hexagonkt" +group = "com.hexagontk" ext { - hexagonVersion = "3.7.2" + hexagonVersion = "4.0.0-A6" jettyVersion = "12.0.14" nettyVersion = "4.1.114.Final" @@ -18,9 +18,9 @@ ext { vertxVersion = "4.5.10" cache2kVersion = "2.6.1.Final" - applicationClass = "com.hexagonkt.BenchmarkKt" + applicationClass = "com.hexagontk.BenchmarkKt" modules = "java.naming,java.sql,java.management" - gradleScripts = "https://raw.githubusercontent.com/hexagonkt/hexagon/$hexagonVersion/gradle" + gradleScripts = "https://raw.githubusercontent.com/hexagontk/hexagon/$hexagonVersion/gradle" } subprojects { diff --git a/frameworks/Kotlin/hexagon/core/build.gradle b/frameworks/Kotlin/hexagon/core/build.gradle index 18212db6bee..4d4497956eb 100644 --- a/frameworks/Kotlin/hexagon/core/build.gradle +++ b/frameworks/Kotlin/hexagon/core/build.gradle @@ -1,16 +1,16 @@ plugins { - id("gg.jte.gradle") version("3.1.4") + id("gg.jte.gradle") version("3.1.13") } dependencies { api(project(":model")) - api("com.hexagonkt:http_server:$hexagonVersion") - api("com.hexagonkt:templates_jte:$hexagonVersion") - api("com.hexagonkt:serialization_jackson_json:$hexagonVersion") + api("com.hexagontk:http_server:$hexagonVersion") + api("com.hexagontk:templates_jte:$hexagonVersion") + api("com.hexagontk:serialization_jackson_json:$hexagonVersion") api("org.cache2k:cache2k-core:$cache2kVersion") - jteGenerate("gg.jte:jte-native-resources:3.1.4") + jteGenerate("gg.jte:jte-native-resources:3.1.13") } tasks.register("minimizeTemplate") { diff --git a/frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt index ef2da876dae..128b84ecbc4 100644 --- a/frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt @@ -1,10 +1,10 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.http.server.HttpServer -import com.hexagonkt.http.server.HttpServerPort -import com.hexagonkt.http.server.HttpServerSettings -import com.hexagonkt.store.BenchmarkStore -import com.hexagonkt.templates.TemplatePort +import com.hexagontk.http.server.HttpServer +import com.hexagontk.http.server.HttpServerPort +import com.hexagontk.http.server.HttpServerSettings +import com.hexagontk.store.BenchmarkStore +import com.hexagontk.templates.TemplatePort import java.net.InetAddress import java.net.URL diff --git a/frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt b/frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt index 5bfd17dfcd5..78b36c61401 100644 --- a/frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt +++ b/frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt @@ -1,21 +1,21 @@ -package com.hexagonkt - -import com.hexagonkt.core.fieldsMapOf -import com.hexagonkt.core.media.APPLICATION_JSON -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.media.TEXT_PLAIN -import com.hexagonkt.http.model.ContentType -import com.hexagonkt.http.model.Header -import com.hexagonkt.http.model.Headers -import com.hexagonkt.http.server.callbacks.DateCallback -import com.hexagonkt.http.handlers.HttpContext -import com.hexagonkt.http.handlers.PathHandler -import com.hexagonkt.http.handlers.path -import com.hexagonkt.model.* -import com.hexagonkt.serialization.jackson.json.Json -import com.hexagonkt.serialization.serialize -import com.hexagonkt.store.BenchmarkStore -import com.hexagonkt.templates.TemplatePort +package com.hexagontk + +import com.hexagontk.core.fieldsMapOf +import com.hexagontk.core.media.APPLICATION_JSON +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.media.TEXT_PLAIN +import com.hexagontk.http.model.ContentType +import com.hexagontk.http.model.Field +import com.hexagontk.http.model.Headers +import com.hexagontk.http.server.callbacks.DateCallback +import com.hexagontk.http.handlers.HttpContext +import com.hexagontk.http.handlers.PathHandler +import com.hexagontk.http.handlers.path +import com.hexagontk.model.* +import com.hexagontk.serialization.jackson.json.Json +import com.hexagontk.serialization.serialize +import com.hexagontk.store.BenchmarkStore +import com.hexagontk.templates.TemplatePort import java.net.URL import java.util.concurrent.ThreadLocalRandom import kotlin.text.Charsets.UTF_8 @@ -35,7 +35,7 @@ class Controller( private val json: ContentType = ContentType(APPLICATION_JSON) private val html: ContentType = ContentType(TEXT_HTML, charset = UTF_8) - private val headers = Headers(Header("server", "Hexagon")) + private val headers = Headers(Field("server", "Hexagon")) val path: PathHandler by lazy { path { @@ -105,7 +105,7 @@ class Controller( ok(body.serialize(Json.raw), contentType = json) private fun HttpContext.getWorldsCount(parameter: String): Int = - request.queryParameters[parameter]?.string()?.toIntOrNull().let { + request.queryParameters[parameter]?.text?.toIntOrNull().let { when { it == null -> 1 it < 1 -> 1 diff --git a/frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt b/frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt index 5182fe4ccae..384c81580f9 100644 --- a/frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt +++ b/frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt @@ -1,9 +1,9 @@ -package com.hexagonkt.store +package com.hexagontk.store -import com.hexagonkt.model.CachedWorld -import com.hexagonkt.model.Fortune -import com.hexagonkt.Settings -import com.hexagonkt.model.World +import com.hexagontk.model.CachedWorld +import com.hexagontk.model.Fortune +import com.hexagontk.Settings +import com.hexagontk.model.World import org.cache2k.Cache import org.cache2k.Cache2kBuilder diff --git a/frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.jte b/frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.jte index 82b28ce94c3..9c9aabbdb01 100644 --- a/frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.jte +++ b/frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.jte @@ -1,5 +1,5 @@ @import java.util.* -@import com.hexagonkt.model.Fortune +@import com.hexagontk.model.Fortune @param List fortunes diff --git a/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle index 5e64c7bde3f..07f874cd8e5 100644 --- a/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle @@ -4,5 +4,5 @@ apply(from: "$gradleScripts/native.gradle") dependencies { api(project(":store_pgclient")) - api("com.hexagonkt:http_server_helidon:$hexagonVersion") + api("com.hexagontk:http_server_helidon:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/kotlin/Benchmark.kt index a5778a2c353..2a97cb6ab07 100644 --- a/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/src/main/kotlin/Benchmark.kt @@ -1,18 +1,18 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.Jvm.systemSettingOrNull -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.server.helidon.HelidonServerAdapter -import com.hexagonkt.store.BenchmarkPgClientStore -import com.hexagonkt.templates.jte.JteAdapter +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.BenchmarkPgClientStore +import com.hexagontk.templates.jte.Jte import java.time.Duration fun main() { val store = BenchmarkPgClientStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") - val engine = HelidonServerAdapter( + val engine = HelidonHttpServer( backlog = systemSettingOrNull("backlog") ?: (8 * 1024), writeQueueLength = systemSettingOrNull("writeQueueLength") ?: (8 * 1024), readTimeout = Duration.parse(systemSettingOrNull("readTimeout") ?: "PT0S"), diff --git a/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle index 1fb3fbffab6..fb273971f8d 100644 --- a/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle @@ -3,5 +3,5 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_sql")) - api("com.hexagonkt:http_server_helidon:$hexagonVersion") + api("com.hexagontk:http_server_helidon:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/src/main/kotlin/Benchmark.kt index cbfb372cbd5..9cbf992c8f4 100644 --- a/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/src/main/kotlin/Benchmark.kt @@ -1,17 +1,17 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.server.helidon.HelidonServerAdapter -import com.hexagonkt.store.BenchmarkSqlStore -import com.hexagonkt.templates.jte.JteAdapter +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 fun main() { val settings = Settings() val store = BenchmarkSqlStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") - val engine = HelidonServerAdapter() + val engine = HelidonHttpServer() val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings) benchmark.server.start() diff --git a/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle index 3b3d4b51b92..ccdcc123208 100644 --- a/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle @@ -3,5 +3,5 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_pgclient")) - api("com.hexagonkt:http_server_jetty:$hexagonVersion") + api("com.hexagontk:http_server_jetty:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/src/main/kotlin/Benchmark.kt index c6e8dbcf855..54efe59c383 100644 --- a/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/src/main/kotlin/Benchmark.kt @@ -1,18 +1,18 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.Jvm.systemFlag -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.server.jetty.JettyServletAdapter -import com.hexagonkt.store.BenchmarkPgClientStore -import com.hexagonkt.templates.jte.JteAdapter +import com.hexagontk.core.Platform.systemFlag +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.server.jetty.JettyServletHttpServer +import com.hexagontk.store.BenchmarkPgClientStore +import com.hexagontk.templates.jte.Jte fun main() { val settings = Settings() val store = BenchmarkPgClientStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") - val engine = JettyServletAdapter( + val engine = JettyServletHttpServer( sendDateHeader = settings.sendDateHeader, sendServerVersion = settings.sendServerVersion, sendXPoweredBy = settings.sendXPoweredBy, diff --git a/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle index 059804ac9ff..128f753eec3 100644 --- a/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle @@ -4,5 +4,5 @@ apply(from: "$gradleScripts/native.gradle") dependencies { api(project(":store_sql")) - api("com.hexagonkt:http_server_jetty:$hexagonVersion") + api("com.hexagontk:http_server_jetty:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/src/main/kotlin/Benchmark.kt index 64585b785b6..40d654f2a7f 100644 --- a/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/src/main/kotlin/Benchmark.kt @@ -1,18 +1,18 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.Jvm.systemFlag -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.server.jetty.JettyServletAdapter -import com.hexagonkt.store.BenchmarkSqlStore -import com.hexagonkt.templates.jte.JteAdapter +import com.hexagontk.core.Platform.systemFlag +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.server.jetty.JettyServletHttpServer +import com.hexagontk.store.BenchmarkSqlStore +import com.hexagontk.templates.jte.Jte fun main() { val settings = Settings() val store = BenchmarkSqlStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") - val engine = JettyServletAdapter( + val engine = JettyServletHttpServer( sendDateHeader = settings.sendDateHeader, sendServerVersion = settings.sendServerVersion, sendXPoweredBy = settings.sendXPoweredBy, diff --git a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle index 0017123ec54..83845bbf609 100644 --- a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle @@ -3,6 +3,6 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_pgclient")) - api("com.hexagonkt:http_server_netty_epoll:$hexagonVersion") + api("com.hexagontk:http_server_netty_epoll:$hexagonVersion") api("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64") } diff --git a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/src/main/kotlin/Benchmark.kt index 0bbd8038edd..f094b7bc217 100644 --- a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/src/main/kotlin/Benchmark.kt @@ -1,10 +1,10 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.server.netty.epoll.NettyEpollServerAdapter -import com.hexagonkt.store.BenchmarkPgClientStore -import com.hexagonkt.templates.jte.JteAdapter +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.server.netty.epoll.NettyEpollHttpServer +import com.hexagontk.store.BenchmarkPgClientStore +import com.hexagontk.templates.jte.Jte import io.netty.util.ResourceLeakDetector import io.netty.util.ResourceLeakDetector.Level.DISABLED @@ -16,9 +16,9 @@ fun main() { val settings = Settings() val store = BenchmarkPgClientStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") - val engine = NettyEpollServerAdapter( + val engine = NettyEpollHttpServer( keepAliveHandler = false, httpAggregatorHandler = false, chunkedHandler = false, diff --git a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle index 243fa57c121..e10d67ba3d4 100644 --- a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle @@ -3,6 +3,6 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_sql")) - api("com.hexagonkt:http_server_netty_epoll:$hexagonVersion") + api("com.hexagontk:http_server_netty_epoll:$hexagonVersion") api("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64") } diff --git a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/src/main/kotlin/Benchmark.kt index 77fa370b915..eaba3b48b40 100644 --- a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/src/main/kotlin/Benchmark.kt +++ b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/src/main/kotlin/Benchmark.kt @@ -1,10 +1,10 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.server.netty.epoll.NettyEpollServerAdapter -import com.hexagonkt.store.BenchmarkSqlStore -import com.hexagonkt.templates.jte.JteAdapter +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.server.netty.epoll.NettyEpollHttpServer +import com.hexagontk.store.BenchmarkSqlStore +import com.hexagontk.templates.jte.Jte import io.netty.util.ResourceLeakDetector import io.netty.util.ResourceLeakDetector.Level.DISABLED @@ -16,9 +16,9 @@ fun main() { val settings = Settings() val store = BenchmarkSqlStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") - val engine = NettyEpollServerAdapter( + val engine = NettyEpollHttpServer( keepAliveHandler = false, httpAggregatorHandler = false, chunkedHandler = false, diff --git a/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle index 3c72b9d4b0a..057850a2316 100644 --- a/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle @@ -9,7 +9,7 @@ build.dependsOn("war") dependencies { api(project(":store_sql")) - api("com.hexagonkt:http_server_servlet:$hexagonVersion") + api("com.hexagontk:http_server_servlet:$hexagonVersion") compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0") } diff --git a/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/src/main/kotlin/WebListenerServer.kt b/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/src/main/kotlin/WebListenerServer.kt index c7d7ea4449c..d50232ab974 100644 --- a/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/src/main/kotlin/WebListenerServer.kt +++ b/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/src/main/kotlin/WebListenerServer.kt @@ -1,15 +1,15 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.media.TEXT_HTML -import com.hexagonkt.core.urlOf -import com.hexagonkt.http.model.Header -import com.hexagonkt.http.model.Headers -import com.hexagonkt.http.handlers.HttpHandler -import com.hexagonkt.http.handlers.OnHandler -import com.hexagonkt.http.handlers.PathHandler -import com.hexagonkt.http.server.servlet.ServletServer -import com.hexagonkt.store.BenchmarkSqlStore -import com.hexagonkt.templates.jte.JteAdapter +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.model.Field +import com.hexagontk.http.model.Headers +import com.hexagontk.http.handlers.HttpHandler +import com.hexagontk.http.handlers.OnHandler +import com.hexagontk.http.handlers.PathHandler +import com.hexagontk.http.server.servlet.ServletServer +import com.hexagontk.store.BenchmarkSqlStore +import com.hexagontk.templates.jte.Jte import jakarta.servlet.annotation.WebListener @WebListener class WebListenerServer( @@ -17,11 +17,11 @@ import jakarta.servlet.annotation.WebListener ) : ServletServer(createHandlers(settings)) { private companion object { - val headers = Headers(Header("server", "Tomcat")) + val headers = Headers(Field("server", "Tomcat")) fun createHandlers(settings: Settings): HttpHandler { val store = BenchmarkSqlStore("postgresql") - val templateEngine = JteAdapter(TEXT_HTML, precompiled = true) + val templateEngine = Jte(TEXT_HTML, precompiled = true) val templateUrl = urlOf("classpath:fortunes.jte") val controller = Controller(settings, store, templateEngine, templateUrl) val controllerPath = controller.path diff --git a/frameworks/Kotlin/hexagon/model/build.gradle b/frameworks/Kotlin/hexagon/model/build.gradle index bb97bfd9a3d..a606fb03967 100644 --- a/frameworks/Kotlin/hexagon/model/build.gradle +++ b/frameworks/Kotlin/hexagon/model/build.gradle @@ -1,4 +1,4 @@ dependencies { - api("com.hexagonkt:core:$hexagonVersion") + api("com.hexagontk:core:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/model/src/main/kotlin/Settings.kt b/frameworks/Kotlin/hexagon/model/src/main/kotlin/Settings.kt index b11ed02c9e9..70fdd0f5b81 100644 --- a/frameworks/Kotlin/hexagon/model/src/main/kotlin/Settings.kt +++ b/frameworks/Kotlin/hexagon/model/src/main/kotlin/Settings.kt @@ -1,7 +1,7 @@ -package com.hexagonkt +package com.hexagontk -import com.hexagonkt.core.Jvm.systemFlag -import com.hexagonkt.core.Jvm.systemSettingOrNull +import com.hexagontk.core.Platform.systemFlag +import com.hexagontk.core.Platform.systemSettingOrNull data class Settings( val bindPort: Int = systemSettingOrNull("bindPort") ?: 9090, diff --git a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/CachedWorld.kt b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/CachedWorld.kt index 101176e3c39..edfa5ee0ec5 100644 --- a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/CachedWorld.kt +++ b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/CachedWorld.kt @@ -1,3 +1,3 @@ -package com.hexagonkt.model +package com.hexagontk.model data class CachedWorld(val id: Int, val randomNumber: Int) diff --git a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Fortune.kt b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Fortune.kt index b4781735ec1..a8061b81db3 100644 --- a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Fortune.kt +++ b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Fortune.kt @@ -1,3 +1,3 @@ -package com.hexagonkt.model +package com.hexagontk.model data class Fortune(val id: Int, val message: String) diff --git a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Message.kt b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Message.kt index 090dcbf0be6..3231b8bd961 100644 --- a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Message.kt +++ b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/Message.kt @@ -1,3 +1,3 @@ -package com.hexagonkt.model +package com.hexagontk.model data class Message(val message: String) diff --git a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/World.kt b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/World.kt index 5f3316f9a5a..347e00e608f 100644 --- a/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/World.kt +++ b/frameworks/Kotlin/hexagon/model/src/main/kotlin/model/World.kt @@ -1,3 +1,3 @@ -package com.hexagonkt.model +package com.hexagontk.model data class World(val id: Int, val randomNumber: Int) diff --git a/frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt b/frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt index 510abda0295..5daf33c5246 100644 --- a/frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt +++ b/frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt @@ -1,10 +1,10 @@ -package com.hexagonkt.store +package com.hexagontk.store -import com.hexagonkt.Settings -import com.hexagonkt.core.Jvm -import com.hexagonkt.model.CachedWorld -import com.hexagonkt.model.Fortune -import com.hexagonkt.model.World +import com.hexagontk.Settings +import com.hexagontk.core.Platform +import com.hexagontk.model.CachedWorld +import com.hexagontk.model.Fortune +import com.hexagontk.model.World import io.vertx.core.Future import io.vertx.core.Vertx import io.vertx.core.VertxOptions @@ -26,7 +26,7 @@ class BenchmarkPgClientStore( private val connectOptions: PgConnectOptions by lazy { PgConnectOptions().apply { - host = Jvm.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "tfb-database" + host = Platform.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "tfb-database" database = settings.databaseName user = settings.databaseUsername password = settings.databasePassword @@ -36,9 +36,9 @@ class BenchmarkPgClientStore( private val poolOptions: PoolOptions by lazy { PoolOptions().apply { - val environment = Jvm.systemSettingOrNull("BENCHMARK_ENV")?.lowercase() - val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2 - maxSize = Jvm.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize + val environment = Platform.systemSettingOrNull("BENCHMARK_ENV")?.lowercase() + val poolSize = 8 + if (environment == "citrine") Platform.cpuCount else Platform.cpuCount * 2 + maxSize = Platform.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize } } diff --git a/frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt b/frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt index 501a4d9ce34..b1b766e5106 100644 --- a/frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt +++ b/frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt @@ -1,10 +1,10 @@ -package com.hexagonkt.store +package com.hexagontk.store -import com.hexagonkt.model.CachedWorld -import com.hexagonkt.model.Fortune -import com.hexagonkt.Settings -import com.hexagonkt.model.World -import com.hexagonkt.core.Jvm +import com.hexagontk.model.CachedWorld +import com.hexagontk.model.Fortune +import com.hexagontk.Settings +import com.hexagontk.model.World +import com.hexagontk.core.Platform import com.zaxxer.hikari.HikariConfig import com.zaxxer.hikari.HikariDataSource import org.cache2k.Cache @@ -22,9 +22,9 @@ class BenchmarkSqlStore( } private val dataSource: HikariDataSource by lazy { - val dbHost = Jvm.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "tfb-database" - val environment = Jvm.systemSettingOrNull(String::class, "BENCHMARK_ENV")?.lowercase() - val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2 + val dbHost = Platform.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "tfb-database" + val environment = Platform.systemSettingOrNull(String::class, "BENCHMARK_ENV")?.lowercase() + val poolSize = 8 + if (environment == "citrine") Platform.cpuCount else Platform.cpuCount * 2 val postgresqlSettings = listOf( "ssl=false", "assumeMinServerVersion=12.10", @@ -34,7 +34,7 @@ class BenchmarkSqlStore( ).joinToString("&") val config = HikariConfig().apply { jdbcUrl = "jdbc:postgresql://$dbHost/${settings.databaseName}?$postgresqlSettings" - maximumPoolSize = Jvm.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize + maximumPoolSize = Platform.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize driverClassName = settings.databaseDriver username = settings.databaseUsername password = settings.databasePassword From a9b32641b3479ea8dad819ee4ff877d8a43f8b96 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Thu, 23 Jan 2025 20:48:02 +0100 Subject: [PATCH 02/11] Update dependencies --- frameworks/Kotlin/hexagon/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index d0ab1ed8b4e..78d249808c6 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/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.3" apply false + id "org.graalvm.buildtools.native" version "0.10.4" apply false } version = "1.0.0" From 58f1b4b16964cc95b5910106d8ddfeb2d00fcc30 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Thu, 23 Jan 2025 20:51:16 +0100 Subject: [PATCH 03/11] Update dependencies --- frameworks/Kotlin/hexagon/build.gradle | 2 +- .../Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index 78d249808c6..260a266c96d 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/frameworks/Kotlin/hexagon/build.gradle @@ -30,5 +30,5 @@ subprojects { } tasks.wrapper { - gradleVersion = "8.10.2" + gradleVersion = "8.12" } diff --git a/frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties b/frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties index df97d72b8b9..cea7a793a84 100644 --- a/frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties +++ b/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.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 1b4e71fffdd4e0b17702ff293010d28935ac519a Mon Sep 17 00:00:00 2001 From: jaguililla Date: Thu, 23 Jan 2025 20:52:57 +0100 Subject: [PATCH 04/11] Update dependencies --- frameworks/Kotlin/hexagon/gradlew | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frameworks/Kotlin/hexagon/gradlew b/frameworks/Kotlin/hexagon/gradlew index f5feea6d6b1..f3b75f3b0d4 100755 --- a/frameworks/Kotlin/hexagon/gradlew +++ b/frameworks/Kotlin/hexagon/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum From d52cc34303c2baeeeb26027af874100bbcc3e717 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Fri, 24 Jan 2025 07:48:20 +0100 Subject: [PATCH 05/11] Update dependencies --- frameworks/Kotlin/hexagon/build.gradle | 2 +- frameworks/Kotlin/hexagon/core/build.gradle | 6 +++--- .../Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle | 2 +- .../Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle | 2 +- .../Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle | 2 +- .../Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle | 2 +- .../Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle | 2 +- .../hexagon/hexagon_nettyepoll_postgresql/build.gradle | 2 +- .../Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index 260a266c96d..5ef44022b69 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/frameworks/Kotlin/hexagon/build.gradle @@ -9,7 +9,7 @@ description = "TFB benchmark" group = "com.hexagontk" ext { - hexagonVersion = "4.0.0-A6" + hexagonVersion = "4.0.0-B1" jettyVersion = "12.0.16" nettyVersion = "4.1.117.Final" diff --git a/frameworks/Kotlin/hexagon/core/build.gradle b/frameworks/Kotlin/hexagon/core/build.gradle index 4d4497956eb..d4d2650a0dc 100644 --- a/frameworks/Kotlin/hexagon/core/build.gradle +++ b/frameworks/Kotlin/hexagon/core/build.gradle @@ -5,9 +5,9 @@ plugins { dependencies { api(project(":model")) - api("com.hexagontk:http_server:$hexagonVersion") - api("com.hexagontk:templates_jte:$hexagonVersion") - api("com.hexagontk:serialization_jackson_json:$hexagonVersion") + api("com.hexagontk.http:http_server:$hexagonVersion") + api("com.hexagontk.templates:templates_jte:$hexagonVersion") + api("com.hexagontk.serialization:serialization_jackson_json:$hexagonVersion") api("org.cache2k:cache2k-core:$cache2kVersion") jteGenerate("gg.jte:jte-native-resources:3.1.13") diff --git a/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle index 07f874cd8e5..68a431b25a8 100644 --- a/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_helidon_pgclient/build.gradle @@ -4,5 +4,5 @@ apply(from: "$gradleScripts/native.gradle") dependencies { api(project(":store_pgclient")) - api("com.hexagontk:http_server_helidon:$hexagonVersion") + api("com.hexagontk.http:http_server_helidon:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle index fb273971f8d..2fa5b450d0c 100644 --- a/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_helidon_postgresql/build.gradle @@ -3,5 +3,5 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_sql")) - api("com.hexagontk:http_server_helidon:$hexagonVersion") + api("com.hexagontk.http:http_server_helidon:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle index ccdcc123208..a9c2a1b12d2 100644 --- a/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle @@ -3,5 +3,5 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_pgclient")) - api("com.hexagontk:http_server_jetty:$hexagonVersion") + api("com.hexagontk.http:http_server_jetty:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle index 128f753eec3..5576046c945 100644 --- a/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle @@ -4,5 +4,5 @@ apply(from: "$gradleScripts/native.gradle") dependencies { api(project(":store_sql")) - api("com.hexagontk:http_server_jetty:$hexagonVersion") + api("com.hexagontk.http:http_server_jetty:$hexagonVersion") } diff --git a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle index 83845bbf609..2a8b788a99f 100644 --- a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle @@ -3,6 +3,6 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_pgclient")) - api("com.hexagontk:http_server_netty_epoll:$hexagonVersion") + api("com.hexagontk.http:http_server_netty_epoll:$hexagonVersion") api("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64") } diff --git a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle index e10d67ba3d4..3c142f1f1c6 100644 --- a/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle @@ -3,6 +3,6 @@ apply(from: "$gradleScripts/application.gradle") dependencies { api(project(":store_sql")) - api("com.hexagontk:http_server_netty_epoll:$hexagonVersion") + api("com.hexagontk.http:http_server_netty_epoll:$hexagonVersion") api("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64") } diff --git a/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle index 057850a2316..ca5fd01a071 100644 --- a/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle +++ b/frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle @@ -9,7 +9,7 @@ build.dependsOn("war") dependencies { api(project(":store_sql")) - api("com.hexagontk:http_server_servlet:$hexagonVersion") + api("com.hexagontk.http:http_server_servlet:$hexagonVersion") compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0") } From 8fe9756f51210dcbbe526399275fff2290b7e4ec Mon Sep 17 00:00:00 2001 From: jaguililla Date: Fri, 24 Jan 2025 08:33:46 +0100 Subject: [PATCH 06/11] Fix native image settings --- .../com.hexagonkt.benchmark/core/native-image.properties | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frameworks/Kotlin/hexagon/core/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/core/native-image.properties b/frameworks/Kotlin/hexagon/core/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/core/native-image.properties index 3c802071a99..50844ff8098 100644 --- a/frameworks/Kotlin/hexagon/core/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/core/native-image.properties +++ b/frameworks/Kotlin/hexagon/core/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/core/native-image.properties @@ -3,4 +3,7 @@ Args= \ --static \ --libc=musl \ --gc=G1 \ - --enable-sbom + --enable-sbom \ + --initialize-at-build-time=org.slf4j.LoggerFactory \ + --initialize-at-build-time=org.slf4j.helpers.Reporter \ + --initialize-at-build-time=org.slf4j.LoggerFactoinitialize-at-build-timery From 6ee6817be37b0e3c3597e91d08e343a6797b76d7 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Sat, 1 Feb 2025 17:58:05 +0100 Subject: [PATCH 07/11] Change implementations --- ...tyloom-pgclient.dockerfile => hexagon-jdk-pgclient.dockerfile} | 0 .../{hexagon-jettyloom.dockerfile => hexagon-jdk.dockerfile} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename frameworks/Kotlin/hexagon/{hexagon-jettyloom-pgclient.dockerfile => hexagon-jdk-pgclient.dockerfile} (100%) rename frameworks/Kotlin/hexagon/{hexagon-jettyloom.dockerfile => hexagon-jdk.dockerfile} (100%) diff --git a/frameworks/Kotlin/hexagon/hexagon-jettyloom-pgclient.dockerfile b/frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile similarity index 100% rename from frameworks/Kotlin/hexagon/hexagon-jettyloom-pgclient.dockerfile rename to frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile diff --git a/frameworks/Kotlin/hexagon/hexagon-jettyloom.dockerfile b/frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile similarity index 100% rename from frameworks/Kotlin/hexagon/hexagon-jettyloom.dockerfile rename to frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile From 91d5ed27d95b15ef9d3c02cf381e298a5a1a6fac Mon Sep 17 00:00:00 2001 From: jaguililla Date: Sat, 1 Feb 2025 18:28:02 +0100 Subject: [PATCH 08/11] Update version --- frameworks/Kotlin/hexagon/build.gradle | 4 ++-- .../Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index 5ef44022b69..2dd26b53971 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/frameworks/Kotlin/hexagon/build.gradle @@ -9,7 +9,7 @@ description = "TFB benchmark" group = "com.hexagontk" ext { - hexagonVersion = "4.0.0-B1" + hexagonVersion = "4.0.0-B2" jettyVersion = "12.0.16" nettyVersion = "4.1.117.Final" @@ -30,5 +30,5 @@ subprojects { } tasks.wrapper { - gradleVersion = "8.12" + gradleVersion = "8.12.1" } diff --git a/frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties b/frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties index cea7a793a84..e18bc253b85 100644 --- a/frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties +++ b/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-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From aec5ad27434e81748c07f8954d0cae4aa47566b1 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Sat, 1 Feb 2025 18:50:05 +0100 Subject: [PATCH 09/11] Add tests for new adapter --- .../Kotlin/hexagon/benchmark_config.json | 8 +++--- frameworks/Kotlin/hexagon/config.toml | 4 +-- .../hexagon/hexagon-jdk-pgclient.dockerfile | 8 +++--- .../Kotlin/hexagon/hexagon-jdk.dockerfile | 8 +++--- .../hexagon/hexagon_jdk_pgclient/build.gradle | 7 ++++++ .../src/main/kotlin/Benchmark.kt | 25 +++++++++++++++++++ .../hexagon_jdk_postgresql/build.gradle | 8 ++++++ .../src/main/kotlin/Benchmark.kt | 25 +++++++++++++++++++ frameworks/Kotlin/hexagon/settings.gradle | 2 ++ 9 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/build.gradle create mode 100644 frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/src/main/kotlin/Benchmark.kt create mode 100644 frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/build.gradle create mode 100644 frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/src/main/kotlin/Benchmark.kt diff --git a/frameworks/Kotlin/hexagon/benchmark_config.json b/frameworks/Kotlin/hexagon/benchmark_config.json index 8155e24b68c..f858301bddd 100644 --- a/frameworks/Kotlin/hexagon/benchmark_config.json +++ b/frameworks/Kotlin/hexagon/benchmark_config.json @@ -48,7 +48,7 @@ "notes": "http://hexagonkt.com", "versus": "servlet" }, - "jettyloom": { + "jdk": { "json_url": "/json", "db_url": "/db", "query_url": "/query?queries=", @@ -67,11 +67,11 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "Hexagon Jetty Loom PostgreSQL", + "display_name": "Hexagon JDK PostgreSQL", "notes": "http://hexagonkt.com", "versus": "servlet" }, - "jettyloom-pgclient": { + "jdk-pgclient": { "json_url": "/json", "db_url": "/db", "query_url": "/query?queries=", @@ -90,7 +90,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "Hexagon Jetty Loom PgClient", + "display_name": "Hexagon JDK PgClient", "notes": "http://hexagonkt.com", "versus": "servlet" }, diff --git a/frameworks/Kotlin/hexagon/config.toml b/frameworks/Kotlin/hexagon/config.toml index 6f25ab27753..c9e89f53241 100644 --- a/frameworks/Kotlin/hexagon/config.toml +++ b/frameworks/Kotlin/hexagon/config.toml @@ -19,7 +19,7 @@ platform = "Servlet" webserver = "None" versus = "servlet" -[jettyloom] +[jdk] urls.plaintext = "/plaintext" urls.json = "/json" urls.db = "/db" @@ -37,7 +37,7 @@ platform = "Servlet" webserver = "None" versus = "servlet" -[jettyloom-pgclient] +[jdk-pgclient] urls.plaintext = "/plaintext" urls.json = "/json" urls.db = "/db" diff --git a/frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile b/frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile index 21ef3b64c8b..485fff941e5 100644 --- a/frameworks/Kotlin/hexagon/hexagon-jdk-pgclient.dockerfile +++ b/frameworks/Kotlin/hexagon/hexagon-jdk-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-23-cds-musl AS build USER root WORKDIR /hexagon @@ -12,8 +12,8 @@ RUN ./gradlew --quiet -x test installDist # # RUNTIME # -FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl -ARG PROJECT=hexagon_jetty_pgclient +FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl +ARG PROJECT=hexagon_jdk_pgclient ENV POSTGRESQL_DB_HOST tfb-database ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true @@ -21,4 +21,4 @@ ENV maximumPoolSize 300 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT -ENTRYPOINT [ "/opt/hexagon_jetty_pgclient/bin/hexagon_jetty_pgclient" ] +ENTRYPOINT [ "/opt/hexagon_jdk_pgclient/bin/hexagon_jdk_pgclient" ] diff --git a/frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile b/frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile index c51c03bc6db..b82e52e1100 100644 --- a/frameworks/Kotlin/hexagon/hexagon-jdk.dockerfile +++ b/frameworks/Kotlin/hexagon/hexagon-jdk.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-23-cds-musl AS build USER root WORKDIR /hexagon @@ -12,8 +12,8 @@ RUN ./gradlew --quiet -x test installDist # # RUNTIME # -FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl -ARG PROJECT=hexagon_jetty_postgresql +FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl +ARG PROJECT=hexagon_jdk_postgresql ENV POSTGRESQL_DB_HOST tfb-database ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true @@ -21,4 +21,4 @@ ENV maximumPoolSize 300 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT -ENTRYPOINT [ "/opt/hexagon_jetty_postgresql/bin/hexagon_jetty_postgresql" ] +ENTRYPOINT [ "/opt/hexagon_jdk_postgresql/bin/hexagon_jdk_postgresql" ] diff --git a/frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/build.gradle b/frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/build.gradle new file mode 100644 index 00000000000..52bd337daf9 --- /dev/null +++ b/frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/build.gradle @@ -0,0 +1,7 @@ + +apply(from: "$gradleScripts/application.gradle") + +dependencies { + api(project(":store_pgclient")) + api("com.hexagontk.http:http_server_jdk:$hexagonVersion") +} diff --git a/frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/src/main/kotlin/Benchmark.kt new file mode 100644 index 00000000000..d5cdace42f1 --- /dev/null +++ b/frameworks/Kotlin/hexagon/hexagon_jdk_pgclient/src/main/kotlin/Benchmark.kt @@ -0,0 +1,25 @@ +package com.hexagontk + +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.server.jdk.JdkHttpServer +import com.hexagontk.store.BenchmarkPgClientStore +import com.hexagontk.templates.jte.Jte +import java.util.concurrent.Executors.newVirtualThreadPerTaskExecutor + +fun main() { + System.setProperty("sun.net.httpserver.idleInterval", "5") + System.setProperty("sun.net.httpserver.maxIdleConnections", "400") + + val settings = Settings() + val store = BenchmarkPgClientStore("postgresql") + val templateEngine = Jte(TEXT_HTML, precompiled = true) + val templateUrl = urlOf("classpath:fortunes.jte") + val engine = JdkHttpServer( + executor = newVirtualThreadPerTaskExecutor(), + backlog = 2_048 + ) + + val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings) + benchmark.server.start() +} diff --git a/frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/build.gradle b/frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/build.gradle new file mode 100644 index 00000000000..b1ea253c073 --- /dev/null +++ b/frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/build.gradle @@ -0,0 +1,8 @@ + +apply(from: "$gradleScripts/application.gradle") +apply(from: "$gradleScripts/native.gradle") + +dependencies { + api(project(":store_sql")) + api("com.hexagontk.http:http_server_jdk:$hexagonVersion") +} diff --git a/frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/src/main/kotlin/Benchmark.kt b/frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/src/main/kotlin/Benchmark.kt new file mode 100644 index 00000000000..67d2a3dfba2 --- /dev/null +++ b/frameworks/Kotlin/hexagon/hexagon_jdk_postgresql/src/main/kotlin/Benchmark.kt @@ -0,0 +1,25 @@ +package com.hexagontk + +import com.hexagontk.core.media.TEXT_HTML +import com.hexagontk.core.urlOf +import com.hexagontk.http.server.jdk.JdkHttpServer +import com.hexagontk.store.BenchmarkSqlStore +import com.hexagontk.templates.jte.Jte +import java.util.concurrent.Executors.newVirtualThreadPerTaskExecutor + +fun main() { + System.setProperty("sun.net.httpserver.idleInterval", "5") + System.setProperty("sun.net.httpserver.maxIdleConnections", "400") + + val settings = Settings() + val store = BenchmarkSqlStore("postgresql") + val templateEngine = Jte(TEXT_HTML, precompiled = true) + val templateUrl = urlOf("classpath:fortunes.jte") + val engine = JdkHttpServer( + executor = newVirtualThreadPerTaskExecutor(), + backlog = 2_048 + ) + + val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings) + benchmark.server.start() +} diff --git a/frameworks/Kotlin/hexagon/settings.gradle b/frameworks/Kotlin/hexagon/settings.gradle index f7b97fb2582..2636b07ef6a 100644 --- a/frameworks/Kotlin/hexagon/settings.gradle +++ b/frameworks/Kotlin/hexagon/settings.gradle @@ -9,6 +9,8 @@ include( "hexagon_jetty_postgresql", "hexagon_helidon_pgclient", "hexagon_helidon_postgresql", + "hexagon_jdk_pgclient", + "hexagon_jdk_postgresql", "hexagon_nettyepoll_pgclient", "hexagon_nettyepoll_postgresql", "hexagon_tomcat_postgresql", From 0711d7995cddbd8e0ff6009bf7620ae51ab46196 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Tue, 11 Feb 2025 19:56:02 +0100 Subject: [PATCH 10/11] Update dependencies --- frameworks/Kotlin/hexagon/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index 2dd26b53971..f139de09d9d 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/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.4" apply false + id "org.graalvm.buildtools.native" version "0.10.5" apply false } version = "1.0.0" @@ -9,7 +9,7 @@ description = "TFB benchmark" group = "com.hexagontk" ext { - hexagonVersion = "4.0.0-B2" + hexagonVersion = "4.0.0-B4" jettyVersion = "12.0.16" nettyVersion = "4.1.117.Final" From c292325c28e1f3b2ccaeccabd43d802cec80db4e Mon Sep 17 00:00:00 2001 From: jaguililla Date: Sat, 15 Feb 2025 05:53:01 +0100 Subject: [PATCH 11/11] Update dependencies --- frameworks/Kotlin/hexagon/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/Kotlin/hexagon/build.gradle b/frameworks/Kotlin/hexagon/build.gradle index f139de09d9d..97818fa7924 100644 --- a/frameworks/Kotlin/hexagon/build.gradle +++ b/frameworks/Kotlin/hexagon/build.gradle @@ -9,9 +9,9 @@ description = "TFB benchmark" group = "com.hexagontk" ext { - hexagonVersion = "4.0.0-B4" + hexagonVersion = "4.0.1" jettyVersion = "12.0.16" - nettyVersion = "4.1.117.Final" + nettyVersion = "4.1.118.Final" hikariVersion = "6.2.1" postgresqlVersion = "42.7.5"