[Home] [By Thread] [By Date] [Recent Entries]
On 5/2/07, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> -Xss###k did not > help anything, which makes me believe that the maximum > recursive depth is enforced by Saxon somehow. > Initially I too thought -Xss didn't work, but it works on Saxon. So I tried java -Xss8192k -jar c:\dev\saxonb8-9-0-3j\saxon8.jar -it mainTemplate recursion.xsl with this stylesheet <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:f="http://factorial.com/"> <xsl:output omit-xml-declaration="yes"/> <xsl:template name="mainTemplate"> <xsl:value-of select="f:fac(10446)"/> </xsl:template> <xsl:function name="f:fac">
<xsl:param name="nr"/>
<xsl:sequence select="if($nr = 0) then 1 else f:fac($nr -1) * $nr" />
</xsl:function></xsl:stylesheet> and it gave the output similar to the Java Factorial program, however I couldn't and didn't want to measure the time because the time measurement is not precise anyway.
I tested the above on java version "1.6.0_01" Please note that -Xss8192k is not the ~minimum~ required memory to run the above factorial. I think the minimum would be lower, but I still need to approximate it. Michael Kay http://www.saxonica.com/
|

Cart



