Hi Michael,

You wrote:

>> We're seeing execution times on .NET that are typically anything from 25% to 50% (but in one case 100%) higher than on Java; we think that's probably reasonable.


I'm curious if this is a general statement, that saxonica execution under .NET give better performance than under Java?

thanks for any clarification

Alan PAINTER
Team Colossus | Strategic Components
15, rue Vernet, 75419 Paris, France
_____________________________________________

Phone  +33 (0) 1 40 70 31 19
Mobile +33 (0) 6 75 13 29 29
Email alan.painter@hsbc.fr


_____________________________________________





De :        Michael Kay <mike@saxonica.com>
A :        Mailing list for the SAXON XSLT and XQuery processor <saxon-help@lists.sourceforge.net>
Date :        10/04/2013 07:00 PM
Objet :        Re: [saxon] Saxon-HE 9.4N performance - transform.exe vs. Saxon.Api




We've now satisfied ourselves that the performance anomalies were entirely due to the whitespace-stripping differences: that is, in the API case you were constructing a tree containing all the whitespace, whereas in the command line case the whitespace is stripped during the process of tree construction.

We were being seriously misled for a while by the fact that the profiler results seemed to be heavily distorted by calls to system date/time functions. We eventually got to the bottom of the issue when we inserted our own counters to see what methods were being executed how often.

We're seeing execution times on .NET that are typically anything from 25% to 50% (but in one case 100%) higher than on Java; we think that's probably reasonable.

The overhead of "dynamic space stripping" on .NET was significantly higher than on Java (this is the case where we had the 100% factor). My instinct would be that this has something to do with the cost of allocating and garbage-collecting large numbers of short-life objects.

Michael Kay
Saxonica


On 25 Sep 2013, at 13:48, Emanuel Wlaschitz wrote:

> It seems I just came across a similar performance difference as someone
> already noticed 5 years ago in
>
http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/net-components-performance-question-td8223.html
>
> Running a transformation using transform.exe takes about 5 minutes for a
> reasonably complex stylesheet (about 500kb of source, split into roughly 35
> included modules) and a 5 MB xml file.
> The same thing with Saxon.Api takes about 30 Minutes for no appearent
> reason.
>
> As this is Saxon-HE, the old suggestion of using allNodesUntyped does not
> apply (it seemed to have been removed with the move from Saxon-B to Saxon-HE
> somewhere around 9.2).
> Anything else I could do, short of using the Java-style classes directly
> (like transform.exe does)?
>
> I'm using Saxon-HE 9.4.0.6N on .NET 3.5SP1, in case it makes a difference.
> Ok, latest is 9.4.0.9, but I doubt it makes much of a difference.
>
> Regards, Emanuel
>
> ---------
> //relevant source, in case it matters:
> private readonly Processor _processor = new Processor(false);
> public void Transform(string sourcePath, string stylesheetPath, string
> outputPath)
> {
>                  using (var source = File.OpenRead(sourcePath))
>                  using (var stylesheet = File.OpenRead(stylesheetPath))
>                  {
>                                   Uri stylesheetUri, sourceUri;
>                                   if (!Uri.TryCreate(sourcePath, UriKind.RelativeOrAbsolute, out sourceUri))
>                                                    throw new ArgumentException(string.Format("Could not create an URI from
> source path '{0}'.", sourcePath), "sourcePath");
>                                   if (!Uri.TryCreate(stylesheetPath, UriKind.RelativeOrAbsolute, out
> stylesheetUri))
>                                                    throw new ArgumentException(string.Format("Could not create an URI from
> stylesheet path '{0}'.", stylesheetPath), "stylesheetPath");
>
>                                   var compiler = _processor.NewXsltCompiler();
>
>                                   compiler.BaseUri = stylesheetUri; //required to resolve stylesheet
> includes
>                                   compiler.ErrorList = new ArrayList();
>                                   var executable = compiler.Compile(stylesheet);
>                                   var transformer = executable.Load();
>                                   var builder = _processor.NewDocumentBuilder();
>                                   builder.XmlResolver = new DtdIgnoringResolver(builder.XmlResolver);
> //required to ignore DTDs in System IDs
>                                   builder.BaseUri = sourceUri;
>                                   transformer.InitialContextNode = builder.Build(source);
>                                   var destination = new Serializer();
>                                   using (var output = File.Open(outputPath, FileMode.Create))
>                                   {
>                                                    destination.SetOutputStream(output);
>                                                    transformer.Run(destination);
>                                   }
>                  }
> }
>
>
>
> --
> View this message in context:
http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/Saxon-HE-9-4N-performance-transform-exe-vs-Saxon-Api-tp12287.html
> Sent from the saxon-help mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
>
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at
http://saxon.markmail.org/
> saxon-help@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help


Ensemble adoptons des gestes responsables : N'imprimez ce mail que si necessaire. Les informations contenues dans ce message et les pieces jointes (ci-apres denomme le message) sont confidentielles et peuvent etre couvertes par le secret professionnel. Si vous n'etes pas le destinataire de ce message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez recu ce message par erreur, nous vous remercions de le supprimer de votre systeme, ainsi que toutes ses copies, et d'en avertir immediatement HSBC France et ses filiales par message de retour. Il est impossible de garantir que les communications par messagerie electronique arrivent en temps utile, sont securisees ou denuees de toute erreur, alteration, falsification ou virus. En consequence, HSBC France et ses filiales declinent toute responsabilite du fait des erreurs, alterations, falsifications ou omissions qui pourraient en resulter. Consider the environment before printing this mail. The information contained in this e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message by error, please delete it and all copies from your system and notify the sender immediately by return e-mail. E-mail communications cannot be guaranteed to be timely secure, error or virus-free. The sender does not accept liability for any errors or omissions which arise as a result.