From b963a6b549c826c535f4255d19b4ce37e38fa41a Mon Sep 17 00:00:00 2001 From: Shreck Ye Date: Tue, 19 Nov 2024 10:17:06 +0800 Subject: [PATCH] Enable `isPipelined` and the performance is on par with the original --- .../Kotlin/vertx-web-kotlinx/src/main/kotlin/MainVerticle.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/MainVerticle.kt b/frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/MainVerticle.kt index a2701922d06..cc9ec3caf46 100644 --- a/frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/MainVerticle.kt +++ b/frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/MainVerticle.kt @@ -13,6 +13,7 @@ import io.vertx.kotlin.coroutines.CoroutineVerticle import io.vertx.kotlin.coroutines.coAwait import io.vertx.kotlin.pgclient.pgConnectOptionsOf import io.vertx.pgclient.PgBuilder +import io.vertx.pgclient.impl.PgPoolOptions import io.vertx.sqlclient.* import kotlinx.coroutines.Dispatchers import kotlinx.html.* @@ -57,6 +58,9 @@ class MainVerticle(val hasDb: Boolean) : CoroutineVerticle(), CoroutineRouterSup pipeliningLimit = 100000 ) ) + .with(PgPoolOptions().apply { + isPipelined = true + }) .build() selectWorldQuery = pool.preparedQuery(SELECT_WORLD_SQL)