-
Improvement
-
Resolution: Unresolved
-
Major
SecureGroovyScript.evaluate always parses the Groovy script. There should be an option to cache the parsed script (it is final). Otherwise the performance for some use cases is poor (if the script is called very often). (For details see JENKINS-14614).
Caching the Script in SecureGroovyScript is not a good idea—too easy to introduce a memory leak. Rather it would be necessary to introduce a new API type representing a script ready to run, with an Object evaluate() throws Exception method (TBD whether a fresh Binding binding needs to injected on each call).