-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
serde-derive implementation of tagged deserialisation is pretty inefficient (>2x slower than regular) and buffers entire input into an intermediate internal AST before searching for the tag key (see serde-rs/serde#1495 for details). It needs this to support generic cases where the tag key happens to be in arbitrary position of the input, but input is a non-seekable stream. We use this deserialisation only in a well-defined context where we have control over both parts of the communication, so we can require `type` key to be the first in the JSON and avoid any buffering whatsoever to get the best possible performance.
- Loading branch information
Showing
2 changed files
with
73 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters