GurdeepS
GurdeepS

Reputation: 67213

How can serialisation/deserialisation improve performance?

I heard an example at work of using serialization to serialise some values for a webpart (which come from class properties), as this improves performance (than I assume getting values/etting values from/to database). I know it is not possible to get an explanation of how performance in the scenario I speak of at work can be improved as there is not enough information, but is there any explanation of how serialization can generally improve performance?

Thanks

Upvotes: 1

Views: 245

Answers (3)

Daniel Dyson
Daniel Dyson

Reputation: 13230

Serialising a webpart and saving it to a single database field might improve performance slightly, but probably not. It would definately add the cost of not being able to query for a webpart using anything other than a keyed field. Serialisation is more commonly used for sending data between components.

Upvotes: 0

Adam Lear
Adam Lear

Reputation: 38758

Plain serialization won't improve performance because you're introducing overhead for serializing/deserializing your objects. However, if you're talking performance of transmitting data over the network, serializing your data and compressing the serialized object can improve that.

Upvotes: 0

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

Serialization never improves performance over directly passing and manipulating objects. It is just a mechanism to transfer objects in some interoperable format (not always necessary to be interoperable).

Upvotes: 1

Related Questions