Performance: JSON serialization
MEDIUM IMPACT
This affects how quickly data is converted to and from JSON format, impacting load times and responsiveness when saving or loading game data.
string json = JsonUtility.ToJson(largeComplexObject, false);
string json = JsonUtility.ToJson(largeComplexObject, true);
| Pattern | CPU Usage | Memory Allocations | Frame Impact | Verdict |
|---|---|---|---|---|
| Pretty print enabled | High | High | Causes frame drops | [X] Bad |
| Pretty print disabled | Medium | Medium | Smooth frame rate | [OK] Good |
| Repeated deserialization every frame | Very High | High | Severe frame jank | [X] Bad |
| Cache deserialized data | Low | Low | Stable frames | [OK] Good |