1. Groovy
  2. GROOVY-4563

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


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


      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.


        Mark Thomas made changes -
        Workflow jira [ 12968856 ] Default workflow, editable Closed status [ 12976591 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12733497 ] Default workflow, editable Closed status [ 12745305 ]
        Mark Thomas made changes -
        Field Original Value New Value
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Ittay Dror created issue -


          • Assignee:
            Ittay Dror
          • Votes:
            3 Vote for this issue
            2 Start watching this issue


            • Created: