JSON Parsing Improvements #735
Labels
customization
Make glTFast behavior more costomizable
enhancement
New feature or request
import
Import of glTF files
run-time
Milestone
The Problem
glTFast currently has two JSON parsing backends.
JsonUtility is fast, has few GC allocations and a low build-size overhead, but it requires two-pass parsing to ensure non-present object properties are
null
and it does not grant access to meta-data that's unknown at build-time.Newtonsoft JSON on the other hand allows accessing arbitrary data in
extras
,extensions
or elsewhere, but is slower and has a large build-size overhead. On top of that it was necessary to drive another abstraction layer into the de-serialization (schema) classes which is complicated and has already introduces API breaking barriers that are hard to overcome.There's also #734 which needs to be addressed/is a hard requirement.
Solutions
The important metrics of potential solutions are:
The ideal scenario is one JSON parser that wins in all categories and replaces both JsonUtility and Newtonsoft JSON.
The next best alternative would be to replace Newtonsoft JSON only.
Requirements
Nice-to-haves
System.IO.Stream
)._n
type properties into one array. (e.g.TEXCOORD_0
,TEXCOORD_1
...TEXCOORD_n
; see spec).Misc.
In order to avoid reflection for generic de-serialization, we should investigate into source generators.
Alternatives
There's a bunch of JSON parsers out there we should consider or maybe take a page out of their book.
The text was updated successfully, but these errors were encountered: