Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 3rd, 2015, 04:37 PM
Authorized User
 
Join Date: Apr 2008
Posts: 70
Thanks: 17
Thanked 1 Time in 1 Post
Send a message via Yahoo to iceandrews
Default Timing Profile - Looping Maximum

We're running a command line Timing Profile on a certain XSLT that's running on the Saxon 8.9 processor (-TP). It's a very large input message and we have a template that's recursive in nature so it's running over and over and we expect it to occur around 1400 times in this message.

The message processes successfully when TP is turned OFF, but when we try and profile it the profiler stops and spits out this message after about ~1200 calls.

Code:
<template name="Relate" file="*DataAccess.xsl" line="1200" time="1433361673092">
<template name="Relate" file="*DataAccess.xsl" line="1200" time="1433361673092">
<template name="Relate" file="*DataAccess.xsl" line="1200" time="1433361673092">
Error at xsl:call-template on line 1205 of file:/C:/Users/BLERG/Desktop/Enterprise%20Constraints%20Profile/InTrans_DataAccess.xsl:
  Too many nested template or function calls. The stylesheet may be looping.
Transformation failed: Run-time errors were reported
Is there any way to tweak the depth of recursion on the Timing Profiler? We know it's not infinite and would like to complete profile.

Thanks
 
Old June 3rd, 2015, 04:43 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

When tracing is switched on (as it is when you use -TP), Saxon disables tail call optimization, which means that recursive templates can blow the stack. The reason is that tail call optimization makes it very difficult to analyze what's going on. If the recursive depth is related to input data size, I suggest you try to do the performance profiling on a smaller document and extrapolate the results.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old June 3rd, 2015, 04:53 PM
Authorized User
 
Join Date: Apr 2008
Posts: 70
Thanks: 17
Thanked 1 Time in 1 Post
Send a message via Yahoo to iceandrews
Default

Excellent response and kind of what I figured. Is there a hard limit to the Timing Profiler tail call detection (like a specific number of loops/memory usage) before it bails out?

While the performance in this case certainly is impacted input message size, it's not a linear performance degradation. So if we reduce the message size, we don't as accurate of performance information on the high end.
 
Old June 3rd, 2015, 05:21 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Saxon is simply detecting a Java StackOverflow and trying to explain it in XSLT terms. If you can find a way to increase the Java stack size then that should help.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
SCRIPT TIMING OUT RinoDM Classic ASP Databases 3 September 24th, 2009 07:03 PM
timing out issue... RinoDM SQL Server 2000 1 September 24th, 2009 05:02 PM
HTTPWebRequest GetResponse Timing-out amahajan .NET Web Services 0 July 13th, 2005 11:54 AM
timing issue riteshu C++ Programming 2 September 22nd, 2004 07:10 AM
database timing gmoney060 BOOK: Beginning ASP 3.0 1 June 2nd, 2004 06:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.