You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by "Roytman, Alex" <ro...@peacetech.com> on 2000/05/09 22:37:51 UTC

XMLSerializer performance

> Hello,
> 
> What is the most efficient way (in terms of speed and memory) to serialize
> SAX or DOM?
> I did some performance tests and was very surprised that the XMLSerializer
> showed the pretty poor results: 
> 
> Actual time does not matter I would like to show relative times
> 
> SAX ->	XMLSerializer	-> XML File	5 sec
> SAX ->	Xalan serializer	-> XML File	2 sec 
> SAX ->	Xalan stylesheet	-> XML File	6 sec 
> Oracle DOM print()	-> XML File	3 sec
> Oracle Stylesheet	-> XML File	9 sec 
> 
> As you can see XMLSerializer is almost as slow as applying a Xalan
> stylesheet and 2.5 times slower than Xalan serializer and almost twice as
> slow as Oracle serializer. This is with INDENT OFF.
> 
> May be did something wrong or I suppose to use some other means to
> serialize my SAX events. In my case I do not need pretty serialization or
> serialization to HTML or something else - I need PERFORMANCE. Serializing
> SAX or DOM is a fundamental operation - we need to get the best
> performance we can. I would be grateful if you can suggest any other means
> of serializing SAX (DOM)
> I also read somewhere that Xalan serializer will be deprecated and
> replaced with org.xml.serializer package. Is it true?
> 
> Thank you in advance
> 
> Alex Roytman
> Peace Technology, Inc.
> (301) 206-9696
> 
> 

Re: XMLSerializer performance

Posted by Arkin <ar...@exoffice.com>.
We intentionally made the serialiers inefficient so we'll have something
to work on :-)

Seriously, the serializers should be damn optimized with identation off.
In the test cases I run I compare them to println() and I get 100%
overhead, probably 50/50 between the use of SAX events and the
serializer state management. (RedHat 6.0, Sun JDK 1.2.2 with JIT)

Which version of Xerces are you using, or are you using the CVS version?
Do you have a class called org.apache.xml.serialize.Printer?

arkin


"Roytman, Alex" wrote:
> 
> > Hello,
> >
> > What is the most efficient way (in terms of speed and memory) to serialize
> > SAX or DOM?
> > I did some performance tests and was very surprised that the XMLSerializer
> > showed the pretty poor results:
> >
> > Actual time does not matter I would like to show relative times
> >
> > SAX ->        XMLSerializer   -> XML File     5 sec
> > SAX ->        Xalan serializer        -> XML File     2 sec
> > SAX ->        Xalan stylesheet        -> XML File     6 sec
> > Oracle DOM print()    -> XML File     3 sec
> > Oracle Stylesheet     -> XML File     9 sec
> >
> > As you can see XMLSerializer is almost as slow as applying a Xalan
> > stylesheet and 2.5 times slower than Xalan serializer and almost twice as
> > slow as Oracle serializer. This is with INDENT OFF.
> >
> > May be did something wrong or I suppose to use some other means to
> > serialize my SAX events. In my case I do not need pretty serialization or
> > serialization to HTML or something else - I need PERFORMANCE. Serializing
> > SAX or DOM is a fundamental operation - we need to get the best
> > performance we can. I would be grateful if you can suggest any other means
> > of serializing SAX (DOM)
> > I also read somewhere that Xalan serializer will be deprecated and
> > replaced with org.xml.serializer package. Is it true?
> >
> > Thank you in advance
> >
> > Alex Roytman
> > Peace Technology, Inc.
> > (301) 206-9696
> >
> >
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

-- 
----------------------------------------------------------------------
Assaf Arkin                                           www.exoffice.com
CTO, Exoffice Technologies, Inc.                        www.exolab.org

Re: XMLSerializer performance

Posted by Arkin <ar...@exoffice.com>.
We intentionally made the serialiers inefficient so we'll have something
to work on :-)

Seriously, the serializers should be damn optimized with identation off.
In the test cases I run I compare them to println() and I get 100%
overhead, probably 50/50 between the use of SAX events and the
serializer state management. (RedHat 6.0, Sun JDK 1.2.2 with JIT)

Which version of Xerces are you using, or are you using the CVS version?
Do you have a class called org.apache.xml.serialize.Printer?

arkin


"Roytman, Alex" wrote:
> 
> > Hello,
> >
> > What is the most efficient way (in terms of speed and memory) to serialize
> > SAX or DOM?
> > I did some performance tests and was very surprised that the XMLSerializer
> > showed the pretty poor results:
> >
> > Actual time does not matter I would like to show relative times
> >
> > SAX ->        XMLSerializer   -> XML File     5 sec
> > SAX ->        Xalan serializer        -> XML File     2 sec
> > SAX ->        Xalan stylesheet        -> XML File     6 sec
> > Oracle DOM print()    -> XML File     3 sec
> > Oracle Stylesheet     -> XML File     9 sec
> >
> > As you can see XMLSerializer is almost as slow as applying a Xalan
> > stylesheet and 2.5 times slower than Xalan serializer and almost twice as
> > slow as Oracle serializer. This is with INDENT OFF.
> >
> > May be did something wrong or I suppose to use some other means to
> > serialize my SAX events. In my case I do not need pretty serialization or
> > serialization to HTML or something else - I need PERFORMANCE. Serializing
> > SAX or DOM is a fundamental operation - we need to get the best
> > performance we can. I would be grateful if you can suggest any other means
> > of serializing SAX (DOM)
> > I also read somewhere that Xalan serializer will be deprecated and
> > replaced with org.xml.serializer package. Is it true?
> >
> > Thank you in advance
> >
> > Alex Roytman
> > Peace Technology, Inc.
> > (301) 206-9696
> >
> >
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

-- 
----------------------------------------------------------------------
Assaf Arkin                                           www.exoffice.com
CTO, Exoffice Technologies, Inc.                        www.exolab.org