Look into optimized reading JSON for known classes by skipping intermediate map/list/etc
See https://github.com/mafintosh/turbo-json-parse
Isn't the "known schema" the @JsonSerializable-tagged class?
@denkuy – you could imagine creating a custom parser that creates annotated objects directly, without first creating the JSON literal objects. That's what this issue is discussing...
"JSON literal objects" as in a "dart String, json format" or "dart Map<String, dynamic>"?
What is the "known schema" in this case? Sample data or a json schema (something like https://json-schema.org/ )
Instead of
bytes/String -> [JSON decode] -> Map<String, dynamic> -> [MyClass.fromJson] -> MyClass
Do this
bytes/String -> [MyClassConverter] -> MyClass
See https://github.com/kevmoo/json_alt
See also https://github.com/dart-lang/sdk/issues/35693