cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Henne <j.he...@levigo.de>
Subject [C2] patch to serializers
Date Mon, 01 Oct 2001 18:48:22 GMT
Hi,

the Cocoon2 serializers for text, XML and HTML currently work very
inefficiently due to the fact that the underlying Xalan serializer writes
every character in a seperate call to the output stream's write() method. In
conjunction with a chunked transfer-encoding (the default for HTTP-1.1) this
leads to a 6-fold increase in the volume of data that hits the wire (it's
"1\r\n" plus the original character plus "\r\n" - just in case you wondered
:-).

The attached patch fixes the problem using a simple BufferedOutputStream. I've
placed the buffer creation into AbstractTextSerializer and removed buffer
creation code from AbstractSerializer. The buffer created in
AbstractSerializer was actually never used, because all subclasses of
AbstractSerializer either didn't use super.setOutputStream() or chose to
ingore AbstractSerializer's "output" field after calling
super.setOutputStream().
The fixed version works for me, but please review the patch carefully.

Joerg Henne
Mime
View raw message