Is there a way to optimize the size and speed of serialization of objects?
- Create 20,000 TestNode objects
- Serialize → 53,800KB file <<<<<<< It’s too big
- Deserialize → 69,181 ms <<<<<<< Tooooo~ slow
※ Logic objects in real projects are much more complex.
※ At least 10000 objects are managed for each document.
[Serializable]
public class TestNode : GoNode
{
public TestNode()
{
var r = new GoRectangle()
{
Selectable = false,
BrushColor = Color.Red,
Bounds = new RectangleF(0, 0, 200, 200)
};
this.Add(r);
for (var i = 0; i < 9; i++)
{
var text = new GoText()
{
Location = new Point(10, 5 + (i * 20)),
Text = $"Test - {i + 1}",
};
this.Add(text);
var port = new GoPort()
{
Location = new Point(10 - 7, 5 + (i * 20)),
};
this.Add(port);
}
}
}