Prereview of "Revamp the ktor-exposed portion and add new variant benchmarks with R2DBC"#5
Prereview of "Revamp the ktor-exposed portion and add new variant benchmarks with R2DBC"#5
ktor-exposed portion and add new variant benchmarks with R2DBC"#5Conversation
…fortunes` test instead, as in the `vertx-web-kotlinx` portion Since this test is imperative we don't need to write it the functional way, and we also save some `Sequence` transformations which should reduce some overhead.
… separation of concerns
…BC with the new interface `ExposedOps`
…r-exposed-revamp-dec-2025
Copy the JDBC configs from the `ktor` portion again and comment about it BTW.
As run on my device, "Requests/sec" results of the `db` and `json` tests of the `ktor` portion are improved greatly.
Summary of ChangesHello @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 undertakes a comprehensive revamp of the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request is a significant and well-executed revamp of the ktor-exposed benchmarks. The migration to Exposed v1, addition of R2DBC support, and major code restructuring are excellent improvements. The code is now much more modular and easier to understand. I've identified a critical issue with the Docker configuration that will prevent the new benchmarks from building, and another critical performance issue where blocking JDBC calls could starve the Ktor event loop. I've also included some high-severity suggestions to improve performance by introducing concurrency for database queries, and a medium-severity suggestion to improve code clarity. Overall, great work on this complex refactoring.
There was a problem hiding this comment.
Pull request overview
This PR is a major refactoring of the ktor-exposed benchmark portion, migrating from Exposed v0 to v1 APIs, adding R2DBC support alongside JDBC, and updating all dependencies and toolchains to the latest versions. The changes also include switching from G1GC to ParallelGC for improved performance, restructuring the code for better abstraction using a repository pattern, and creating separate benchmark variants for JDBC/R2DBC with DSL/DAO modes.
Key changes:
- Migration to Exposed v1 APIs with separate JDBC and R2DBC support
- Dependency and toolchain updates (Kotlin, Gradle, JDK, and libraries)
- Code restructuring with repository pattern for better separation of concerns
- Addition of new R2DBC benchmark variant configurations
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ktor.dockerfile | Updated JVM GC flag from G1GC to ParallelGC |
| ktor-r2dbc.dockerfile | Updated JVM GC flag from G1GC to ParallelGC |
| ktor-exposed/gradlew.bat | Updated Gradle wrapper script to newer version |
| ktor-exposed/gradlew | Updated Gradle wrapper script to newer version |
| ktor-exposed/gradle/wrapper/gradle-wrapper.properties | Upgraded Gradle version with validation |
| ktor-exposed/gradle/wrapper/gradle-wrapper.jar | Updated Gradle wrapper JAR binary |
| ktor-exposed/app/src/main/kotlin/database/R2dbc.kt | New R2DBC connection configuration |
| ktor-exposed/app/src/main/kotlin/database/Jdbc.kt | Extracted JDBC configuration |
| ktor-exposed/app/src/main/kotlin/database/Exposed.kt | Extracted Exposed table definitions and mapping functions |
| ktor-exposed/app/src/main/kotlin/Models.kt | Extracted data model classes |
| ktor-exposed/app/src/main/kotlin/Json.kt | Extracted JSON configuration |
| ktor-exposed/app/src/main/kotlin/App.kt | Refactored with repository pattern supporting both JDBC and R2DBC modes |
| ktor-exposed/app/build.gradle.kts | Updated dependencies, toolchain, and plugin versions |
| ktor-exposed-r2dbc-dsl.dockerfile | New dockerfile for R2DBC DSL variant |
| ktor-exposed-jdbc-dsl.dockerfile | New dockerfile for JDBC DSL variant |
| ktor-exposed-jdbc-dao.dockerfile | Updated dockerfile with new command arguments |
| ktor-exposed-dsl.dockerfile | Removed legacy dockerfile |
| benchmark_config.json | Updated benchmark configurations with new variant names |
Comments suppressed due to low confidence (2)
frameworks/Kotlin/ktor/ktor-exposed-jdbc-dao.dockerfile:1
- The Docker base image "gradle:jdk25" does not exist. The Gradle Docker images use JDK versions that are actually released. As of the current date, there is no JDK 25. This should be changed to a valid image such as "gradle:jdk21" or "gradle:jdk23".
frameworks/Kotlin/ktor/ktor-exposed-jdbc-dao.dockerfile:8 - The exposed port is inconsistent. The port is set to 8080 in the EXPOSE directive but the application is configured to start on port 9090 in the main function. These should match to avoid confusion and potential connection issues.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…sist points out that it can be confusing
e8e9e21 to
6456fc1
Compare
… pool exhaustion."
Major changes:
dbandjsontests of thektorportion are improved greatly.Misc changes:
mapToin thefortunestest instead to slightly improve some performance, as in thevertx-web-kotlinxportion.Jsonconfiguration from thektorportion.8080s with9090.