Re: XML::Saxon::XSLT2
Maurice Mengel <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
Hi, I am really not experienced in measuring performance. Here is just a first attempt using the xml and xslt I am currently dealing with. If you are only interested in the result see last paragraph. If you want me to upload the actual files I can do so, maybe you also have ideas for a better methodology. Methodology for now is compare saxon via command line and through lnline::Java. I take a random real word xml file of mine with 10 MB size and the last xslt2 transformation I wrote and run it with performance report on saxon (e.g. -t -repeat:10) Saxon reports: Average execution time over 10 runs: 6960ms (with xsl:message see below) Saxon reports: Average execution time over 2 runs: 5265ms (without xsl:message see below) I guess I have to add some time for the stylesheet compilation time: 1360 miliseconds (first) and 31 miliseconds (second) for the run without xsl:message. Now I run the same transformation (twice manually) thru XML::Saxon::XSLT2 (via Inline) and I get Time taken was 26 wallclock secs ( 6.92 usr 1.33 sys + 0.00 cusr 0.00 csys= 8.25 CPU) seconds. (with xsl:message, but not printed to STDOUT) Time taken was 24 wallclock secs ( 6.97 usr 1.27 sys + 0.00 cusr 0.00 csys= 8.23 CPU) seconds. (without xsl:message) Now the whole thing is not really comparable, because via Saxon I output a lot of <xsl:message>s, while via Inline I don't print them on the screen, so I change that and uncomment my xsl:message and run everything again. Results above. Also I should probably use perl's benchmark on both runs to get more comparable input. If I do that and run Saxon through a perl script via a system call and benchmark it, it shows that saxon is considerably faster: 8-9 wallclock seconds indicating that Inline::Java is slightly less than 3 times slower (with these xml and xslt files). That's still faster than I expected and for unifying my environment (everything practically in perl) I am gladly paying that price in performance. So far for now. On Mon, Aug 23, 2010 at 10:06 AM, Tod Harter < [email protected]> wrote: > Yeah, there's nothing slow or buggy about Java XML processing. Nothing > really slow or buggy about Java stuff in general, it is just not nearly as > easy to slap something together quickly like it is in perl. Once it works it > works well. OTOH I too would look at Inline::Java warily. TBH if you're > going to be going that way anyhow it probably makes more sense to just write > a java application. If the main goal is to run stuff through XSLT perl isn't > adding a whole lot and there are extensive Java libraries and frameworks for > that. > > On Mon, Aug 23, 2010 at 8:18 AM, Robin Berjon <[email protected]> wrote: > >> On Aug 23, 2010, at 14:11 , Thomas Krichel wrote: >> > Robin Berjon writes >> >> Well, I can't speak for Toby but if you look at the source you'll >> >> see that it relies on Inline::Java to do its magic. That's neat and >> >> all but it's also a little bit scary — I don't know that >> >> Inline::Java has seen that much real world usage. >> > >> > Wouldn't that also make it slow? When I think JAVA I think >> > slow and buggy... >> >> The only way to know for sure is to benchmark it. I would *guess* that >> crossing the Perl/Java boundary will come at a cost, but that what happens >> inside of Saxon itself would be fast. Saxon is a really good implementation, >> it's really fast. >> >> -- >> Robin Berjon - http://berjon.com/ >> >> >> >> _______________________________________________ >> Perl-XML mailing list >> [email protected] >> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs >> > > > > -- > The Wise adapts himself to the world. The Fool adapts the world to himself. > Therefore, all progress depends on the Fool. > > _______________________________________________ > Perl-XML mailing list > [email protected] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs