Giuseppe Giuffre
Giuseppe Giuffre

Reputation: 21

ServiceStack time of deserialization

I have a problem with the deserialization with serviceStack.Text. The running Time of the serialization of a complex object increases exponentially with increasing complexity of the object . In particular, this object contains a list of simple objects , increasing the number of these items in the list , the time of serialization increases dramatically . how do I make it faster ?

These are my only configuration:

JsConfig.IncludeTypeInfo = true;
JsConfig.IncludePublicFields = true;

Upvotes: 2

Views: 175

Answers (1)

mythz
mythz

Reputation: 143374

I'd highly recommend against using:

 JsConfig.IncludeTypeInfo = true;

Which forces unnecessary type information to be included which unnecessarily bloats the payload. Ideally your DTO's should be well-defined and not contain unknown object or Interface properties which increases serializer-specific coupling and will fail to serialize in many standards-based serializers.

Upvotes: 1

Related Questions