docbook-apps

  • 1.  The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-01-2010 13:12
    Hello,

    I generated from my DocBook xml file in the windows platform the xsl-fo files 1) with compiled fo\docbook.xsl and 2) with the un-compiled fo\docbook.xsl and the speed was for the first case 28 seconds and 29 seconds for the second case. So the compiled was only one second faster.

    What is your experience about speed with fo\docbook.xsl when comparing the compiled stylesheet to the un-compiled stylesheets?

    1) the compiled fo\docbook.xsl commands:

    Compilation:

    C:\Documents and Settings\mitapana\My Documents\xml2pdf\examples>c:\java\jdk1.5.
    0_13\jre\bin\java -cp .;..\saxon\saxon9ee.jar com.saxonica.CompileStylesheet ..\
    docbook\docbook-xsl-1.75.2\fo\docbook.xsl docbook.sxx

    Running:

    C:\Documents and Settings\mitapana\My Documents\xml2pdf\examples>c:\java\jdk1.5.
    0_13\jre\bin\java -cp .;..\saxon\saxon9ee.jar net.sf.saxon.Transform -s:100.xml
    -c:docbook.sxx -o:100saxonComp.fo
    Saxon evaluation license expires in 30 days
    Making portrait pages on USletter paper (8.5inx11in)

    2) the un-compiled fo\docbook.xsl running command:

    C:\Documents and Settings\mitapana\My Documents\xml2pdf\examples>c:\java\jdk1.5.
    0_13\jre\bin\java -cp .;..\saxon\saxon9ee.jar net.sf.saxon.Transform -s:100.xml
    -xsl:..\docbook\docbook-xsl-1.75.2\fo\docbook.xsl -o:100saxon.fo
    Saxon evaluation license expires in 30 days
    Warning: at xsl:stylesheet on line 8 column 31 of docbook.xsl:
    Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
    Making portrait pages on USletter paper (8.5inx11in)

    BR,

    Mika

    Mika Tapanainen
    IT Consultant

    Digia Plc
    Hiomotie 19, FI-00380 HELSINKI
    Email: mika.tapanainen@digia.com
    Tel: +358 (0) 10 313 3000 Mobile: +358 (0)40 764 7939 Fax: +358 (0) 10 313 3700
    Visit us at: www.digia.com
    ------------------------------------------------------------------
    PRIVACY AND CONFIDENTIALITY NOTICE
    This message and any attachments are intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee you should not disseminate, copy or take any action in reliance on it. If you have received this message in error, please contact the sender immediately and delete the message and any attachments accompanying it. Digia Plc does not accept liability for any corruption, interception, amendment, tampering or viruses occurring to this message.
    -----------------------------------------------------------------



  • 2.  Re: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-01-2010 16:30
    Tapanainen Mika wrote:

    > I generated from my DocBook xml file in the windows platform the xsl-fo files 1) with compiled fo\docbook.xsl and 2) with the un-compiled fo\docbook.xsl and the speed was for the first case 28 seconds and 29 seconds for the second case. So the compiled was only one second faster.

    I don't know how large are your documents and how fast is your computer,
    but 28 seconds is quite long time. Are you sure that process is not
    slowed down by some other factor -- like accessing networking for
    fetching other resources -- for example DTD if you are using DocBook 4.5
    and you don't have catalogs setup properly.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 3.  RE: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 04:56
    There is no network traffic, all files are in my laptop.

    My target pdf has 324 pages.

    So is there something wrong with the Saxon or DocBook settings etc. because the compilated stylesheets are so slow?

    >


  • 4.  Re: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 05:33
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: RIPEMD160

    On 07/02/2010 06:55 AM, Tapanainen Mika wrote:

    Hi,

    > There is no network traffic, all files are in my laptop.
    >
    > My target pdf has 324 pages.
    >
    > So is there something wrong with the Saxon or DocBook settings etc.
    > because the compilated stylesheets are so slow?

    I just checked my own set-up. My target documents are about the same
    size as yours and the complete build process takes about 28 seconds.

    However, only 6 seconds of that time are spent on the step of
    transforming the DocBook to FO, which is where the compiled stylesyheets
    could make a difference.
    The rest is spent in turning the FO into a PDF.

    There are of course many possible causes for the difference in our numbers.

    It would be useful to know a little more about your laptop (CPU and
    memory), the version of Saxon you use, the version of the stylesheet,
    the setup you use to compile the stylesheets, how you transform them,
    how large are the source XML files and what's the memory consumption of
    the Java VM while it transforms your file.

    Also, if I read your initial mail right, the numbers apply to the
    standard stylesheet without customization, right?

    With these numbers, it might be possible to reproduce the behavior and
    investigate further.

    Juri Memmert

    - --
    "It might help if we ran the MBA's out of Washington."
    -- Admiral Grace Hopper
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.10 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iEYEAREDAAYFAkwteggACgkQeKE9NrxdrXxzpgCeOFUXHC1aHlS+gFFBMamYR/KX
    RUwAoJKgsEaCDDsOjWkUW5odtANLUray
    =Mbzx
    -----END PGP SIGNATURE-----



  • 5.  RE: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 06:57
    I'm transforming the xml to the fo. And that takes about 25-26 seconds with compiled stylesheet and un-compiled stylesheet. I changed to Java 6, because to be sure that Java 5 is not problem here.

    I attached the starting XML (I hope the attachments are not too big for the mailing list).

    I attached also the Java VisualVM pictures about the compiled stylesheet running and the un-compiled stylesheet running.

    The compiled stylesheet compile command:

    C:\Documents and Settings\mitapana\My Documents\xml2pdf\examples>java -cp .;..\s
    axon\saxon9ee.jar com.saxonica.CompileStylesheet ..\docbook\docbook-xsl-1.75.2\f
    o\docbook.xsl docbook.sxx
    Serializing compiled stylesheet
    Finished serializing stylesheet

    The compiled stylesheet running command:

    C:\Documents and Settings\mitapana\My Documents\xml2pdf\examples>java -cp .;..\s
    axon\saxon9ee.jar net.sf.saxon.Transform -s:100.xml -c:docbook.sxx -o:5saxonComp
    .fo
    Saxon evaluation license expires in 29 days
    Making portrait pages on USletter paper (8.5inx11in)

    The un-compiled stylesheet running command:

    C:\Documents and Settings\mitapana\My Documents\xml2pdf\examples>java -cp .;..\s
    axon\saxon9ee.jar net.sf.saxon.Transform -s:100.xml -xsl:..\docbook\docbook-xsl-
    1.75.2\fo\docbook.xsl -o:100saxon.fo
    Saxon evaluation license expires in 29 days
    Warning: at xsl:stylesheet on line 8 column 31 of docbook.xsl:
    Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
    Making portrait pages on USletter paper (8.5inx11in)

    DocBook stylesheet version: 1.75.2
    Saxon-EE version: 9.2.1.1

    I'm using standard stylesheet and there are no customization.

    > the setup you use to compile the stylesheets

    What you mean about setup? Is there special settings I have to know?

    Is it so that whole process from the xml to pdf takes from you 28 seconds? Because for me this time goes for the xml to fo. From the fo to pdf it is about 13.9 - 59 seconds depending on the XSL-FO processor.

    What is your whole setup to transform the xml to pdf? What are the xsl and xsl-fo processors you are using?

    Thanks a lot about answers so far.

    >

    Attachment(s)

    xml
    100.xml   921 KB 1 version


  • 6.  Re: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 15:39
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: RIPEMD160

    Hi,

    thank you for all the input. ll see whether I can reproduce the problem
    and maybe shed some light on the issue.


    Juri

    - --
    I'm rated PG-34!!
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.10 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iEYEAREDAAYFAkwuB/AACgkQeKE9NrxdrXzR7ACfRxExoo15LCSoVdrivhh++lNz
    GR8AnizvMoI5SWE6z9ACXyNsE+1FQDaF
    =80YE
    -----END PGP SIGNATURE-----



  • 7.  Re: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 08:15
    Tapanainen Mika wrote:
    > There is no network traffic, all files are in my laptop.
    >
    > My target pdf has 324 pages.

    Well, so your build times correspond to generating .pdf files, not just
    .fo files? If so then times are not surprise to me, the most of time is
    spent by formatting .fo to resulting PDF. It doesn't make sense to
    optimize step in your toolchain if it is not the slowest one.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 8.  RE: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 09:13
    No. From the xml to fo is the slowest part currently.
    For the fastest xsl-fo processor it takes 13.9 seconds to transform from fo to pdf.

    To transform xml to fo takes 25 seconds with the compiled stylesheets and 26 seconds with the un-compiled stylesheets. So
    It is only 3% faster to use the compiled stylesheets. So why it is possible it is so slow to use the compiled stylesheets?

    >


  • 9.  Re: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 10:41
    Tapanainen Mika wrote:

    > It is only 3% faster to use the compiled stylesheets. So why it is possible it is so slow to use the compiled stylesheets?

    Saxon stylesheet compilation only improves startup time. Stylesheets are
    not compiled into byte-code but into Saxon internal structure. If you
    run compiled stylesheet there is no need to parse and analyze it again,
    but execution speed is same as with normal non-complied stylesheets.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 10.  RE: [docbook-apps] The compiled Saxon DocBook stylesheets doesn't speed anything??

    Posted 07-02-2010 11:08
    Maybe for the DocBook stylesheets there is no sense to use compilation with Xalan??

    For rather big xml (about 1M) the advantage is 3% (25 and 26 seconds) and for the small xml (10KB) it was same time (4 seconds) to transform xml to the fo.

    >