mirror of
https://github.com/layue13/MoonBridge.git
synced 2026-10-25 18:46:18 +00:00
TCP_NODELAY on ws/wss; ClientFrameEncoder (one message per batch) and ClientFrameDecoder (retained slices) with tests. The decision rule is recorded before the measured runs; the verdict follows in a later commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.1 KiB
Groovy
25 lines
1.1 KiB
Groovy
// Plain JUnit 5 tests for the Minecraft-free networking code (dev.moonbridge.clientws.net).
|
|
tasks.named("test", Test) {
|
|
useJUnitPlatform()
|
|
// Netty 4.0.10 only logs leaks; paranoid mode makes every leaked buffer show up in the test output.
|
|
systemProperty "io.netty.leakDetectionLevel", "paranoid"
|
|
testLogging {
|
|
events "failed"
|
|
exceptionFormat "full"
|
|
}
|
|
}
|
|
|
|
// Client WebSocket codec microbenchmark (test sources, never packaged). See
|
|
// testing/benchmarks/results/2026-10-23-client-websocket-codec.md. Example:
|
|
// ./gradlew codecBenchmark -PbenchArgs="--variant candidate --repeats 3"
|
|
tasks.register("codecBenchmark", JavaExec) {
|
|
description = "Runs the client WebSocket codec microbenchmark (Netty 4.0.10 codec vs ClientFrameEncoder/Decoder)."
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
mainClass = "dev.moonbridge.clientws.net.CodecBenchmark"
|
|
javaLauncher = tasks.named("test", Test).flatMap { it.javaLauncher }
|
|
jvmArgs "-Xms1g", "-Xmx1g", "-Dio.netty.leakDetectionLevel=disabled"
|
|
if (project.hasProperty("benchArgs")) {
|
|
args project.property("benchArgs").toString().split(" ")
|
|
}
|
|
}
|