[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Schema: "Best used with the ______ tool"

  • From: Boris Kolpackov <boris@c...>
  • To: Michael Kay <mike@s...>
  • Date: Fri, 28 Nov 2008 15:11:48 +0200

Re:  XML Schema: "Best used with the ______ tool"
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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.