Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Michael Kay <michael.h.kay@nt...>  20021129 14:00:56

I've considered on occasions writing a driver (similar to the JDOM interface) that allows Saxon to run directly on a thirdparty DOM. It's technically feasible, but the chances are it would be pretty slow in many cases, because of the problem of sorting nodes into document order (as well as the lack of NamePool support, the need to do whitespace stripping on the fly, and so on). So if you supply a DOM as input, it first has to be deconstructed and rebuilt as a Saxon tree. I don't think there's any obvious way of making this go substantially faster. I'm not sure why you're doing the tree building yourself rather than leaving it to Saxon to do, unless it's so that you can use the resulting tree more than once; but this isn't affecting the performance. If you absolutely need to precede the XSLT transformation with an application that uses a mutable DOM, then I don't see any obvious alternative to what you're doing. How big is the tree, and how long does the conversion take? Michael Kay > Original Message > From: saxonhelpadmin@...=20 > [mailto:saxonhelpadmin@...] On Behalf Of=20 > haexel@... > Sent: 29 November 2002 13:01 > To: saxonhelp@... > Subject: RE: [saxon] saxon performance >=20 >=20 > > Where is the performance problem? Is it in converting the=20 > Xerces DOM=20 > > to a Saxon tinytree, or is it in the subsequent=20 > transformation of the=20 > > tree? > >=20 > > Michael Kay > >=20 > Hi, > I think the performance of the subsequent transformation of=20 > the tree depends on the stylesheets we are using. I have to=20 > analyse them first, perhaps they include some clumsy=20 > expressions. The conversion from Xerces DOM to Saxon tinytree=20 > I wanted to make as fast as possible because it takes place=20 > for each transformation. I took saxon's sources and looked=20 > what happens when passing a Xerces DOM to the Trax transform=20 > method( class Controller). The result is the sourcecode=20 > below. Can this conversion made be faster? Saxon itself=20 > traverses the Xerces DOM and fires the appropriate SAX events=20 > and then builds the tinytree from these events. >=20 > Finally my performance problem is this conversion. > Thanks=20 >=20 > haex >=20 >=20 > > > Original Message > > > From: saxonhelpadmin@... > > > [mailto:saxonhelpadmin@...] On Behalf Of=20 > > > haexel@... > > > Sent: 28 November 2002 15:43 > > > To: saxonhelp@... > > > Subject: [saxon] saxon performance > > >=20 > > >=20 > > > Hi, > > > I have an existing system( a multithreaded webapp) that uses > > > xalan and I am integrating saxon. It uses a xercesdom for=20 > > > collection some data. The last step is that I want to=20 > > > transform this dom with a stylesheet. I do the following: > > >=20 > > > I have a Document d (Xerces) > > > then > > > Document doc =3D getTinyTree(d) > > > and transform it > > > trafo.transform(doc, ...) > > > // helper function: > > > Document getTinyTree(Document d) { > > > DOMSource domSource =3D new DOMSource(doc); > > > Controller saxonController =3D new Controller(); > > > saxonController.setTreeModel(Builder.TINY_TREE); > > > TransformerFactoryImpl tfFImpl =3D=20 > > newTransformerFactoryImpl(); > > > SAXSource saxSource =3D tfFImpl.getSAXSource(domSource, > > false); > > > Builder bi =3D saxonController.makeBuilder(); > > > DocumentInfo dInfo =3D bi.build(saxSource); > > > return (Document)dInfo; > > > } > > >=20 > > > I do this because I want to store the TinyTree for various > > > frame requests. Now, for one request it should be the same=20 > > > as: Document d (Xerces) trafo.transform(new DOMSource(d)) > > >=20 > > > However this solution does not perform very well, sometimes > > > slower than xalan. > > >=20 > > > Any ideas how to optimise this? > > > All help is welcome > > >=20 > > > Greets > > >=20 > > > haex > > >=20 > > >  > > > Neu: Fakten testen jetzt noch g=FCnstiger 35% billiger + ein=20 > > > Geschenk Ihrer Wahl!! = http://bonus.gmx.net/?gid=3D42241803&prid=3D687 > > >=20 > > >=20 > > >=20 > > >  > > > This SF.net email is sponsored by: Get the new Palm Tungsten T > > > handheld. Power & Color in a compact size!=20 > > > http://ads.sourceforge.net/cgibin/redirect.pl?palm0002en > > > _______________________________________________ > > > saxonhelp mailing list > > > saxonhelp@...=20 > > > https://lists.sourceforge.net/lists/listinfo/s>; axonhelp > > >=20 > >=20 >=20 > =20 > Neu: Fakten testen jetzt noch g=FCnstiger 35% billiger + ein=20 > Geschenk Ihrer Wahl!! http://bonus.gmx.net/?gid=3D42241803&prid=3D687 >=20 >=20 >=20 >  > This SF.net email is sponsored by: Get the new Palm Tungsten T=20 > handheld. Power & Color in a compact size!=20 > http://ads.sourceforge.net/cgibin/redirect.pl?palm0002en > _______________________________________________ > saxonhelp mailing list > saxonhelp@...=20 > https://lists.sourceforge.net/lists/listinfo/s>; axonhelp >=20 