Solved

about xml transform performance

Posted on 2001-08-21
2
283 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now