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

Re: memory efficiency of xslt wrt to element and attributename

  • From: Michael Kay <mike@saxonica.com>
  • To: xml-dev@lists.xml.org
  • Date: Fri, 09 Jul 2010 15:46:26 +0100

Re:  memory efficiency of xslt wrt to element and attributename
I think it's unlikely that using long element names will have a big 
impact on the memory size of the internal trees, unless the 
implementation is very inefficient. However, it may have an appreciable 
effect on parsing time; the "per character" loops in the XML parser can 
account for a significant amount of the total parsing time, and the 
parsing time is often substantial compared with the XSLT processing 
time. It's also likely that somewhere in the system software will be 
doing string comparisons to compare element names.

But as always with performance issues, don't try to make changes until 
you've made enough measurements to know where your bottlenecks are, and 
don't trade usability for performance unless that's what the project 
requirements dictate.

Michael Kay
Saxonica

On 09/07/2010 15:25, David wrote:
> I believe most decent processors will "intern" the element names so 
> they are not duplicated in memory.
> Simply making element names longer only makes the serialized text 
> format longer, not the in memory format (by much).
>
> Now the serialized text format can be important when transmitting the 
> XML text file across some boundry (or disk space),
> as well as the time it takes to originally parse it (number of disk 
> bytes read & size of string compars etc).
>
>
> -------------------------
> David A. Lee
> dlee@calldei.com
> http://www.calldei.com
> http://www.xmlsh.org
>
>
> On 7/9/2010 10:17 AM, Nicholas Sushkin wrote:
>> "Don't abbreviate without necessity" principle has been on my mind 
>> for quite a
>> while. However, I always thought of memory consumption. Say you're
>> transforming an XML file with 1 million P2E elements with XSLT 
>> processor.
>> There is a big difference in memory consumption between the two 
>> element name
>> styles.<P2E>20</P2E>  vs<price-to-earnings-ratio value="20"/>  is 5 
>> vs 30
>> characters and, since XSLT builds the whole tree in memory which say 
>> takes 4
>> times the size of the file, about 20Mb vs 120Mb. Why wouldn't you save
>> yourself some memory and trouble?
>>
>> My question, is my reasoning still valid or it's been outdated by some
>> improvements in memory efficiency of XSLT processors?
>>
>> Thanks
>
> _______________________________________________________________________
>
> 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@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>



[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-2013 All Rights Reserved.