Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/org/kotlin/community/http/benchmarks/Benchmarks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.kotlin.community.http.benchmarks.ninjaframework.*
import org.kotlin.community.http.benchmarks.rapidoid.*
import org.kotlin.community.http.benchmarks.spark.*
import org.kotlin.community.http.benchmarks.undertow.*
import org.kotlin.community.http.benchmarks.vertx.*

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Does it build with these import changes?

import org.kotlin.community.http.benchmarks.vertxweb.*

fun main(args: Array<String>) {
benchmark(args) {
Expand Down Expand Up @@ -48,6 +48,7 @@ private fun BenchmarkSettings.setup() {
run<SparkBenchmark>()
run<UndertowBenchmark>()
run<VertxBenchmark>()
run<VertxWebBenchmark>()
run<RapidoidBenchmark>()
}

11 changes: 2 additions & 9 deletions src/org/kotlin/community/http/benchmarks/vertx/VertxBenchmark.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@ fun main(args: Array<String>) {
open class VertxBenchmark : HttpBenchmarkBase() {
val vertx = Vertx.vertx()
override fun startServer(port: Int) {
val router = Router.router(vertx).apply {
get("/").handler { request ->
request.response().putHeader("content-type", "text/plain").end("Hello")
}
//get().handler(StaticHandler.create("public"))
}

val f = CompletableFuture<Unit>()
vertx.createHttpServer().requestHandler {
router.accept(it)
vertx.createHttpServer().requestHandler { request ->
request.response().putHeader("content-type", "text/plain").end("Hello")
}.listen(port) {
f.complete(Unit)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.kotlin.community.http.benchmarks.vertxweb

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could you please avoid creating folders for each variant? E.g. for ktor netty & jetty it's a single folder.


import io.vertx.core.*
import io.vertx.ext.web.*
import org.kotlin.community.http.benchmarks.*
import java.util.concurrent.*

fun main(args: Array<String>) {
benchmark(args) {
run<VertxWebBenchmark>()
}
}

open class VertxWebBenchmark : HttpBenchmarkBase() {
val vertx = Vertx.vertx()
override fun startServer(port: Int) {
val router = Router.router(vertx).apply {
get("/").handler { request ->
request.response().putHeader("content-type", "text/plain").end("Hello")
}
//get().handler(StaticHandler.create("public"))
}

val f = CompletableFuture<Unit>()
vertx.createHttpServer().requestHandler {
router.accept(it)
}.listen(port) {
f.complete(Unit)
}
f.join()
}

override fun stopServer() {
vertx.close()
}
}