- Serialize and Deserialize array 2000 item
Type | Size | Deserialize | Deserialize GC | Serialize | Serialize GC | |
---|---|---|---|---|---|---|
FlatBuffer |
binary | 2.846 | 0.0528 | 0.2485 | 0.2745 | 0.7279 |
MessagePack-Csharp |
binary | 1.000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
JsonUtility |
text | 2.657 | 0.0793 | 0.6279 | 0.0341 | 0.3851 |
-
Searching item
MemoryMaster
is faster thanFlatBuffer
-
find item have id 1746 in array 2000 item
var item = Find($"Id_1746");
Find | Find GC | |
---|---|---|
FlatBuffer |
1.76ms | 335B |
MemoryMaster |
0.7ms | 48B |
- find each item once in array
for (int i = 1; i < 2000; i++)
{
var item = Find($"Id_{i}");
}
Find | Find GC | |
---|---|---|
FlatBuffer |
34.4ms | 254.5KB |
MemoryMaster |
4.17ms | 179.2KB |
- JsonUtility has many limits as:
- not support array (you need write class helper to support this)
- not support dictionary (you need custom class which acts as a dictionary item or using other custom serializer)
- the float value serialize is not accurate due to the encoding problem. You can change float to string to get an accurate value.
- not support binnay search as part of itself