Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-570

speed improvement of the tokenizer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4, 1.5, 1.6
    • 1.6
    • Engine
    • None
    • Tested on FreeBSD 6.2-STABLE and Linux (Debian Etch) on i386.
      Java: JDK 1.5

    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.

      Attachments

        1. expandbuff-speedup.patch
          2 kB
          Ronald Klop
        2. expandbuff-speedup-reinit-fix.patch
          1 kB
          Jacob Mundt

        Activity

          People

            Unassigned Unassigned
            ronaldklop Ronald Klop
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: