This is presumably comparing the cost of transforming an existing JDOM tree versus the cost of building a Saxon tree from scratch and transforming that. Of course, using the existing tree will usually win. But transforming an existing Saxon tree would be even faster.
 
Michael Kay


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Roger Kovack
Sent: 24 March 2004 17:14
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] Replacing Saxon 7.9's DOM implementation?



Michael Kay wrote:
You can now run Saxon over any DOM implementation if you supply the input as
a DOMSource, but there's a severe performance penalty.

  
Perhaps it depends on what you're doing.

Here is a series of performance tests comparing a wrapped JDOM and a StreamSource. Pg/sec is web pages per second. Kb/sec is web page size per second. A quick perusal of the last two columns shows the wrapped JDOM could run 4 times faster than a StreamSource or half the speed of a StreamSource.

But the performance differences also seem to be heavily influenced by the size of the result document with JDOM performance dropping as the result size increases. As a practical matter for web apps, the 7 - 10Kb web pages are far more likely to be used than a 200Kb web page.

All of these Xpath tests were run through saxon:evaluate() using Saxon 7.9

Source doc: 202Kb




Xpath result size (Kb) JDOM (Pg/sec) StreamSource (Pg/sec) JDOM (Kb/sec) StreamSource (Kb/sec)
//pkg-item/name 7.3 25 11 182.5 80.3
//pkg-item 304 1.2 2.4 364.8 729.6
//pkg-item[pkg-parent = root()//package/group/@guid] 302 1 1.7 302 513.4
//pkg-item[pkg-parent = root()//package[1]/group/@guid] 222 1.2 1.8 266.4 399.6
//pkg-item[pkg-parent = root()//package[5]/group/@guid] 9.8 1.6 2.6 15.68 25.48
//pkg-item[pkg-parent = root()//package[name = 'Executive chef']/group/@guid] 9.8 1.4 2.5 13.72 24.5
//pkg-item[pkg-parent = '63924803'] 9.8 23 10.05 225.4 98.49
//pkg-item[pkg-parent = root()//package[name = 'Econony flooring']/group/@guid] 222 1.1 1.7 244.2 377.4
doc[name = 'Kitchen'] 114 6 4.8 684 547.2
doc[name = 'Bed 3'] 156 5 3.6 780 561.6
doc[name = 'Bed 3']/(name | node-type | transparent) 5.6 46 11 257.6 61.6
doc[name = $p1/f1] 156 4.8 3.6 748.8 561.6
doc[name = 'Bed 3']/doc/pkg-item[2] 19 25 22 475 418
package[name = 'Executive chef'] 14 34 10 476 140

LMK if you want more details on this performance comparison.

Roger Kovack

However, you can't change the tree model that Saxon uses for temporary
trees. 

Michael Kay

# -----Original Message-----
# From: saxon-help-admin@lists.sourceforge.net 
# [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of 
# Andrzej Jan Taramina
# Sent: 24 March 2004 02:49
# To: saxon-help@lists.sourceforge.net
# Subject: [saxon] Replacing Saxon 7.9's DOM implementation?
# 
# Is it possible to replace Saxon 7.9's DOM implementation with 
# one that allows updates?
# 
# I'm trying to switch from using Xalan to using Saxon under 
# Cocon (2.1.4), but the read-only DOM implementation that is 
# in Saxon keeps throwing exceptions under Cocoon.
# 
# If this is doable, how do I go about doing it?
# 
# Or is this something that would not be recommended?
# 
# Thanks!
# 
# Andrzej Jan Taramina
# Chaeron Corporation: Enterprise System Solutions 
# http://www.chaeron.com
# 
# 
# 
# -------------------------------------------------------
# This SF.Net email is sponsored by: IBM Linux Tutorials Free 
# Linux tutorial presented by Daniel Robbins, President and CEO 
# of GenToo technologies. Learn everything from fundamentals to 
# system 
# administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
# _______________________________________________
# saxon-help mailing list
# saxon-help@lists.sourceforge.net
# https://lists.sourceforge.net/lists/listinfo/saxon-help
# 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help


  
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ saxon-help mailing list saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help