-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TODO: Optimize Reconnect data #125
Comments
15018 Bytes are still too large to be use as reconnect data. I suggest to use LibCompress, and the original 68829 bytes are compressed into 34228 bytes by my testing. I believe 15018 bytes can be compressed to under 10k bytes, although this is still too large. The only is that it doesn't support backward compatibility. The problem basically is caused by the bad data structure
The above solution first has one less table level. Second, it allow us to reuse some of the candidate table in core. Third, it's more serializing friendly, as the key to the table like "response", "ilvl", etc are not in the bottom level of the table. |
LibCompress is totally worth considering, however that probably won't be until v3, as it will break all comms. No matter what, a single comm containing all the data used will be large. The structure is fine when handling a session (session is the identifier, everything related to a session is located in lootTable[session]), but indeed not optimal for transmission. Luckily, the data can be structured however we want.
|
Using your suggested structure, albeit with a different table:
I was interested in if LibCompress was more efficient in handling an item lookup table, so I tried compressing at step 5: 5,244 kB and encoded: 5,319 kB. Either it doesn't work as I expected, or it's just better to do it yourself. The table looks like this when extracted. For comparison, the original example goes to: |
Using the data you posted: https://gist.github.com/evil-morfar/7cb190de8b9cce72139d7af07b8c1dfc
|
Tested on the RCSerializer which I completed early:
If Step 2 is changed to use AceSerializer, the result is 4202 bytes. |
More optimization can be done:
My result is 2583 bytes
Then reconnect data will only take 2160 bytes
Combined with 2, and then remove ilvl data |
Keep in mind this is intended for v2.8. I don't think it's reliable/fast to use GUIDs - currently we would need to fetch them all before being able to use the data. To use that, each client should maintain a GUID -> display name table, which in turn could be used by the candidate table. I seem to remember seeing somewhere that raidid is not an reliable identifier across multiple clients. I think the average ilvl is one of the most important information in there. It's the only useful statistic for a guild trying to gear up their members equally. Eitherway, removing core features in a v2.x update is out of the question. |
There isn't much room for optimization, if we want to preserve backward compatibility in v2.8. |
It doesn't really make sense to preserve backwards compatibility, as there's not really any gain from it. My point was all the required resources (such as proper GUID handling) won't necessarily be ready for 2.8, and I'm not sure doing a major comms overhaul is the right thing to do either at this point. For now, I only intent |
The current reconnect data is horific: comm string example (68,829 kB) Decoded table.
Currently the following data is sent on reconnects:
MLdb
>council
>candidates
>lootTable
>reconnectData
.The first two are required to get ML's settings, and to know if we have access to votingFrame (but we could initially just send the ML and the reconnectee if council). LootTable (as normally sent by ML) is required if we want candidate to roll - it's also currently required in the live version to setup votingFrame (not necessary if changed). ReconnectData should then contain everything that's happened in the session(s), but currently it's just a copy of
addon.lootTable
meaning it's a mixture of all of the above.A session entry example
So what's needed? If LootTable is sent first, then basically everything but
awarded
can be removed. That's probably the way to go.Otherwise the following are required for the votingFrame without needing to cache:
awarded, link, ilvl
. Most things fromGetItemInfoInstant()
should also be included when received.A candidate example
Assuming
candidates
are sent first, all things from there can be removed (class, role, rank
).SpecID
could technically be included from candidate data, although it might not be entirely up to date. To further reduce data, everything that'sfalse or 0
can benil
and recreated when received. Finally, we don't need entire itemlinks (we honestly never need to receive that on player gear, except for the loot history, where it's quite nice to have), so those could be shorted to itemstrings.Solution
New structure (1 session):
lootTable
comm. Awarded isn't required either, it can be gathered from the response.isRelic
orisTier
- while not 100% ensured, these are almost guaranteed if tier/relic buttons are enabled.Doing this changes the data from 68,829 kB to 15,368 kB, another example from 43,758 kB to 7,965 kB.
Further optimizing
The text was updated successfully, but these errors were encountered: