Skip to content

Prereview of "Revamp the vertx-web-kotlinx benchmark, splitting code into different modules and adding new benchmark portions for the Expesed Vert.x SQL Client along with R2DBC and Exposed R2DBC as comparisons"#15

Closed
ShreckYe wants to merge 67 commits intomasterfrom
vertx-web-kotlinx-exposed
Closed

Prereview of "Revamp the vertx-web-kotlinx benchmark, splitting code into different modules and adding new benchmark portions for the Expesed Vert.x SQL Client along with R2DBC and Exposed R2DBC as comparisons"#15
ShreckYe wants to merge 67 commits intomasterfrom
vertx-web-kotlinx-exposed

Conversation

@ShreckYe
Copy link
Copy Markdown
Member

This PR adds a benchmark portion for the Exposed Vert.x SQL Client library as a replacement for the default Vert.x SQL client as the database backend in the vertx-web-kotlinx benchmark portion. Other database backends including R2DBC and Exposed R2DBC are added BTW for comparison. Common code is extracted and split into different modules to avoid downloading unnecessary dependencies when benchmarking a certain portion.

Got `java.lang.IllegalStateException: Field offsetHours is not set`.
See commit 9cf28f1 for a failed attempt to try using kotlinx-datetime.
…s/Java/vertx/` from commit 057c25b to commit 1838aa5, and fix some typos

Some changes are not ported.

There is about 5% performance improvement in the JSON test as tested on my device.
…mprove the plaintext test performance

```
io.netty.channel.uring.IoUringIoHandler processCompletionsAndHandleOverflow
vertx: WARNING: CompletionQueue overflow detected, consider increasing size: 4096
```

This is still one warning when the value is set to 8192 as tested on my device, instead of many for the default 4096.
…and fix capitalization BTW

The "Requests/sec" result of Approach 1 is only 40% of Approach 3 as tested on my device.
…ng it and also catch Java NIO `SocketException` for developing on other OSs such as macOS and Windows

Tested with the `tfb` command on both macOS and Linux.
…Kotlin/ktor/ktor-exposed`

The following exception occurs when running the benchmark:

```
org.postgresql.util.PSQLException: Transaction isolation level 0 not supported.
```
… not supported.` with huanshankeji/exposed-vertx-sql-client@bb69856 published to Maven local, and fix some remaining issues in the benchmark code debugging with `tfb`

Here are some results with max parameters (threads, connections, number of queries) of interest as benchmarked on my device. The "single query" result is only 65% of that of `vertx-web-kotlinx`, which is not ideal. The "updates" result exceeds that of `vertx-web-kotlinx` by about 10%-15%, which needs to be looked into further. Setting `validateBatch = false` does not make noticeable difference.
PostgreSQL table names are case-insensitive.
…rWowRandom` `Random` instance every `Verticle
…client` to more explicitly compare with the `vertx-web-kotlinx` portion
Tests without the database are not needed here in this portion.
…t into the `vertx-web-kotlinx` portion and update the project structure

Changes:
* Split the project into multiple modules/subprojects.
* Update the project structure following a new project generated with `gradle init`.
* Partially adapt to Gradle version catalog (putting only the versions).
* Bump Kotlin to 2.3.0 which is just released BTW.

Common code is not extracted yet.
ShreckYe and others added 19 commits December 20, 2025 15:25
…match parameters in SQL statement` in the `r2dbc` `updates` test with Copilot
…ion: [08006] Cannot exchange messages because the request queue limit is exceeded` alternatively by not using pipelining
This doesn't fix the `r2dbc` `update` failure though.
…run the test several times to determine the optimal pool size
…dbc`, refactoring `CommonWithDbVerticle` to support optional transactions
…postgresql` `db` test several times with different (original and reverted) code before and after abstraction (introducing abstract classes and interfaces), Kotlin and Vert.x versions, and kotlinx-serialization `Json` configurations to investigate possible performance regressions

Results show no noticeable performance regressions. I first noticed some in the `db` test but they appear to be just measurement errors. The optimized `Json` improves the `json` test throughput with max parameters by about 5% as tested on my device but there is no noticeable difference in the `db` test.
…ose corresponding test fails"

This reverts commit 3f1e03e.

The wrong `update_url` was removed.
… Result publishers (#7)

* Initial plan

* Fix updateSortedWorlds to properly consume R2DBC batch update results

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @ShreckYe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the vertx-web-kotlinx benchmark suite by integrating new database backends, including the Exposed Vert.x SQL Client, R2DBC, and Exposed R2DBC. The project's architecture has been revamped into a modular Gradle setup, separating concerns into common, without-db, and with-db subprojects. This refactoring improves the organization of the codebase, centralizes dependency management, and allows for more efficient benchmarking of individual components without unnecessary dependencies.

Highlights

  • Expanded Benchmarking Coverage: Introduced new benchmark portions for 'Exposed Vert.x SQL Client', 'R2DBC', and 'Exposed R2DBC' to provide broader performance comparisons within the vertx-web-kotlinx suite.
  • Modular Project Structure: Refactored the vertx-web-kotlinx benchmark into a multi-module Gradle project, extracting common code into shared modules to optimize dependency management and build processes.
  • Centralized Dependency Management: Implemented Gradle Version Catalogs (libs.versions.toml) and convention plugins (buildSrc) to streamline dependency declarations and enforce consistent build configurations across all new and existing modules.
  • Codebase Refactoring for Reusability: Extracted core server logic into CommonMain.kt and CommonVerticle.kt, and database interaction patterns into CommonWithDbVerticle.kt, enhancing code reusability and maintainability for different benchmark implementations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR revamps the vertx-web-kotlinx benchmark by splitting the codebase into multiple modules and adding new database backend implementations. The refactoring extracts common code to avoid unnecessary dependencies when benchmarking specific portions, while adding support for Exposed Vert.x SQL Client, R2DBC, and Exposed R2DBC as database backend options for performance comparison.

Changes:

  • Split the monolithic benchmark into modular structure with separate modules for common code, without-db, and with-db variants
  • Added three new database backend implementations: R2DBC, Exposed R2DBC, and Exposed Vert.x SQL Client
  • Created separate Dockerfiles for each benchmark variant with optimized dependency copying
  • Restructured build configuration using buildSrc conventions and version catalogs

Reviewed changes

Copilot reviewed 53 out of 56 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
common/* Extracts shared verticle logic, HTTP handlers, serialization, and utility functions
without-db/default/* JSON and plaintext endpoint implementations without database dependencies
with-db/common/* Shared database verticle abstractions and SQL constants
with-db/default/* Default Vert.x SQL client implementation using PgConnection
with-db/r2dbc/* R2DBC PostgreSQL driver implementation
with-db/exposed-r2dbc/* Exposed R2DBC integration for comparison
with-db/exposed-vertx-sql-client/* Exposed Vert.x SQL Client integration as the featured implementation
with-db/r2dbc-common/* R2DBC connection factory configuration shared across R2DBC implementations
with-db/exposed-common/* Exposed table definitions and query helpers shared across Exposed implementations
buildSrc/* Gradle convention plugins for consistent build configuration
gradle/libs.versions.toml Centralized dependency version catalog
*.dockerfile Separate Dockerfiles for each benchmark variant with optimized builds
benchmark_config.json Benchmark test configurations for all new variants
settings.gradle.kts Multi-module project structure definition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive pull request that significantly revamps the vertx-web-kotlinx benchmark. The modularization of the project into separate Gradle submodules is a great improvement for maintainability and clarity. The introduction of convention plugins and a TOML version catalog aligns the project with modern Gradle best practices. The new benchmark implementations for R2DBC, Exposed R2DBC, and Exposed Vert.x SQL Client are well-structured and provide valuable comparisons.

I've found a few minor issues that I've detailed in the comments, mostly related to configuration and code style, but overall this is a high-quality contribution.

Comment thread frameworks/Kotlin/vertx-web-kotlinx/benchmark_config.json Outdated
@ShreckYe ShreckYe closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants