Skip to content

perf(render): reuse the viewer membership buffer#84

Merged
TypeThe0ry merged 1 commit into
devfrom
codex/perf-snapshot-membership-buffer-v2
Jul 16, 2026
Merged

perf(render): reuse the viewer membership buffer#84
TypeThe0ry merged 1 commit into
devfrom
codex/perf-snapshot-membership-buffer-v2

Conversation

@TypeThe0ry

Copy link
Copy Markdown
Member

Summary

  • build the sorted viewer-membership buffer once per render snapshot
  • reuse that buffer by temporarily removing and restoring one seated viewer UUID
  • replace the online-viewer set with a UUID-to-existing-serialized-viewer index for fast membership checks without duplicating serialized values
  • preserve exact ordering, empty-seat, offline-seat, duplicate-seat, and immutable exclusion-list behavior
  • keep the change isolated to one production file

Measurement

The protected performance-snapshot JMH profile is authoritative at 4, 32, and 128 viewers. This PR must remain unmerged unless GitHub reports PASS_OPTIMIZED, including the required 128-viewer time metric.

Validation

No Gradle, JMH, tests, server, or client workload was run locally. Exact snapshot behavior tests, all platform builds, and performance measurement are GitHub-only.

@TypeThe0ry TypeThe0ry added performance-ab Run the base-owned paired performance gate performance-snapshot Use the viewer snapshot performance profile labels Jul 16, 2026 — with ChatGPT Codex Connector
@Arbousier1
Arbousier1 force-pushed the codex/perf-snapshot-membership-buffer-v2 branch from cb755e3 to cf33b9e Compare July 16, 2026 11:32

Copy link
Copy Markdown
Member Author

Rebased onto post-#80 dev (cba64e8653d6f597e848ccbb7bf92d84bd3c5f13). New immutable head: cf33b9e75fed7d6af077fddf224b5a452848bcb1. The earlier run is superseded; exact snapshot behavior and the protected 4/32/128-viewer A/B profile will rerun on this head.

@TypeThe0ry
TypeThe0ry marked this pull request as ready for review July 16, 2026 11:43
@TypeThe0ry
TypeThe0ry merged commit db0a5e2 into dev Jul 16, 2026
12 of 14 checks passed

Copy link
Copy Markdown
Member Author

Post-merge isolated A/B against 0ebc5fc5242541dc18439b570c84dcce4d061f14 completed in run https://github.com/EllanServer/MahjongEngine/actions/runs/29495681881. The protected decision is FAIL_REGRESSION_OR_BEHAVIOR. Revert PR #88 removes exactly merge commit db0a5e2efb27b438afbe215ea885fab31f3b4f73 while retaining the other merged performance changes.

@Arbousier1
Arbousier1 deleted the codex/perf-snapshot-membership-buffer-v2 branch July 16, 2026 16:56
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-snapshot Use the viewer snapshot performance profile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants