Project

Profile

Help

Support #4821

closed

Suggest performance improvement

Added by Libor Valenta over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2020-11-11
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Platforms:

Description

We have a transform we need to run on large amount of documents like the one provided in the sample. Author of the XSLT claims, that when he runs transform from his oXygen, it completes consistently faster (cca 2x) than when he runs the same transform on the same document from our Java application. We tried to create smallest approximation of the code in the Main.java in the attached benchmark.jar (you can run it with java -jar benchmark.jar)

Is there anything we can do on the Java level to make the transform run faster?

Is there any performance improvement advice I can pass to the XSLT developer?

Anything that would reduce the transform time would be appreciated. Thank you.

Actions #1

Updated by Michael Kay over 3 years ago

  • File deleted (benchmark.jar)
Actions #2

Updated by Michael Kay over 3 years ago

I have deleted the attachment because it contained a license file. Please take care to keep license files secure.

Actions #3

Updated by Michael Kay over 3 years ago

The most obvious thing that comes to mind from a quick look at your code is: don't use a DOMSource. Saxon is about 5-10 times slower processing a DOM tree than using its own internal TinyTree model.

Actions #4

Updated by Michael Kay over 3 years ago

  • Status changed from New to AwaitingInfo
  • Assignee set to Michael Kay

Please let us know whether changing from DOMSource to Saxon's native TinyTree accounts for the difference.

If we don't hear further from you we will close this.

Actions #5

Updated by Libor Valenta over 3 years ago

Thanks Michael and sorry for the license file, I didn't realize tickets are accessible to broader public. How do we really get the TinyTree? We ended up using SAXSource, and Apache Xerces with cache for DTDs, that helped substantially.

Actions #6

Updated by Michael Kay over 3 years ago

If you supply the input as a SAXSource then Saxon will construct a TinyTree by default, so it's doing the right thing here. You can exercise more control for example by using Saxon's DocumentBuilder class to build the tree.

Can we close this now?

Actions #7

Updated by Libor Valenta over 3 years ago

Yes, we can close this ticket. Thank you!

Actions #8

Updated by Michael Kay over 3 years ago

  • Status changed from AwaitingInfo to Closed

Please register to edit this issue

Also available in: Atom PDF