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

Pre-compile groovy templates, faster initial process

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.5
    • Groovlet / GSP
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: