Author: aadamchik
Date: Tue Feb 28 12:10:27 2012
New Revision: 1294608

URL: http://svn.apache.org/viewvc?rev=1294608&view=rev
Log:
CAY-1667 Expression parser performance optimization

tweaking the size of the remaning large buffer ... it was hardcoded 
inexplicably and there was no way to change it dynamically

Modified:
    
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/JavaCharStream.java

Modified: 
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/JavaCharStream.java
URL: 
http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/JavaCharStream.java?rev=1294608&r1=1294607&r2=1294608&view=diff
==============================================================================
--- 
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/JavaCharStream.java
 (original)
+++ 
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/JavaCharStream.java
 Tue Feb 28 12:10:27 2012
@@ -169,12 +169,12 @@ public class JavaCharStream
   protected void FillBuff() throws java.io.IOException
   {
      int i;
-     if (maxNextCharInd == 4096)
+     if (maxNextCharInd == nextCharBuf.length)
         maxNextCharInd = nextCharInd = 0;
 
      try {
         if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
-                                            4096 - maxNextCharInd)) == -1)
+                nextCharBuf.length - maxNextCharInd)) == -1)
         {
            inputStream.close();
            throw END_OF_STREAM_EXCEPTION;
@@ -435,7 +435,7 @@ public class JavaCharStream
     buffer = new char[buffersize];
     bufline = new int[buffersize];
     bufcolumn = new int[buffersize];
-    nextCharBuf = new char[4096];
+    nextCharBuf = new char[buffersize];
   }
 
 /** Constructor. */
@@ -464,7 +464,7 @@ public class JavaCharStream
       buffer = new char[buffersize];
       bufline = new int[buffersize];
       bufcolumn = new int[buffersize];
-      nextCharBuf = new char[4096];
+      nextCharBuf = new char[buffersize];
     }
     prevCharIsLF = prevCharIsCR = false;
     tokenBegin = inBuf = maxNextCharInd = 0;


Reply via email to