FastInfoset.NET offers an extremely compact and widely interoperable encoding of the XML Infoset that is integrated into the XML processing API of .NET and is as straight forward to use as the system-provided text encoding.
To show how compact Fast Infoset documents are, we selected 392 documents from 25 publicly available sources on the Web and compared their sizes using the Fast Infoset, .NET Binary and text encodings.
Individual document sizes ranged from about 100 bytes to more than 1 GB, with a grand total of approximately 26 GB.
Documents encoded using Fast Infoset were significantly more compact than documents encoded using the .NET Binary or text encodings.
Average Fast Infoset size for each of the 25 test sets ranged from 9% to 40% of the text encoding and from 20% to 72% of the .NET Binary encoding.
FastInfoset.NET can optionally compress the Fast Infoset encoding using the LZF4, DEFLATE, ZLIB, GZIP, LZMA or BZIP2 methods.
You can select the desired compression method and compression level using parameters in the XmlFastInfosetWriter and XmlFastInfosetFactory.
The XmlFastInfosetReader can automatically detect the compression method to use when decoding or you can explicitly specify it yourself.
With compression set to DEFLATE at level 6, the size of the Fast Infoset encoding decreased further to become astonishingly small, with the average size of each of the 25 test sets ranging from 2% to 16% of the text encoding.
For maximum performance, FastInfoset.NET uses the high-speed compression implementations of DotNetCompression.
Especially when LZF4 is used, the compression throughput is so high that the processing overhead is practically negligible.
Fast Infoset is an open standard that has been published as an ISO International Standard (ISO/IEC 24824-1) and ITU Recommendation (ITU-T Rec. X.891).
This standard specifies a binary encoding of the W3C XML Information Set that is designed to improve the efficiency of the text XML encoding by producing a more compact representation at a higher transaction rate.
While FastInfoset.NET covers the .NET ecosystem, Oracle's reference implementation in Java SE makes Fast Infoset universally availabke in the Java world.
To ensure interoperability with the Java, C/C++ and various other implementations of Fast Infoset, Noemax joined the Fast Infoset Interoperability Project through which the Fast Infoset community coordinated and tested the cross-platform interoperability between the various implementations.
FastInfoset.NET passed all interoperability tests performed against all other Fast Infoset implementations.
Using the Fast Infoset encoding is as easy as using the text encoding.
The reader and writer classes of FastInfoset.NET implement the abstract XmlReader and XmlWriter classes of .NET, so you get all the benefits of using them as an integral part of the XML API of .NET.
If you are familiar with the XmlTextReader and XmlTextWriter of .NET, you will immediately feel comfortable with the XmlFastInfosetReader and XmlFastInfosetWriter classes.
You can switch from the system-provided text encoding to the Fast Infoset encoding with practically no changes in your code.
No XML schema is required either to write or to read an FI document.
An XML schema can optionally be used when converting an XML document into an FI document in order to optimize the encoding of primitive data types into a binary representation.
Since Fast Infoset is self-describing, FI documents can always be decoded without their schema or any other knowledge of their structure.
Both the Fast Infoset format and the text format are encodings of the W3C XML Information Set which describes an abstract representation of an XML document.
Since Fast Infoset and text are alternative representations of an XML Infoset that preserve all data and metadata of the XML Infoset, they can be converted to each other at any moment without loss of information.
Fast Infoset is also excellent with binary data like images, videos and other opaque items. To demonstrate its efficiency, we compared the sizes of SOAP messages containing binary data that were encoded using the Fast Infoset, MTOM and text encodings. Again, Fast Infoset was the most compact.
Both Fast Infoset and MTOM read and write binary data in its native format, avoiding the costly base64 or hexadecimal transformations of the text encoding that increase size and reduce performance.
But while MTOM is quite inefficient with small amounts of binary data as it actually increases message size when it contains less than 2,350 bytes of binary data, Fast Infoset is efficient with any amount of binary data in the message payload.
Plus, Fast Infoset can reduce the size of the whole message irrespective of whether it contains binary data, contrary to MTOM which can only reduce the size of the binary data that might be contained in the message.
For Windows Communication Foundation clients and servers, FastInfoset.NET includes a Fast Infoset message encoding binding element that produces the most compact messages compared to the BinaryMessageEncodingBindingElement or any other system-provided message enconding binding elements available in WCF.
For medium-to-large messages, Fast Infoset means not only that you reduce bandwidth consumption but also that messages arrive faster at their destination. Higher compactness results in higher responsiveness.
Increasing compactness also means that servers complete faster the receiving of requests and the sending of responses, freeing them quicker to process more requests and responses.
Are you sending large data? Fast Infoset is the perfect encoding. Use TransferMode.Streamed with the Fast Infoset encoding for excellent performance.
On the .NET side, Noemax's Fast Infoset implementation can be used as a WCF message encoding on .NET Framework 4.6/4.5/4.0/3.5, .NET Compact Framework 3.5, Xamarin.iOS, Xamarin.Android, Xamarin.Mac, Windows Phone Silverlight 8 and 8.1, Windows Phone 7.1, Silverlight 5 and Mono.
On the Java side, Oracle's Fast Infoset implementation can be used with Tomcat, Jetty, JBoss/WildFly, Weblogic, Glassfish, WSO2, Apache CXF, Apache Axis2, JAX-WS, Metro, Jersey, Grizzly and other application servers and Web Services frameworks.
And, of course, all these are fully interoperable.
When using HTTP/HTTPS, you can view Fast Infoset messages travelling on the wire by adding the Fast Infoset Message Inspector to the Fiddler web debugging proxy. You can download the inspector from here.
FI is available on the following | |
---|---|
PLATFORMS |
|
.NET Framework 4, 4.5 and 4.6 | |
.NET Framework 3.5 | |
.NET Compact Framework 3.5 | |
Xamarin.iOS | |
Xamarin.Android | |
Xamarin.Mac | |
Windows Phone Silverlight 8 and 8.1 | |
Windows Phone 7.1 | |
Xbox 360 | |
Silverlight 5 | |
Mono | |
Portable Class Libraries |