Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Refactor serializer to not rely on serde_json::Value #6

Open
radu-matei opened this issue Jun 23, 2019 · 0 comments
Open

Refactor serializer to not rely on serde_json::Value #6

radu-matei opened this issue Jun 23, 2019 · 0 comments

Comments

@radu-matei
Copy link
Member

The quickest way to build a lexicographically sorted object was to use the serde_json::Value serializer, then ensure it doesn't contain any non-permitted values for canonical JSON.

Doing so, however, means we visit each node multiple times - which is strongly undesirable, and fixing this is the top priority.

The fix consists of completely reworking the serialization of maps (and by extension of all structures, since, for the sake of a JSON serializer, a structure is merely a map) to be represented as a BTreeMap, which is by default sorted by key.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant