[groovy-user] GroovyClassLoader.loadClass(...) slow
Hi All,
In my "app" I do GroovyClassLoader.loadClass(classname, false, true) on a bunch of uncompiled .groovy files.
In comparison to say the speed of compilation of groovy classes, loading them seems pretty slow, about 1s per class. I use a GroovyResourceLoader to do some redirecting, for instance if it trieds to load a.b.Foo, the resource loader might return the url for a/b/FooV2.groovy. I don't think the resource loader is the cause of the problem though.
Adding some logging to the resource loader, I see that it tries to load for example, a.b.Foo.String, a.b.Foo.Map etc. Are these "misses" expensive?
I presume that it wouldn't try to load these classes if I didn't statically type stuff, which I don't all the time, but I tend to do it to get help from the IDE. If removing the static typing would make things faster, how I can still get IDE-help if I have a method:
doSomething (String a, Map m, ...) ?
Any other tips to make classloading faster or is it as fast as it's going to get?
cheers, jamie