-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,161 additions
and
370 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import rsocketbuild.* | ||
|
||
plugins { | ||
id("rsocketbuild.multiplatform-base") | ||
alias(libs.plugins.kotlin.plugin.allopen) | ||
alias(libs.plugins.kotlinx.benchmark) | ||
} | ||
|
||
kotlin { | ||
jvmTarget() | ||
|
||
sourceSets { | ||
jvmMain.dependencies { | ||
implementation(projects.benchmarksShared) | ||
|
||
implementation(libs.kotlinx.coroutines.reactor) | ||
implementation(libs.rsocket.java.transport.local) | ||
implementation(libs.rsocket.java.transport.netty) | ||
} | ||
} | ||
} | ||
|
||
allOpen { | ||
annotation("org.openjdk.jmh.annotations.State") | ||
} | ||
|
||
benchmark { | ||
targets { | ||
register("jvm") { | ||
this as kotlinx.benchmark.gradle.JvmBenchmarkTarget | ||
jmhVersion = libs.versions.jmh.get() | ||
} | ||
} | ||
configurations { | ||
configureEach { | ||
reportFormat = "text" | ||
} | ||
named("main") { | ||
// all params | ||
param("payloadSize", "0", "64", "1024", "131072", "1048576") | ||
} | ||
register("localPayloadSize") { | ||
include("LocalRSocketJavaBenchmark") | ||
param("payloadSize", "0", "64") | ||
} | ||
register("tcpPayloadSize") { | ||
include("TcpRSocketJavaBenchmark") | ||
param("payloadSize", "0", "64") | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
benchmarks/rsocket-java/src/jvmMain/kotlin/LocalRSocketJavaBenchmark.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.rsocket.kotlin.benchmarks.java | ||
|
||
import io.rsocket.transport.* | ||
import io.rsocket.transport.local.* | ||
import kotlinx.benchmark.* | ||
import kotlinx.coroutines.* | ||
import kotlinx.coroutines.channels.* | ||
|
||
@BenchmarkMode(Mode.Throughput) | ||
@Warmup(iterations = 3, time = 1) | ||
@Measurement(iterations = 3, time = 1) | ||
@State(Scope.Benchmark) | ||
class LocalRSocketJavaBenchmark : RSocketJavaBenchmark() { | ||
@Param("0") | ||
override var payloadSize: Int = 0 | ||
|
||
override val serverTransport: ServerTransport<*> = LocalServerTransport.create("local") | ||
override val clientTransport: ClientTransport = LocalClientTransport.create("local") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
benchmarks/rsocket-java/src/jvmMain/kotlin/TcpRSocketJavaBenchmark.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.rsocket.kotlin.benchmarks.java | ||
|
||
import io.rsocket.transport.* | ||
import io.rsocket.transport.local.* | ||
import io.rsocket.transport.netty.client.* | ||
import io.rsocket.transport.netty.server.* | ||
import kotlinx.benchmark.* | ||
import kotlinx.coroutines.* | ||
import kotlinx.coroutines.channels.* | ||
|
||
@BenchmarkMode(Mode.Throughput) | ||
@Warmup(iterations = 3, time = 1) | ||
@Measurement(iterations = 3, time = 1) | ||
@State(Scope.Benchmark) | ||
class TcpRSocketJavaBenchmark : RSocketJavaBenchmark() { | ||
@Param("0") | ||
override var payloadSize: Int = 0 | ||
|
||
override val serverTransport: ServerTransport<*> = TcpServerTransport.create(9000) | ||
override val clientTransport: ClientTransport = TcpClientTransport.create(9000) | ||
} |
Oops, something went wrong.