Hello,
My app requests some data from web api’s and gets json strings as response.
I’d like to see if I can get any performance benefits from doing the Deserialization from inside a job.
I would try and Deserialize the string into a struct, but the results have some nested objects I need.
ex:
{
"name": "Joe",
"stuff": [
{
"thing": {},
"otherThing": 1
},
{
"thing": {
"someBool": false
},
"otherThing": 2
},
]
}
While the root object I can make a struct and make the name a NativeString32, the “stuff” object, needs to be a NativeArray and even if Stuff is also a struct with value types, because it needs to be a NativeArray it isn’t blittable and thus can’t run on a job thread with .Schedule
So i’m looking for suggestions on best practice.
Should I just give up on having a BurstCompiled job to do this deserialization? I imagine Unity has to do some serialization/deserialization from the ConvertGameObject flow, so maybe they’ve figured out a way?