You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Lars Fastrup <li...@fastrup.net> on 2000/06/19 10:18:49 UTC

Cocoon performance

Hi!

I have recently installed Coocon and played around with it, and its
really really cool stuff. But at what price does it come. Does anybody
know, or have anybody tested how it performs compared to JSP? Because
there are some alarm bells inside my head that says: All this XML
generating and XSL processing on the fly, must cost a great deal of CPU
power.

Lars Fastrup



Re: Cocoon performance

Posted by Stefano Mazzocchi <st...@apache.org>.
Lars Fastrup wrote:
> 
> Hi!
> 
> I have recently installed Coocon and played around with it, and its
> really really cool stuff. But at what price does it come. Does anybody
> know, or have anybody tested how it performs compared to JSP? Because
> there are some alarm bells inside my head that says: All this XML
> generating and XSL processing on the fly, must cost a great deal of CPU
> power.

Yes, it does. Cocoon1 takes about 200ms to generate a dynamic page,
xslt-tranform it and serialize it in HTML. A little more if the page is
FOP-formatted into PDF (but not much more). This is done on my home PC
(which is a Celeron 450, not really that great of a serving machine).

Consider that Cocoon2 (currently in pre-alpha stage) lowers that by
almost an order of magnitude, given the ability to reuse pre-processed
stylesheets and SAX-based fully event-driven architecture. (even
compiled pages generate SAX events!)

I don't have numbers, but I'd guess that performing XSLT-transformation
is not that much heavier than performing request-dispatching between
servlets and JSP (for HTML-generating JSP, of course)

For XML-generating JSP, there will be no competition: while XSP
(Cocoon's compiled server pages) are compiled to generate directly SAX
events, JSP are compiled to generate streams of characters. This will
necessary require a stream parsing stage after the dynamic content
generation that Cocoon simply precompiles.

While it is true that Cocoon is slower than HTML-generating JSP, this is
like comparing apples with oranges.

On the other hand it can be said that Cocoon will _always_ be faster
than XML-generating JSP when content post-processing is performed on the
server side. No matter how optmized the JSP engine will end up being.

XSP and JSP are very similar but where designed for different things.
XSP performs poorly when it mimics JSP functionalities, the same can be
said for JSP.

It's entirely up to you to decide what functionality you need today and
you'll need in the future and plan your tecnology adoption plan by
consequence.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------