You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Ronald Klop (JIRA)" <de...@velocity.apache.org> on 2007/11/16 16:52:43 UTC

[jira] Created: (VELOCITY-570) speed improvement of the tokenizer

speed improvement of the tokenizer
----------------------------------

                 Key: VELOCITY-570
                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.5, 1.4, 1.6
         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
Java: JDK 1.5

            Reporter: Ronald Klop
             Fix For: 1.6


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Ronald Klop (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613579#action_12613579 ] 

Ronald Klop commented on VELOCITY-570:
--------------------------------------

Hi,

Is there an idea about when this fix gets into a stable release?
I see there are beta's of velocity tools, but not for the velocity engine.

Ronald.


> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Jacob Mundt (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacob Mundt updated VELOCITY-570:
---------------------------------

    Attachment: expandbuff-speedup-reinit-fix.patch

The original patch doesn't reset the nextBufExpand increment when ReInit is called--so even after ReInit is called with a tiny buffer size, the nextBufExpand increment could still be very large--my simple test loop (parsing a 3MB template repeatedly) actually ran out of memory after a few iterations.

Attached a patch which fixes this.  I also changed the initial increment to be based on the buffer size, rather than always using 2048.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613610#action_12613610 ] 

Nathan Bubna commented on VELOCITY-570:
---------------------------------------

Releases happen when someone takes the time to push one through.  I don't know if i will really get to it amidst the busyness of summer, but i have been hoping to start pushing a 1.6 release process by summer's end.  I'm also rather anxious to start using features in 1.6...

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Erron Austin (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622967#action_12622967 ] 

Erron Austin commented on VELOCITY-570:
---------------------------------------

This patch has solved my OOM errors.  I would rate this patch as critical. Before applying the patch I was able to cause OOM memory in my app by simply navigating around the application. With the patch, I'm able to put a good amount of load with very good performance. I applied this patch with trunk as of August 14, 2008.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12543157 ] 

Will Glass-Husain commented on VELOCITY-570:
--------------------------------------------

Hey that's really fabulous.  Thanks so much for finding this issue and fixing it.  I'm sure future users with big templates will especially appreciate it.

One item I note is that that there's no unit test for VelocityCharStream.  If you felt like writing one and submitting it, that would be a nice addition to the test suite.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Reopened: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Will Glass-Husain reopened VELOCITY-570:
----------------------------------------


reopening to prompt review of new patch.  Thanks very much!

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Ronald Klop (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ronald Klop updated VELOCITY-570:
---------------------------------

    Attachment: expandbuff-speedup.patch

I have made the patch so that it touches as few lines as possible.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622588#action_12622588 ] 

Will Glass-Husain commented on VELOCITY-570:
--------------------------------------------

really?  It looked like a no-op to me.  I'll take another look.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613178#action_12613178 ] 

Will Glass-Husain commented on VELOCITY-570:
--------------------------------------------

Hi --

I took a look at this older issue.  Jacob-- it looks like your patch doesn't accomplish anything.  VelocityCharStream is always init''d with a buffer size of  4096 as the constructor and ReInit that's called doesn't specify a buffer size.  Can you take another look?

As a side note, there's a bug in the class here

public void ReInit(java.io.InputStream dstream, int startline,
  int startcolumn, int buffersize)
  {
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
  }


should be

public void ReInit(java.io.InputStream dstream, int startline,
  int startcolumn, int buffersize)
  {
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn,buffersize);
  }

I fixed this, but it's not really relevant since the constructor is never called.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622710#action_12622710 ] 

Nathan Bubna commented on VELOCITY-570:
---------------------------------------

??  Jacob's fix doesn't look like a no-op to me.  Not sure what you're [not] seeing, Will.  

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-570.
-----------------------------------

    Resolution: Fixed

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622581#action_12622581 ] 

Jarkko Viinamäki commented on VELOCITY-570:
-------------------------------------------

I can confirm that the current SVN head contains a bug which can be fixed by the patch Jacob submitted. The bug is critical and causes OutOfMemory error when a large template is parsed a couple of times (with caching off):

Running org.apache.velocity.test.issues.RepeatedParsingTest
iteration: 0
iteration: 1
java.lang.OutOfMemoryError: Java heap space
        at org.apache.velocity.runtime.parser.VelocityCharStream.ExpandBuff(VelocityCharStream.java:
67)
        at org.apache.velocity.runtime.parser.VelocityCharStream.FillBuff(VelocityCharStream.java:13
1)
        at org.apache.velocity.runtime.parser.VelocityCharStream.readChar(VelocityCharStream.java:24
6)
        at org.apache.velocity.runtime.parser.ParserTokenManager.jjMoveNfa_3(ParserTokenManager.java
:2160)

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Claude Brisson (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claude Brisson resolved VELOCITY-570.
-------------------------------------

    Resolution: Fixed

Thank you very much!
Patch reviewed, looks perfect.
Applied.


> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-570) speed improvement of the tokenizer

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622972#action_12622972 ] 

Nathan Bubna commented on VELOCITY-570:
---------------------------------------

Though i haven't hit the OOM without the patch myself, things continue to work well for me with the patch, and it looks sensible to me.  I'm gonna go ahead and apply it based on Erron and Jarkko's reports.

> speed improvement of the tokenizer
> ----------------------------------
>
>                 Key: VELOCITY-570
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-570
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4, 1.5, 1.6
>         Environment: Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
> Java: JDK 1.5
>            Reporter: Ronald Klop
>             Fix For: 1.6
>
>         Attachments: expandbuff-speedup-reinit-fix.patch, expandbuff-speedup.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org