[armedbear-cvs] r12360 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Mon Jan 11 19:23:48 UTC 2010


Author: ehuelsmann
Date: Mon Jan 11 14:23:45 2010
New Revision: 12360

Log:
Set initial ByteArrayOutputStream buffer to 2048; the default 32 way to small.

Modified:
   trunk/abcl/src/org/armedbear/lisp/ByteArrayOutputStream.java

Modified: trunk/abcl/src/org/armedbear/lisp/ByteArrayOutputStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ByteArrayOutputStream.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/ByteArrayOutputStream.java	Mon Jan 11 14:23:45 2010
@@ -47,7 +47,13 @@
     private ByteArrayOutputStream(LispObject elementType)
     {
         this.elementType = elementType;
-        initAsBinaryOutputStream(byteArrayOutputStream = new java.io.ByteArrayOutputStream());
+        initAsBinaryOutputStream(byteArrayOutputStream = new java.io.ByteArrayOutputStream(2048));
+        // based on statistics of ABCL's own .cls files
+        // as per 20100111, 2048 is the 70th percentile,
+        // meaning that only 30% of all .cls files is bigger
+
+        // However, *every* .cls file is bigger than 32 bytes;
+        // we want to prevent buffer resizing
     }
 
     @Override




More information about the armedbear-cvs mailing list