Skip to content

[Performance] Wearchange Packet Send Deduplication#4916

Merged
Akkadius merged 12 commits intomasterfrom
akkadius/dedupe-wearchange
Jun 25, 2025
Merged

[Performance] Wearchange Packet Send Deduplication#4916
Akkadius merged 12 commits intomasterfrom
akkadius/dedupe-wearchange

Conversation

@Akkadius
Copy link
Copy Markdown
Contributor

@Akkadius Akkadius commented Jun 11, 2025

Description

We send enormous amounts of extra wearchange packets all over the source. In many places we double send the entire inventory (7 slots or so) twice and in many circumstances this sends many times over depending on what the client is triggering.

Instead of heavily gutting code and extra sends potentially creating intermittent bugs hard to trace down for many months, I've implemented a simple deduplication pattern that is used in a few different places throughout our code. If we have sent the same exact identical update to another client, we will prevent from sending the packet at all.

Below is a packet capture of someone zoning in 100 toons on PEQ and an absolute flood of wearchange packets which ends up overwhelming clients triggering cascading resends and ultimately putting characters into LD status.

image

Type of change

  • Performance / Bug fix

Testing

Also did testing with a 100 boxer on PEQ who originally ran into the packet flooding issue and everything functionally works and packets are deduped reducing a ton of extra packet sends.

image

  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [112] for mob [Foqoun] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | ZonePC Client [Foqoun] zone_id [29] instance_id [0] x [160.67274] y [131.0044] z [4.377001] heading [408.5] ignorerestrictions [2] zone_mode [1] -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]
  Zone |    Info    | operator() Already sent WearChange to client [200] for mob [Asvoas] skipping -- [halas] (Halas) inst_id [0]

Checklist

  • I have tested my changes
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I own the changes of my code and take responsibility for the potential issues that occur

@Akkadius Akkadius merged commit 83918ce into master Jun 25, 2025
2 checks passed
@Akkadius Akkadius deleted the akkadius/dedupe-wearchange branch June 25, 2025 18:19
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.

2 participants