Skip to content

Commit 30e2386

Browse files
authored
perf: benchmark scheduler reflection dispatch (#71)
Add a protected GitHub-only JMH workload for Folia-style reflective scheduler dispatch and Paper fallback paths.
1 parent 078b251 commit 30e2386

5 files changed

Lines changed: 371 additions & 0 deletions

File tree

.github/workflows/ensure-labels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
{ name: "performance-region-fingerprint", color: "bfdadc", description: "Use the table region fingerprint performance profile" },
2929
{ name: "performance-display-spawn", color: "bfdadc", description: "Use the display entity spawn performance profile" },
3030
{ name: "performance-region-queue", color: "bfdadc", description: "Use the region update queue performance profile" },
31+
{ name: "performance-scheduler-reflection", color: "bfdadc", description: "Use the scheduler reflection performance profile" },
3132
{ name: "performance-ray-proxy", color: "bfdadc", description: "Use the client ray-proxy performance profile" }
3233
];
3334

.github/workflows/performance-ab.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ on:
3636
- region-fingerprint
3737
- display-spawn
3838
- region-queue
39+
- scheduler-reflection
3940
- ray-proxy
4041
- infra
4142
forks:
@@ -163,6 +164,7 @@ jobs:
163164
"performance-region-fingerprint": "region-fingerprint",
164165
"performance-display-spawn": "display-spawn",
165166
"performance-region-queue": "region-queue",
167+
"performance-scheduler-reflection": "scheduler-reflection",
166168
"performance-ray-proxy": "ray-proxy",
167169
}
168170
selected = [profile for label, profile in choices.items() if label in labels]

docs/performance-testing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ and exactly one profile label to a pure performance PR:
5555
- `performance-region-fingerprint` - a real started-table snapshot and layout, measuring the
5656
complete region map plus a batch of private/public hands, discards, melds and all 136 wall
5757
slots;
58+
- `performance-scheduler-reflection` - representative global, region and entity scheduling
59+
bursts through both Folia-style reflective capabilities and standard Paper fallbacks;
5860
- `performance-ray-proxy` - 1, 4 and 32-viewer coordinator lifecycle and unchanged-geometry
5961
reuse. This CPU/allocation profile does not measure protocol bytes or client hit coverage.
6062

perf/ab/gate-config.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,23 @@
138138
"top/ellan/mahjong/table/render/TableRegionDisplayCoordinator.class"
139139
]
140140
},
141+
"scheduler-reflection": {
142+
"include": "^top\\.ellan\\.mahjong\\.perf\\.ServerSchedulerReflectionBenchmark\\.schedule(?:Folia|Paper)Burst$",
143+
"benchmark_ids": [
144+
"scheduler.folia.time",
145+
"scheduler.folia.alloc",
146+
"scheduler.paper.time",
147+
"scheduler.paper.alloc"
148+
],
149+
"minimum_passes": 2,
150+
"must_pass": [
151+
"scheduler.folia.time",
152+
"scheduler.paper.time"
153+
],
154+
"required_classes": [
155+
"top/ellan/mahjong/runtime/ServerScheduler.class"
156+
]
157+
},
141158
"ray-proxy": {
142159
"include": "^top\\.ellan\\.mahjong\\.perf\\.RayProxyCoordinatorBenchmark\\.proxyPlan(?:1Viewer|4Viewers|32Viewers)$",
143160
"benchmark_ids": [
@@ -291,6 +308,30 @@
291308
"metric": "gc.alloc.rate.norm",
292309
"direction": "lower"
293310
},
311+
{
312+
"id": "scheduler.folia.time",
313+
"benchmark": "top.ellan.mahjong.perf.ServerSchedulerReflectionBenchmark.scheduleFoliaBurst",
314+
"metric": "primary",
315+
"direction": "lower"
316+
},
317+
{
318+
"id": "scheduler.folia.alloc",
319+
"benchmark": "top.ellan.mahjong.perf.ServerSchedulerReflectionBenchmark.scheduleFoliaBurst",
320+
"metric": "gc.alloc.rate.norm",
321+
"direction": "lower"
322+
},
323+
{
324+
"id": "scheduler.paper.time",
325+
"benchmark": "top.ellan.mahjong.perf.ServerSchedulerReflectionBenchmark.schedulePaperBurst",
326+
"metric": "primary",
327+
"direction": "lower"
328+
},
329+
{
330+
"id": "scheduler.paper.alloc",
331+
"benchmark": "top.ellan.mahjong.perf.ServerSchedulerReflectionBenchmark.schedulePaperBurst",
332+
"metric": "gc.alloc.rate.norm",
333+
"direction": "lower"
334+
},
294335
{
295336
"id": "ray.viewers1.time",
296337
"benchmark": "top.ellan.mahjong.perf.RayProxyCoordinatorBenchmark.proxyPlan1Viewer",

0 commit comments

Comments
 (0)