Bug #2716

Mis à jour par Matthieu Decorde il y a plus de 4 ans

Currently there is a very long compilation time before running any Groovy script (at first run or after editing a script).

h3. Solution 0

The GroovyScriptEngine classloader needs to access all ClassLoaders to find out unknown classes (e.g a TXM extension classes like the "URSCorpora" class)

reduce the number of tested ClassLoader when the GroovyScriptEngine loads a class :
* only use TXM plugin loaders -> ~ 70 loaders
* -only only use the "*.rcp" plugin loaders (they contains the "*.core" plugin loaders) -> 34 loaders- the core > rcp dependency does not work loaders
** better * resolve TXM plugin dependancies to only keep the necessary plugin loaders (e.g the "org.txm.rcp" plugin is included in all "*.rcp" plugins) ->
* test the EclipseClassLoader name against the loaded class package name

h3. Solution A

Do not compile the import modules scripts if sources are not newer than the class files. Hence :
- ship the import modules Groovy classes with TXM
- generalize to all Groovy scripts if possible
- compare the class file compilations date with the last source modifications date

Find a way to:
- pre-compile Groovy scripts published by TXM plugins (org.txm.groovy.core, etc.)
- and ensure the pre-compiled classes are overriden by the TXMHOME/scripts/groovy/user Groovy scripts

h3. Solution B

- restore the Groovy class files build by the RCP build
- if necessary, force the GroovyScriptEngine to recompile the import module files (importer, annotate, compiler, pager) and their dependencies (Groovy classes)

Retour