I'm serializing the data in my app using custom serialization i.e. each of the classes I'm storing has the [Serializable]
attribute and implements ISerializable
. The object graph being serialized is reasonably complex with lots of cross-references between the objects/classes. The serialization works, but it's pretty slow. :(
By putting a breakpoint in each relevant class's GetObjectData
method, I've found that I'm getting many, many more hits than I've got objects.
I'm confused - my understanding of the serialization framework was that it would store each object only once, even if the object graph contained multiple references to it. I assumed that this meant each object's GetObjectData
method would need to be called only once during saving. Am I wrong?
And if so, is there anything I can do in this approach to reduce the number of calls to my classes' GetObjectData
methods?
Thanks.