We are using two different plugin scripts ( like apply from: plugin('plugin_script_name') which are called from inside our root project's allprojects closure. The plugin script objects are apparently re-loaded and re-instantiated for each project. This resulted in DefaultScriptCompilerFactory.loadViaCache being called over 150 times. The loadViaCache calls triggered by 'apply from:' totaled 5.6 seconds. In contrast, the 70 calls to load and run the Java plugin only took a total of .044 seconds. The non-script plugins use a hierarchy of PluginRegistry objects to look up the appropriate plugin instance and don't re-create them every time. The script based plugins need something like this if they are going to perform well.
|