Skip to content

refactor: reduce client allocation and defer protocol catalog loading - #9

Merged
milutinke merged 3 commits into
masterfrom
refactor/client-memory
Oct 11, 2026
Merged

milutinke merged 3 commits into
masterfrom
refactor/client-memory

Conversation

@milutinke

@milutinke milutinke commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

What changed?

Reduce packet allocation by caching immutable session capabilities, indexing applier dispatch, and avoiding border/brand closures on unrelated packets. Generate protocol lookup switches so requesting one version initializes only that descriptor. Cache sound lookup data and extract buffered frames before allocating timeout resources. Bump UMPK to 0.9.0-beta.7 with a changelog entry and matching installation examples.

Versions affected

Shared client paths; catalog lookup tests cover all 50 datasets (47–777). Live validation covers 26.2 / 776 and 26.3 / 777. Wire layouts and public APIs are unchanged.

Evidence

Five alternating pairs per workload, 60 seconds measured. Player traffic includes seeded movement, unsigned chat, drops and pickups into one observer; these are nearby entities, not independent connections. RAM is whole-client RSS in decimal MB.

RAM round, bd219cc → retained Client/Data.Java code:

Simulated players RSS MB, before → after B/frame, before → after CPU µs/frame, before → after
150 146.30 → 135.13 672 → 318 5.465 → 5.529
250 145.83 → 140.30 655 → 293 3.805 → 3.543
500 146.98 → 140.93 675 → 286 2.348 → 2.209
1,024 147.08 → 147.21 671 → 288 1.478 → 1.362

Live mob round, a867a06 → bd219cc (packet changes only):

Active mobs + MCC players B/frame CPU µs/frame GC pauses ms/min
2,500 + 4 2,722 → 1,538 2.021 → 1.663 106.40 → 66.29

RAM at 1,024 players was unchanged within the paired 95% interval. RAM-round GC pauses rose by 0.29 and 1.26 ms/min at 250 and 500 players. ZLinq saved 72 B/tick locally but showed no application gain, so it was dropped.

Validation

  • Optimization build: 12,652 passed, 7 opt-in skips; count gate passed. For the version bump, only clean/build were rerun at user request.
  • dotnet clean UMPK.sln -c Release and dotnet build UMPK.sln -c Release passed with zero build warnings/errors.
  • dotnet format UMPK.sln --verify-no-changes --no-restore passed.
  • DataGen verify, language --check, and DataGen generate passed; 92 outputs reproduced byte for byte.
  • dotnet publish samples/MinimalBot -c Release -r linux-x64 and native AotPublishSmokeTests passed (14.01 MB).
  • Live FullFeatureLeg passed for 26.2 / 776 and 26.3 / 777.
  • API surface is unchanged; commits contain no reports, scripts, raw logs or game artifacts.

Notes for reviewers

The tables use separate frozen stages; their percentages must not be added. Client/Data.Java hashes matched the RAM candidate before the version bump; the tables use the recorded beta.6 binaries. The later RAM changes were not remeasured in the live mob benchmark. The full live version matrix and proxy leg were not run. Profiling scripts, reports and temporary artifacts are excluded; the test-count config reflects the deliberate regression tests.

@milutinke
milutinke merged commit a1e743b into master Oct 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant