Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1449

Pre-compile groovy templates, faster initial process

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-6
    • Fix Version/s: 1.5
    • Component/s: Groovlet / GSP
    • Labels:
      None

      Description

      Copied from user.groovy.codehaus.org:

      Is there a way to pre-compile groovy templates? Looking at the something like the SimpleTemplateEngine I see the template file is parsed into a groovy script which is then stored in a SimpleTemplate object then each time the template object’s ‘make’ method is called a new instance of the script is created with bindings and the script is run. When I run the templates on the server I noticed an initial delay when I first hit a new template (much like the initial delay with a jsp as it is compiling) I’m assuming that the script is being compiled for the first time. Subsequent visits to the template are much, much faster. So I’m wondering if somehow...

      Parsing the templates and compiling the generated scripts would eliminate that initial lag. Could be done in the init-method of the servlet.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              sormuras sormuras
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: