groovy
  1. groovy
  2. GROOVY-4563

Allow new instances of GroovyScriptEngine to use previously compiled .class files

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.4
    • Fix Version/s: None
    • Component/s: GroovyScriptEngine
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If I call CompilerConfiguration#setTargetDirectory then GroovyScriptEngine will save .class files for scripts it compiles. However, when creating a new instance of GroovyScriptEngine (e.g., because of application restart) it will not reuse those .class files and instead recompile all scripts. This compilation can be time consuming.

      Instead, GroovyScriptEngine#scriptCache can be written and reloaded and CompilerConfiguration#getTargetDirectory could be one of the urls that GroovyClassLoader users. Writing can be done just when a target path is given and CompilerConfiguration#getTargetDirectory is set, reloading can be another public method that users should invoke (e.g., since they know which dump file matches which instance)

      It would also be nice if GroovyScriptEngine saved the output of each script as a jar. This will allow deploying pre-compiled jars of some scripts to speed up first usage of applications.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ittay Dror
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: