Al: Feature Request: Add XmlWriter .NET Wrapper

Created on 28 Nov 2017  路  3Comments  路  Source: microsoft/AL

We have performance critical code that is currently using XmlWriter by C# code injected into C/Side meta data and using reflection to add refferences. We would like to translate this to a more sane model, but the XDocument (that the current wrappers use?) are not performant as in CPU and memory as the XmlWriter.

XDocument  ( 5000 times   1k) : 15.561 sec 
XML Writer ( 5000 times   1k) : 8.795 sec 
XDocument  (    5 times 200k) : 8.046 sec mem 755 mb
XML Writer (    5 times 200k) : 2.269 sec mem 67 mb

Numbers shows that XmlWriter is over 3 times as fast when using larger object and consumes less than 10 times the memory. These numbers increase the larger the document. Main difference is that XmlWriter writes directly/forward only (no DOM) to a stream.

Thank you

platform-api suggestion xml

Most helpful comment

@StanislawStempin we also have a lot of performance issues due to XML Writer not being available. Please, can someone look into this?

Also, the Xml Writer code in C/AL seems to match with the Xml Writer in C#. Expecting AL will have the exact same functions as C#, it will be a lot easier to maintain C/AL and AL at the same time.

All 3 comments

We are about to write a large project that emits large chunks of XML data - any status on this?

@StanislawStempin we also have a lot of performance issues due to XML Writer not being available. Please, can someone look into this?

Also, the Xml Writer code in C/AL seems to match with the Xml Writer in C#. Expecting AL will have the exact same functions as C#, it will be a lot easier to maintain C/AL and AL at the same time.

Was this page helpful?
0 / 5 - 0 ratings