java-topology/tools/mc-bench/README.md
russell@unturf.com db29a08762 undefect. CWE-407 — 92 sites, 42 ecosystems
B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections.
Squash of 94 local commits onto remote master.
2026-03-26 19:48:18 -04:00

40 lines
1.3 KiB
Markdown

# mc-bench — Minecraft Server Load Benchmark
Benchmarks vanilla vs patched Minecraft server-26.1 under simulated load.
## Setup
```bash
# JDK 25 required
JAVA=/tmp/jdk25/bin/java
# Server jar (bundler)
SERVER_JAR=/home/fox/Downloads/server.jar
# Install both servers
bash bench-server.sh vanilla 40
bash bench-server.sh patched 40
```
## Tools
| File | Purpose |
|------|---------|
| `bench-server.sh` | Full benchmark: startup + `/reload` + bot wave |
| `gen-modpack-tags.py` | Generates synthetic depth-N diamond tag data |
| `raw-connect.mjs` | Raw TCP handshake bot (version-agnostic) |
| `sim-players.mjs` | mineflayer bot runner (requires matching protocol version) |
| `rcon.py` | RCON command injection |
## What it measures
- **Startup time** (wall clock, JVM launch → "Done")
- **/reload time** (RCON-triggered, measures tag reload)
- **Connection capacity** (how many handshakes the server accepts simultaneously)
- **Handshake latency** (p50/p95/max)
## Notes
- Real-world improvement requires a genuine modpack with tag depth ≥ 10.
- Synthetic tag data uses HashMap iteration (hash-ordered), which may not trigger
worst-case DFS. Real modpacks load tags alphabetically (base before root) which
reliably triggers the exponential in vanilla.
- See `tests/bench/LoadSimBenchmark.java` for controlled algorithmic benchmark.