-
Notifications
You must be signed in to change notification settings - Fork 629
Avoid temporarily deserializing gateway messages to an untyped enum+map tree #3114
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
Avoid temporarily deserializing gateway messages to an untyped enum+map tree #3114
Conversation
e21c4b6 to
5fe2801
Compare
mkrasnitski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is definitely an improvement. It does suck that we're cloning the json data once, but for now we have to defer deserialization of Event in order to process the value of seq even if we fail to parse the event.
This deserves a rework but for now it's fine.
|
@mkrasnitski ready for another look now |
|
Can you rebase onto latest |
9440e4e to
d8d1e7b
Compare
|
rebased |
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to #3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to #3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to #3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
…ap tree (serenity-rs#3114) Avoid temporarily deserializing gateway messages to a `serde_json::Map<String, Value>` before typed deserialization to an `Event`. Previously, this meant the creation of a `serde_json::Value` tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.
Followup to serenity-rs#3114. By using an intermediate untagged enum with an `Unknown` variant, we can process sequence numbers for unknown events without cloning the json payload.
Avoid temporarily deserializing gateway messages to a
serde_json::Map<String, Value>before typed deserialization to anEvent. Previously, this meant the creation of a serde_json::Value tree, causing creation and immediately after the destruction of upwards of hundreds to thousands of owned strings and btreemaps for every handled gateway event.