remm 02/05/29 16:24:59 Modified: jasper2/src/share/org/apache/jasper Constants.java jasper2/src/share/org/apache/jasper/runtime BodyContentImpl.java Log: - Make the tag buffer size smaller, as suggested in bug 6858. - In addition, those buffers must be recycled and reused as much as possible, as we actually should only need an amount equal to the tag depth (if I understand things correctly). This should provide a major improvement. Revision Changes Path 1.2 +5 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Constants.java Index: Constants.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Constants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.java 28 Mar 2002 18:46:15 -0000 1.1 +++ Constants.java 29 May 2002 23:24:59 -0000 1.2 @@ -132,6 +132,11 @@ public static final int DEFAULT_BUFFER_SIZE = 8*K; /** + * Default size for the tag buffers. + */ + public static final int DEFAULT_TAG_BUFFER_SIZE = 256; + + /** * The query parameter that causes the JSP engine to just * pregenerated the servlet but not invoke it. */ 1.2 +5 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java Index: BodyContentImpl.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BodyContentImpl.java 28 Mar 2002 18:46:19 -0000 1.1 +++ BodyContentImpl.java 29 May 2002 23:24:59 -0000 1.2 @@ -79,7 +79,7 @@ public class BodyContentImpl extends BodyContent { private char[] cb; - protected int bufferSize = Constants.DEFAULT_BUFFER_SIZE; + protected int bufferSize = Constants.DEFAULT_TAG_BUFFER_SIZE; private int nextChar; static String lineSeparator = System.getProperty("line.separator"); private boolean closed = false; @@ -115,11 +115,11 @@ char[] tmp = null; - //XXX Should it be multiple of DEFAULT_BUFFER_SIZE?? + //XXX Should it be multiple of DEFAULT_TAG_BUFFER_SIZE?? - if (len <= Constants.DEFAULT_BUFFER_SIZE) { - tmp = new char [bufferSize + Constants.DEFAULT_BUFFER_SIZE]; - bufferSize += Constants.DEFAULT_BUFFER_SIZE; + if (len <= Constants.DEFAULT_TAG_BUFFER_SIZE) { + tmp = new char [bufferSize + Constants.DEFAULT_TAG_BUFFER_SIZE]; + bufferSize += Constants.DEFAULT_TAG_BUFFER_SIZE; } else { tmp = new char [bufferSize + len]; bufferSize += len;
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>