Use built_value
for serialization.
#3915
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #3811.
Remove hand-coded serialization of
AssetNode
, usebuilt_value
's generated code.Store globs as their
String
pattern instead of as aGlob
to save having to serialize theGlob
type.Before this PR the serialization was dropping half of the graph data on serialization and reconstructing it on deserialization, adding back
inputs
by reversing theoutputs
links on load. Stop doing that and just serialize+deserialize unchanged. This turns out to need one fix for correctness: track one input inbuild_impl.dart
that was being restored on load.The output is quite a lot larger than before, for the 1000 node benchmark the serialized graph is now 228Mb(!) whereas previously it was 20Mb(!). This is because the previous serialization code optimizes by replacing AssetIds with one int each used to refer to that ID throughout the JSON. The 10x saving is nice, but we need to "dedupe" whole subgraphs, not just individual IDs, in the end the graph for that benchmark should be well under 1Mb.
This restores a good chunk of the performance lost in the previous PR, the details are not important as we are obviously some way from the desired final state, but here are the numbers in case anyone wants them