Json Deserialization and Enum.ToString cost a lot of performance.

mubarak

New member
Json Deserialization and Enum.ToString cost a lot of performance. Note that I am having "Deep Profile" on so actually numbers are much lower (~ 300 ms), but that's enough to cause visible lag spike on additive scenes. Is there a way to optimize it?

View attachment 1016.mp4
 
The JSON format itself is very prone to being slower and causing more GC compared to something like binary serialization. In this case I recommend that you use binary serialization (switch using the preference on the top right of the editor) and the performance will be better.
 
The JSON format itself is very prone to being slower and causing more GC compared to something like binary serialization. In this case I recommend that you use binary serialization (switch using the preference on the top right of the editor) and the performance will be better.
I did that but I realized EnableBehavior still uses JSONDeserialize. SetVariableValue is using BinaryDeserialization. The lag is still large.
Btw I am using v1.7.8
 
If JSON serialization is still being used then make a change to the tree. This will reserialize it using the serialization preference
 
Back
Top