Details
Description
On some large templates (1-4MB) velocity gets very slow. I used JProfiler and found a lot of time is spent in VelocityCharStream.ExpandBuff. It is doing a lot of System.arraycopy.
The problem is that the size of the buffer is increased linearly in stead of exponentialy.
I have made a patch which doubles the size of the buffer in stead of incrementing it with the same value.
In my tests and in JProfiler it is shown that a lot less time is spent in ExpandBuff.