Tuesday, November 14, 2006

BizTalk: faster to transform with maps or in code?

I have been testing a scenario hinted about in a discussion at TechEd with a fellow MVP. This is the basic idea: which is faster? using the BizTalk Mapper, which generates XSL-T underneath to convert between 2+ schemas, or do the transform in a custom Transform method written in C# in a class library project, that converts a source object into a target object (with these two being produced from the schemas using xsd.exe) with the appropriate assignments and serializations?

I am testing this out of curiosity only, because I plan on keep on using the Mapper due to its visibility and documentation advantages, but the code-based approach seems to be faster, even with simple maps containing direct-links only. The Map approach is a little faster when processing single messages, but as I increase the load the difference becomes greater in favor of the code approach.

I want to further test this, with complex scenarios (ex: using functoids and repeating structures), and will post my test code here when I'm done.

If the code approach proves to be superior in terms of performance, it may be a good idea to create a tool that generates C# code from a map, instead of XSL-T... in a BizTalk Server Software Factory, perhaps? :-)

No comments:

Post a Comment