Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Dec 1, 2024
1 parent f0a246a commit b8d72d1
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 10 deletions.
21 changes: 18 additions & 3 deletions benchmarks/rsocket-java/src/jvmMain/kotlin/RSocketJavaBenchmark.kt
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,27 @@ abstract class RSocketJavaBenchmark : RSocketBenchmark<Payload, Blackhole>() {
server.dispose()
}

// @Benchmark
// override fun requestResponseBlocking(bh: Blackhole) = super.requestResponseBlocking(bh)
//
// @Benchmark
// override fun requestResponseParallel(bh: Blackhole) = super.requestResponseParallel(bh)
//
// @Benchmark
// override fun requestResponseConcurrent(bh: Blackhole) = super.requestResponseConcurrent(bh)

@Benchmark
override fun requestResponseBlocking(bh: Blackhole) = super.requestResponseBlocking(bh)
override fun requestStreamBlocking(bh: Blackhole) {
super.requestStreamBlocking(bh)
}

@Benchmark
override fun requestResponseParallel(bh: Blackhole) = super.requestResponseParallel(bh)
override fun requestStreamParallel(bh: Blackhole) {
super.requestStreamParallel(bh)
}

@Benchmark
override fun requestResponseConcurrent(bh: Blackhole) = super.requestResponseConcurrent(bh)
override fun requestStreamConcurrent(bh: Blackhole) {
super.requestStreamConcurrent(bh)
}
}
2 changes: 1 addition & 1 deletion benchmarks/rsocket-kotlin-old/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ benchmark {
}

configuration("RSocketKotlinOld", "KtorTcp", "text") {
param("payloadSize", "0", "64", "8192")
param("payloadSize", "0", "64", "4096")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,28 @@ abstract class RSocketKotlinOldBenchmark : RSocketBenchmark<Payload, Blackhole>(
benchJob.cancelAndJoin()
}

// @Benchmark
// override fun requestResponseBlocking(bh: Blackhole) = super.requestResponseBlocking(bh)
//
// @Benchmark
// override fun requestResponseParallel(bh: Blackhole) = super.requestResponseParallel(bh)
//
// @Benchmark
// override fun requestResponseConcurrent(bh: Blackhole) = super.requestResponseConcurrent(bh)


@Benchmark
override fun requestResponseBlocking(bh: Blackhole) = super.requestResponseBlocking(bh)
override fun requestStreamBlocking(bh: Blackhole) {
super.requestStreamBlocking(bh)
}

@Benchmark
override fun requestResponseParallel(bh: Blackhole) = super.requestResponseParallel(bh)
override fun requestStreamParallel(bh: Blackhole) {
super.requestStreamParallel(bh)
}

@Benchmark
override fun requestResponseConcurrent(bh: Blackhole) = super.requestResponseConcurrent(bh)
override fun requestStreamConcurrent(bh: Blackhole) {
super.requestStreamConcurrent(bh)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,28 @@ abstract class RSocketKotlinBenchmark : RSocketBenchmark<Payload, Blackhole>() {
benchJob.cancelAndJoin()
}

// @Benchmark
// override fun requestResponseBlocking(bh: Blackhole) = super.requestResponseBlocking(bh)
//
// @Benchmark
// override fun requestResponseParallel(bh: Blackhole) = super.requestResponseParallel(bh)
//
// @Benchmark
// override fun requestResponseConcurrent(bh: Blackhole) = super.requestResponseConcurrent(bh)


@Benchmark
override fun requestResponseBlocking(bh: Blackhole) = super.requestResponseBlocking(bh)
override fun requestStreamBlocking(bh: Blackhole) {
super.requestStreamBlocking(bh)
}

@Benchmark
override fun requestResponseParallel(bh: Blackhole) = super.requestResponseParallel(bh)
override fun requestStreamParallel(bh: Blackhole) {
super.requestStreamParallel(bh)
}

@Benchmark
override fun requestResponseConcurrent(bh: Blackhole) = super.requestResponseConcurrent(bh)
override fun requestStreamConcurrent(bh: Blackhole) {
super.requestStreamConcurrent(bh)
}
}
7 changes: 7 additions & 0 deletions benchmarks/shared/src/commonMain/kotlin/RSocketBenchmark.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ abstract class RSocketBenchmark<Payload : Any, Blackhole : Any> {
open fun requestResponseParallel(bh: Blackhole) = parallel(bh, 1000, ::requestResponse)
open fun requestResponseConcurrent(bh: Blackhole) = concurrent(bh, 1000, ::requestResponse)

open fun requestStreamBlocking(bh: Blackhole) = blocking(bh, 100, ::requestStream)
open fun requestStreamParallel(bh: Blackhole) = parallel(bh, 100, ::requestStream)
open fun requestStreamConcurrent(bh: Blackhole) = concurrent(bh, 100, ::requestStream)

open fun requestChannelBlocking(bh: Blackhole) = blocking(bh, 10, ::requestChannel)
open fun requestChannelParallel(bh: Blackhole) = parallel(bh, 10, ::requestChannel)
open fun requestChannelConcurrent(bh: Blackhole) = concurrent(bh, 10, ::requestChannel)

// operations

Expand Down

0 comments on commit b8d72d1

Please sign in to comment.