Optimising marshalling/unmarshalling of user-defined OTD
Hi,
Is there a way that we can optimise the marshalling/unmarshalling process of a user-defined OTD. We need to marshall/unmarshall the OTD as we need to propagate it from one business service to another, and it is taking quite a considerable amount of time (10-20 seconds) for each operation.
Thanks.
# 1
Hi,
I am afraid you cannot optimize marshalling/unmarshalling more than configuring propertly the OTD. There are several configuration parameters for Elements and Fields, as 'optional', 'repeat', ... than can help you simplify the expression that defines your OTD (probably setting them propertly can make marshalling/unmarshalling more optimum) but its not a big deal.
BTW, it would be better that you try to define an OTD that can be used for several services, so you dont need to marshall/unmarshall so frequently. Try to find a 'standard' OTD for your calls, thats the best optimization you can apply.
# 2
Thanks for your reply, we are currently having some performance issues and we are investigating the possible cause. Given that there are no possible optimisation paths that we can take with the marshalling and unmarshalling operations, can we assume that decreasing the amount of data being marshalled/unmarshalled will actually decrease the amount of degradation?
# 3
Hi Adrian,
Bit difficult to give advice on this without seeing what you're doing.
If you don't need the OTD's structure for complex mappings you can use a User-Defined OTD that only has a String field, kind of like a CLOB. That eases propagation overhead a lot.
Another consideration is that unmarshalling in eInsight will make this information available into the Business Process, the Business Process is the scope / context, so you only have to unmarshall once.
Considering the 10-20 seconds, i'm assuming you're dealing with a simple message of about 5 MB or a complex message of about 1 to 2 MB ?
There is a base 2 exponential duration issue due to the buffer size of the streams used for parsing, essentially this buffer has a limited size of say 1 MB, and when it needs more it creates a new buffer of 2 MB and copies the old buffer of 1 MB in there, then when you hit that limit a new buffer of 4 MB is created and the old buffer of 2MB is copied in there. As it uses streamparsers it's not completely aware of the message size at the moment it starts parsing and the bigger your message is the more often these (rather inefficient) copies occur.
So yes, decreasing the message size will help here a lot.
You can also play around with eInsight's features of PassByValue versus PassByReference, but that depends on how the flows are setup.
Good luck
Paul