I'm in the market for an XSLT profiler.
I'm using the Xalan-j XSLT processor from Apache.
I'd like to be able to run the profiler under Windows or Linux as we have different teams using the same XML and XSLT on different platforms.
The tool needs to be able to work with exslt extensions.
The tool needs to be able to work with large (MB) input XML documents.
I'm not entirely adverse to paying for the right tool, but free (as in beer) would be nice.
I'm interested in hearing from people who have successfully used the tool that they recommend.
EDIT: updated, yes, xalan-j
I'm assuming you're talking about Xalan/J; I'm not aware of the options for Xalan/C++.
Stylus Studio had one in older versions, but it was dropped for Xalan in the current release.
The only other commercial one for Xalan that I am aware of that is any good is from Oxygen.
Note that sometimes switching on the profiler switches the XSLT engine into a debugging mode so that certain optimizations are not performed, so the profiler results should be taken with some common sense.
On-line XSLT processor based on xalan-2.7.1 with profiler information: http://xslt-profiler.appspot.com/
Related
I found a post, please see the IBM formum post, where it says creating pre-compiled java classes (Translets) using Apache Xalan utility transforms XML files faster than just using XSLT.
I have been XSLT 2.0 but it is not working because Xalan only supports XSLT 1.0. The Saxon processor supports XSLT 2.0 but there is no utility to generate Translets.
Any suggestions?
The version of Xalan that compiles to bytecode translets is generally referred to as XSLTC. We did some recent performance measurements of Saxon-EE performance against XSLTC, which we reported at XML London 2014 (our paper is available at http://www.saxonica.com/papers/xmllondon-2014mhk.pdf) and the measurements we made are on Github at https://github.com/Saxonica/XT-Speedo. For the collection of tests we ran, Saxon-EE came out ahead by a whisker: as a crude summary, XSLTC ran a little faster on most tests, and Saxon-EE ran a lot faster on a few tests, so the results you get will depend very much on your workload. But the differences are a few percentage points, so it's very unlikely to really affect your ability to meet your project requirements. The productivity benefits of XSLT 2.0 over XSLT 1.0 are much more important for most projects than a 5% performance difference.
I think the Enterprise edition of Saxon 9.5 provides compilation to byte code, see the feature matrix http://www.saxonica.com/feature-matrix.html which says about that feature: "Available for both Java and .NET platforms, typically giving a 25% performance boost.".
As for IBM, it also has an XSLT 2.0 implementation available as part of Websphere, see http://www-03.ibm.com/software/products/en/xmlfp/, but I don't know whether it provides compilation of XSLT to Java classes or to Java byte code.
I'm in a bit of a weird spot. Due to events too ridiculous to list here, I'm working with a system that uses an unknown XSL engine. I'm fairly certain it's MSXML. The problem is that I'm not entirely sure which version (this is important). The original devs aren't available, and I have very limited access to the back end. What I do have the ability to do is author content (that gets fed through the XSLT sheets) and to edit the XSLT itself. Given these two abilities, is there any way I can make the parser report its version? Anything like PHP's phpversion()? Maybe even a standard way to report the XSL engine vender and version?
I'd be very willing to write a feature check sheet, if I could just find a list of XSL engines, and features unique to each.
You can process this XSLT stylesheet with your XSLT processor, it outputs some system properties, including the Microsoft msxsl:version.
<xsl:value-of select="system-property('xsl:vendor')"/> will tell you if it is Microsoft, but there is no property in XSLT 1.0 to tell you the version, only in XSLT 2.0.
Are there any static or dynamic code analysis tools that analyze XSLT/XSL code?
The resources I have been able to find so far are:
1. Oxygen xml editor
2. http://gandhimukul.tripod.com/xslt/xslquality.html which looks faily basic in its capabilities
There are quite a few testing tools and verifiers at Tony Graham's XSLT Testing Tools page. If you haven't looked there, it's a fairly comprehensive list.
Using Saxon in schema-aware mode will catch many common errors.
You've already discovered Mukul Gandhi's XSL Quality tools, which support user-added extensions. On the xsl-list run by Mulberry Technologies a while back, several other people contributed ideas for new rules also. You might also get help asking there.
Stylus Studio, Oxygen and xmlspy have profilers for run-time performance.
XML Spy includes an XSLT profiler. That should fulfil your dynamic analysis needs if you can afford it.
There is also StylusStudio, a plugin for VisualStudio and CatchXSL (which is free).
I just downloaded and built the libraries/executables of Google Performance Tools. Before I run the CPU profiler on the application that I want to investigate, I want to learn how to use the tools properly perhaps on a sample application. What would be a good example to run the Google CPU profiler on? Thanks in advance.
The following paragraph appears in the README.windows file distributed with perftools 1.3:
The heap-profiler has had a preliminary port to Windows. It has not been well tested, and probably does not work at all when Frame Pointer Optimization (FPO) is enabled -- that is, in release mode. The other features of perftools, such as the cpu-profiler and leak-checker, have not yet been ported to Windows at all.
In my experience, for performance tuning, stack-sampling is the method of choice.
Google perftools contains a stack-sampler, and I believe its visual analyzer can be made to show the cost of individual statements, not just functions.
What you need to know is the percent of time the stack contains that statement, because that is how much time would be saved if the statement were removed.
I'm looking for an XSL lint tool which is actively maintained. The only one I can find is this one, but the last update was in 2000 (9 years old!). Any help would be great!
Phillip,
Creating a good lint for xlst is quite hard, because validity of xslt templates depends on the parser that is used. Each parser has it own extensions.
For example java's xalan can be easily extended with custom xpath functions, which are obviously coded in java. Because of that any .net validator will fail to validate advance xalan's xslts.
So first of all you need to know what processor you are going to use. If you use java based processors I recommend to use Eclipse which can validate the templates on the fly.
I've tired two eclipse plugins, It is worth mentioning that both support debugging and xslt/xpath code completion:
Oxygen XML editor - a commercial (~$300) XML/XSLT editor/eclipse plugin.
It can use the following engines: Xalan, Saxon, Xsltproc,
It is able to check:
correctness of xsl:template
correctness of name attribute of xsl:call-template
duplicated definition of xslt variables
validity of dtd's
validity of xslt header
validity of xml namespaces
validity of XPath
validity of xsl:value-of if an xml is associated to xslt
correctness of xsl:import for local and remote files (it support xml catalogs)
I must say that the plugin is really good but on the other hand it isn't open source.
XSLT Project - an open source plugin (it is part of Eclipse Web Tools Platform).
It is quite young (started in September 2008), however it has very active community. Currently it supports only Xalan and JAXP.
It detects the following errors and warnings:
invalid xslt header
incorrect dtd
incorrect imports (it handle only relative imports, xml catalogs are planed for version
1.1)
The above list is definitely incomplete because lack of support for xml catalogs made this project unusable for me.
Yes, look at this one, published Dec. 2008:
http://lists.xml.org/archives/xml-dev/200812/msg00178.html
You should look for "XSL profiler" or "XSL debugger". There are dozens of these.