Solved

about xml transform performance

Posted on 2001-08-21
2
285 Views
Last Modified: 2008-03-17
we are now use apache's xalan for to process xml transform. but sometimes we should transform a big original xml file( about 1.4M), we get the test result is it need about more than 25 minutes to finish. but this is a web application and cant be acceptable. How could i improve the performance? and are there faster transformer?
0
Comment
Question by:seasmile
2 Comments
 
LVL 4

Accepted Solution

by:
edmund_mitchell earned 200 total points
ID: 6409535
There are several faster transformers.
The most current current benchmarks are here:
http://www.datapower.com/XSLTMark/res_2001_03_28.html#ChartOverall

and another benchmark is here:

http://www.tfi-technology.com/xml/xslbench.html

Neither are as up-to-date as they could be, but they'll give you a pretty good idea as to how far behind Xalan is.
If you need a Java-based processor, I would really recommend you look into either Saxon[1] or xt (if you don't use certain features of XSLT)[2].  Of these two, Saxon is what I'd recommend, hands down.  

Note that sometimes you can rewrite your stylesheet to improve performance as well - one simple example:
If I want to select the <d> elements from this xml:
<a>
  <b>
    <c>
      <d></d>
    </c>
    <c2>
      <d></d>
    </c2>
    <c3>
       <d></d>
    </c3>
  </b>
</a>


I can write select="//d" but that will waste tons of processing time, because the processor checks absolutely everywhere for <d> elements.  Much better is to tell it where to go whenever you can:
select='a/b/*/d'
This is just a simple example, but hopefully it conveys the point.  There are many improvements to performance besides this that can be made from a stylesheet-authoring perspective - the use of keys, etc.  Mike Kays book "XSLT: A Programmer's reference (2nd ed.) has some good suggestions, and you can find others on the web, too.

HTH

Edmund

[1] http://saxon.sourceforge.net/
[2] http://www.jclark.com/xml/
0
 

Author Comment

by:seasmile
ID: 6411941
Thank Edmund very much for your so detailed reply. I'll try the ways you told me. and of course I will give the points to you. thankx again.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question