Files
layue13andClaude Opus 5.5 1decc44081 perf(client-mod): candidate WebSocket codec, codecBenchmark and decision rule
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>
2026-10-23 16:29:46 +08:00

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(" ")
}
}