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

Re: Managing debug logging in complex transforms: what

Subject: Re: Managing debug logging in complex transforms: what do people do?
From: Liam R E Quin <liam@xxxxxx>
Date: Wed, 26 Mar 2014 14:56:08 -0400
Re:  Managing debug logging in complex transforms: what
On Mon, 2014-03-24 at 18:02 -0400, Graydon wrote:
[...]
> Single digit integer minutes, quite often, outside debug mode.

I remember a client with a transformation that was taking I think 20
minutes on a relatively small file; in the end I preprocessed the style
sheet to add a trace message at the start of each template, and ran that
through a simple program (I might'v written a Perl script to do it) that
timestamped each line of the trace.

I got it down to running in a few seconds by finding a couple of places
where the stylesheet was needlessly looking at every element in the
document instead of the immediately preceding element, and then, inside
that, looking at every element in the document to see if it was the
following element, instead of asking for the following element, so
O(n^3)...

Debugging and optimizing is rarely that lucky, but the approach is still
useful if you have slow transformations, because once it only takes a
few seconds to run you'll feel much better about fixing a few bugs.

On the other hand I don't recommend optimizing something that doesn't
yet work, as the more work you put into it, the less you'll be willing
to rewrite altogether when you find parts that are wrong :-) and it's a
waste of your time, of course.

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

Current Thread

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
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.