Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] XML Schema: "Best used with the ______ tool"

From: Boris Kolpackov <boris@-------------.--->
To: Michael Kay <mike@--------.--->
Date: 11/28/2008 1:20:00 PM
Hi Michael,

Michael Kay <mike@s...> writes:

> [...] I don't think there's any intrinsic reason why they should 
> be slower than data binding. I'm not saying they are faster, just
> challenging your assertion that they are impossibly slow - I think
> the burden of proof is on you.

On the high level, the primary reason is that with data binding
the operations are performed on the data itself while XSLT, 
XQuery, etc., operate on the XML representation of this data.

On a more technical level, I believe the two primary areas that
contribute to the performance difference are the string-based
flow control (XSTL/XQuery compare strings to access an element
while data binding simply calls an (inline) function) as well
as conversion of data to/from string representation. As an
example, consider the following XML fragment:

<people>
  <person name="John Doe", age="32"/>
  <person name="Jane Doe", age="28"/>

  ...

</people>

Let's say we want to access all people younger than 30. With
data binding we will have something like this:

people p = ...

for (iterator i = p.begin (); i != p.end (); ++i)
{
  if (i->age () < 30) 
  {
    // process
  }
}

The age value is retrieved using a function call and the return
value is of type int, directly comparable to 30.

With XML representation there will be a bunch of string comparisons
to first locate all "person" elements and then to locate the "age"
attribute. We will also need to convert the age value from string
to int in order to compare it.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent