Skip to content

perf(scheduler): atomically cache scheduler capabilities#115

Merged
Arbousier1 merged 1 commit into
devfrom
codex/perf-scheduler-capability-cache-v2
Jul 19, 2026
Merged

perf(scheduler): atomically cache scheduler capabilities#115
Arbousier1 merged 1 commit into
devfrom
codex/perf-scheduler-capability-cache-v2

Conversation

@Arbousier1

Copy link
Copy Markdown
Collaborator

Summary

  • supersede perf(scheduler): cache scheduler-capability lookups by target identity #108 with one immutable volatile capability entry per global, region, and entity scheduler cache
  • retain identity-based hits and Paper null-capability negative caching while preventing a target from being paired with another target's scheduler under concurrency
  • cover cache hits, negative caching, identity invalidation, and concurrent entity routing

Performance

Using the unchanged protected ServerSchedulerReflectionBenchmark locally on JDK 25:

  • Folia: 23.889 ns/op -> 13.729 ns/op (about 42.5% faster)
  • Paper: 19.857 ns/op -> 5.192 ns/op (about 73.9% faster)
  • normalized allocation: Folia 67.429 -> 16.004 B/op; Paper 19.810 -> 16.000 B/op

The base-owned eight-shard scheduler-reflection gate remains authoritative.

Test plan

  • ./gradlew test --tests top.ellan.mahjong.runtime.ServerSchedulerReflectionCacheTest spotlessCheck -PmahjongJavaToolchain=25 -PmahjongJavaTarget=25
  • ./gradlew check assemble -PmahjongJavaToolchain=25 -PmahjongJavaTarget=25
  • build base and candidate JMH jars with Java target 17 and run the protected scheduler benchmark unchanged
  • base-owned GitHub performance A/B gate reports PASS_OPTIMIZED

Reuse scheduler capability lookups without allowing concurrent readers to pair one target with another target's scheduler.
@Arbousier1 Arbousier1 added performance-ab Run the base-owned paired performance gate performance-scheduler-reflection Use the scheduler reflection performance profile labels Jul 19, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Arbousier1
Arbousier1 merged commit 4dab96b into dev Jul 19, 2026
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance-ab Run the base-owned paired performance gate performance-scheduler-reflection Use the scheduler reflection performance profile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant