Skip to main content

Question regarding serialization/parsing performance of Fast Infoset

2 replies [Last post]
Joined: 2008-05-20

Hi All,

I have a question regarding performance (for parsing/serialization) of Fast Infoset over XML.

Fast Infoset is used to encode XML documents in binary format. The Fast Infoset document are smaller in size in comparison to XML document.

In order to compare the performance for serialization/parsing, let's consider the following cases:

Case1: Application produces a XML document

Application ---> XML

Case2: Application produces a Fast Infoset document

Application ---> XML ---> Fast Infoset document

Time required for serialization of Fast Infoset document = Time required for serialization of XML + Time required of converting XML document to Fast Infoset document

Thus time required for serialization/parsing of Fast Infoset document would always be more than time required for serialization/parsing of XML document

Am I missing something?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-06-19

The Fast Infoset format is an [i]alternative[/i] to the text XML format. You encode your data [i]either[/i] as text XML [i]or[/i] as Fast Infoset. There is no point to encode your in-memory data as text and then to convert the text-encoded data to Fast Infoset-encoded data.

So I guess that what you really want to test is:

[b]Case1:[/b] Application produces an XML document

Application ---> text XML document

[b]Case2:[/b] Application produces a Fast Infoset document

Application ---> Fast Infoset document

Hope this helps.

Joined: 2006-01-25


basically when you want to use FastInfoset it's not required to perform step:
Application -> XML

Project FastInfoset[1] has DOM/SAX/StAX API implementations. You can use them directly to serialize/deserialize application data.
See FI StAX example bellow [2].

ByteArrayOutputStream out = new ByteArrayOutputStream();
XMLStreamWriter writer = new StAXDocumentSerializer(out); // FastInfoset StAX implementation