Description
Concidering the following classes
ATrait.groovy
trait ATrait { }
and
AClass.groovy
class AClass implements ATrait { def String cleanName(String name) { return name. replaceAll(/alpha01/, '/'). replaceAll(/alpha02/, '/'). replaceAll(/alpha03/, '/'). replaceAll(/alpha04/, '/'). replaceAll(/alpha05/, '/'). replaceAll(/alpha06/, '/'). replaceAll(/alpha07/, '/'). replaceAll(/alpha08/, '/'). replaceAll(/alpha09/, '/'). replaceAll(/alpha10/, '/'). replaceAll(/alpha11/, '/'). replaceAll(/alpha12/, '/'). replaceAll(/alpha13/, '/'). replaceAll(/alpha14/, '/'). replaceAll(/alpha15/, '/'). replaceAll(/alpha16/, '/'). replaceAll(/alpha17/, '/'). replaceAll(/alpha18/, '/'). replaceAll(/alpha19/, '/'). replaceAll(/alpha20/, '/'). replaceAll(/alpha21/, '/'). replaceAll(/alpha22/, '/'). replaceAll(/alpha23/, '/'). // replaceAll(/alpha24/, '/'). // replaceAll(/alpha25/, '/'). replaceAll(/\//, "."). replaceAll(/\.\.*/, "."). replaceAll(/__+/, "_") } }
compiles in about 6 seconds. If I remove the import of the Trait 'ATrait' in 'AClass' the compile proces only takes about 1 second.
If you consider the classes as the are shown above then the compile time nearly duplicates for every method call I add to the chained method call.
With the replaceAll with alpha24 being compiled the compilation process takes approximately 11 seconds and with alpha 25 being compiled in conjunction with alpha24 the compilation takes approximately 20 seconds.