<quote who="Leo Sutic">
>> Secondly, you assume that all servers are OK with a long start-up. I,
> for
>> instance, don't tolerate that my servers take 30s to get back up. It's
>> wasting my time.
>
> In the servers that have acceptable startup times, how much of the
> startup time is done loading classes?

Did you mean for servers with unacceptable start-up times?
Reading a JAR is comparatively fast, linking the classes with all the
virtual tables that makes Java slow, that takes considerable time. Not
loading a class is always much faster.

>> Thirdly, you assume that all the jars only contains classes that are
> being
>> used. I beg to differ. As a stupid example, rt.jar, is far from loaded
>> when I create a small app.
>
> rt.jar is loaded by the bootstrap classloader and is thus inaccessible
> and will never be scanned. Any class loaded by it will have its
> getClass().getClassLoader() == null, so it is unreachable. (Think about
> it, java.lang.ClassLoader is in rt.jar. Who loads it?)

My point was not that you would scan the rt.jar and load all classes, the
point was that only a few classes are loaded, and if you trigger loading
all the classes, it will take a LONG time...


>> With proper SoII, I foresee a large amount of
>> implementation classes that are not loaded.
>
> Point taken.

I am striving in my own framework to strong SoII, and expect several to
many implementations for a particular specification.


> My assumption isn't that a couple of hundred classes is fine. Suppose
> Cocoon consists of a hundred bazillion classes, for argument's sake.
> Does Cocoon have an acceptable startup time? I assume yes. OK, how much
> of that time is spent loading classes? Double that time and add it to
> the startup time. Still acceptable?

I don't know how many of all the classes that are on Cocoon's classpath
that are actually loaded. I believe far from all, but that is speculation.
And I fail to see the relevance. I think you are trying to argue, the
attribute scan is a fraction of loading the class, and a fraction of start
times are spent on loading classes, so therefor its not a problem.
That only works if you assume that you don't trigger a lot of unnecessary
classloading .

> OK, how about this: Instead of scanning *every* class we can get our
> hands on, we limit this process to scanning bundles. I.e. if Avalon gets
> an equivalent of the .war file, we will only scan such files. This means
> that we limit this to the jars that have a potential to contain Avalon
> components.
>
> Suppose we have a directory structure for jars like this:
>
>    lib/  (not scanned)
>     |
>     +-- ext (not scanned)
>     |
>     +-- endorsed (not scanned)
>     |
>     +-- avalon (scanned)

Sounds a lot better to me, or until all classes I use are Avalon
components ;o)


Niclas



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to