Xml Data Binding Performance

Contents

Capability Summary

A quick tick sheet showing the supported features.

Capability Details

A more detail breakdown of the supported features.

Type Mappings

The mappings used to go from XSD types to native language types.

Performance

Detailed performance figures for each language, using various file sizes and types.

 

Capability Summary

Liquid XML Data Binding - Supported Languages
    C# (.Net)
    Java
    C++ (Win32, Linux, Solaris etc.)
    VB .Net
    Visual Basic 6
    Silverlight 2 (C# & VB.Net)

 

Liquid XML Data Binding Generated Successfully Supported in the code

ComplexType Groups

    Sequence
    Choice
    All
    Multiple Models, same complextype

Types

    Hex/Base64
    Date/Time/gMonthDay etc.
    Collections of primitives
    All primitive data types    *1
    unions    *2
    any
    anyAttribute
    default values
    Pad chars (&<>" etc.) N/A
    Strongly Typed Output N/A

Facets

    fractionDigits  
    length
    maxExclusive
    minExclusive
    maxInclusive
    minInclusive
    maxLength
    minLength
    pattern    *3
    totalDigits
    whiteSpace

Cardinality

    Optional
    Mandatory
    Multiple

Enumeration's

    Enumerated Attributes
    Enumerated Elements
    0-n Enumerated Elements

Documentation

    Documentation Generation

ComplexContent

    extension
    restriction    *4
    Different base model types

Schema

     Namespace
     Import
     Include
     groups
     Recursively defined elements
     substitutionGroups
     Invalid names for the language
     Elements & attributes with same name
     Mixed elements    *5

*1 All data types are supported but the validation rules are not applied to all of the types.
*2 Treated as strings
*3 Supported on some data types
*4 Allows child elements that have been restricted.
*5 Can't handle mixed content like <H1>text<B>more text</B>Some More Text</H1> 'text' & 'Some More Text' get concatenated.

Capability Details

Feature Support provided in C++, C#, Java & VB 6

Complex type groups

Sequence A Complex Type containing the sub item <sequence>
Fully Supported - validates order of sub elements
0-1 The sequence is optional within the containing Complex Type
Fully Supported
1 The sequence is mandatory within the containing Complex Type
Fully Supported
0-n There may be 0 or multiple instance of the sequence within the containing Complex Type
Fully Supported - creates a strongly typed collection
Choice A Complex Type containing the sub item <choice>
Fully Supported
0-1 The choice is optional within the containing Complex Type
Fully Supported
1 The choice is mandatory within the containing Complex Type
Fully Supported
0-n There may be 0 or multiple instance of the choice within the containing Complex Type
Fully Supported - creates a strongly typed collection
All A Complex Type containing the sub item <all>
Fully Supported
0-1 The sequence is optional within the containing Complex Type
Fully Supported
1 The sequence is mandatory within the containing Complex Type
Fully Supported
0-n There may be 0 or multiple instance of the sequence within the containing Complex Type
Fully Supported - creates a strongly typed collection
Multiple Models A choice that contains a sequence
Fully Supported - Ensures that the rules for each contained type are obeyed. See all/choice/sequences
any Enables any element from the specified namespace(s) to appear in the containing <sequence> or <choice> element
Fully Supported - Allows runtime elements to be added, including namespace, and namespace validation
unions An attribute type can contain either a number or the sting 'xxx'
Represented as a string, no validation performed
anyAttribute Enables any attribute from the specified namespace(s) to appear in the containing <complexType> element or in the containing <attributeGroup> element
Fully Supported - Allows runtime elements to be added, including namespace, and namespace validation
default values Gives the default value to a attribute or element
Fully Supported
Pad chars (&<>" etc) Escape invalid XML characters
Fully Supported
Strongly Typed Output Provide classes that are strongly typed, i.e. all the schema attributes and elements are represented by appropriate primitive types for the given language
Fully Supported - all types are strongly typed (extended types may be treated as objects in VB6 due to its lack of proper inheritance).

Enumerations

Enumerated Attributes A limited list of values is allowed for a given attribute
Fully Supported
Enumerated Elements A limited list of values is allowed for a given element
Fully Supported
0-n Enumerated Elements A collection of a limited list of values is allowed for a given element
Fully Supported - creates a strongly typed collection

Documentation

Documentation Generation Is Documentation for the library is generated
Fully Supported - creates html & compiled html files (.chm) using MS Help workshop 1.3
Schema comments The comments from the schema get incorporated into the documentation
Coming Soon

complexContent

extension An existing Complex Type may be extended, adding new elements & attributes to its existing ones. The extended versions may be used in place of the base type
Fully Supported
restriction An existing Complex Type may be restricted to create a new one that has a subset of the properties of the original. The extended versions may be used in place of the base type
Partial Support - Generates working code, but it will validate XML documents containing restricted elements, and allow the construction of XML documents with restricted elements in them
Different base model types i.e. a element containing a choice is extended with an element containing a sequence
Fully Supported

Schema

Namespace The schema contains elements and attributes from a number of different namespace
Fully Supported - each element is aware of the namespace it is contained within. This is also true of runtime elements (see All, and anyAttribute)
Import Existing schemas may be imported into the current schema file
Fully Supported
Include Existing schemas may be included into the current schema file
Fully Supported
groups Groups a set of element declarations so that they can be incorporated as a group into complex type definitions
Fully Supported
Recursive elements I.e. an element is defined in terms of itself
Fully Supported
substitutionGroups Indicates the name of an element for which this element can be substituted. This element must have the same type or a type derived from the type of the specified element.
This attribute can be used on any element if the referring element is declared at the global level (parent is <schema> element)
Fully Supported - these resemble a choice in the generated code
Invalid names Element & Attribute names in the schema that are invalid in the target language
Fully Supported - all invalid names are re-mapped, a mapping file is written out, allowing the default mappings to be changed. This includes making duplicate, long names, and reserved words safe

Type Mappings

Data Types
Facets
C++
C# and VB .Net
Java
VB 6
anyType
anyURI
ENTITIES
ENTITY
IDREFS
IDREF
ID
language
normalizedString
NOTATION
NMTOKENS
NMTOKEN
NCName
Name
Qname
token
string
length
maxLength
minLength
pattern
whiteSpace
STL string String String String
hexBinary
base64Binary

 

length
maxLength
minLength
whiteSpace
CBinaryData* BinaryData* BinaryData* BinaryData*
byte maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
BYTE SByte Byte Integer
short maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
SHORT Int16 Short Integer
int maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
LONG Int32 Integer Long
longinteger
negativeInteger
nonPositiveInteger
decimal
maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
LONGLONG Int64 Long Long
unsignedByte maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
CHAR Byte Short Integer
unsignedShort maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
WORD Uint16 Integer Long
unsignedInt maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
DWORD Uint32 Long Long
unsignedLong
positiveInteger
nonNegativeInteger
maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
DWORDLONG Uint64 Long Long
float maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
float Single Float Single
double maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
double Double Double Double
duration
time
maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
CDateTimeSpan* XmlDateTimeSpan* Duration* DateTimeSpan*
datetime
date
gMonthYear
gYearMonth
gMonth
gDay
gYear
maxExclusive
minExclusive
maxInclusive
minInclusive
whiteSpace
CDateTime* XmlDateTime* DateTime* DateTime*
boolean whiteSpace bool Boolean Boolean Boolean

* Data Type provided within the Liquid Technologies Runtime

Performance Statistics

This section provides an overview of the performance you can expect from your the XML Data Binding libraries generated from Liquid XML Data Binder.

All tests were carried out on a Pentium 4 2.66 GHz processor with standard IDE drives & 512MB of memory, running Windows XP SP 2.

C++ Performance Summary

Built as UNICODE, and tested on Windows XP SP2, comparisons were done against MSXML 4 SP2 (running in a non-validating mode).

The generated Liquid C++ libraries have similar performance to the non-validating MSXML parser, and perform especially well on larger XML Files. On smaller files the difference in time is only a few milliseconds.

Considering the Liquid libraries are validating the data, we believe these results to be excellent.


Performance Summary .Net

Comparisons were done against the standard XML DOM parser included with the .Net framework (running in a non-validating mode), C# & VB.Net exhibits the same behaviour.

The generated Liquid .Net libraries have similar performance to the standard non-validating .Net libraries, and perform especially well when writing XML data.

The Liquid libraries use the standard .Net XML parser internally, and so are always going to be adding some overhead to the reading process, however this overhead is very low.

Considering the Liquid libraries are validating the data, we believe these results to be excellent.


Performance Summary Java

Built using JDK 1.4.2, comparisons were done against Xerces 1.4.3 (running in a non-validating mode).

The generated Liquid Java libraries have similar performance to the non-validating Xerces parser, and perform especially well when writing XML data.

The Liquid libraries use the standard Xerces parser internally, and so are always going to be adding some overhead to the reading process, however this overhead is very low.

Considering the Liquid libraries are validating the data, we believe these results to be excellent.


Performance Summary - Visual Basic 6

Comparisons were done against MSXML 4 SP2 (running in a non-validating mode).

The generated Liquid Visual Basic libraries are slower than the non-validating MSXML parser. However, we are comparing a native Visual Basic solution with a highly optimised solution written in C++.

Looking at the actual timings, the difference though significant still provides a usable solution. If performance over ease of use is your primary concern then switching to the C++ libraries would provide a more suitable solution. This is a common trade off for Visual Basic developments.

Considering the Liquid libraries are validating the data, we believe these results to be acceptable.