|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||






