Lets suppose i have a class with NativeHashMaps and NativeLists using persistent allocators. I want to serialize into json and then deseriazling back to this instancce which is already allocated like json.net PopulateObject.
If you are serializing to and back in a closed loop use the entities binary serialization. You would need to flatten your hashmap to an array but not a big deal.
Or just copy to managed Dictionary/List and back. Json is so slow that the cost of the copy isn’t going to be an issue.
Actually i have to use JSON so i can save/load it in backend which expects a json, i have no issue with performance as its load one time and save when played turn
Currently im making another class which copy to managed and then serialize/deserialize with json.net but this feels “extra” work which i want to avoid.