My 2 cents: Don't load classes to use java.lang.reflect on it:
- What if a class does something bad (or just about anything) in a static 
initializer?
  For example  try to run the code below. It will EXIT THE VM
- Can you be sure that those classes are unloaded again?
- Performance: It is _faster_ to use a library (like javassist), because the
  class loader must effectively parse the byte code, too, plus then do a lot
  more (like validation).

package com.acme.foo;

class Exit {
    static {
        System.exit(-1);
    }
}

public class Main {
    public static void main(String[] args) throws InterruptedException, 
ClassNotFoundException {
        Class<?> clazz = Class.forName("com.acme.foo.Exit");
        while(true) {
            Thread.sleep(1000);
            System.out.println(System.currentTimeMillis() / 1000);
        }
    }
}



Cagatay Civici wrote:
I've checked mojarra 2.0 some time ago to see how do they implemented this, well they're using reflection/class way.

Spring's scanning mechanism also gives out of memory if you dont specify a sub package name to scan.

So, my thought is to implement this in myfaces, it's not a complicated task as we all discussed. And if we do implement it, we get the advantage of tuning it
for better performance in a web environment.

C.C.

On Sun, Jan 11, 2009 at 11:46 AM, Mario Ivankovits <ma...@ops.co.at <mailto:ma...@ops.co.at>> wrote:

    Hi!

     > not sure on the PERF, but if it is really (proven) the case, I am
    with
     > you.
     > Well... startup time isn't really a big problem, right? :-)

    Is that ironic?
    In projects with 3000 classes and 60 jar files you are up to 30
    seconds, or even more, scanning time.
    Under load, with shale, I saw scanning times of 60 seconds.
    This _will_ drive you crazy!

    Ciao,
    Mario



Reply via email to