Edson Carlos Ericksson Richter wrote:
I'm researching with NetBeans Profiler, and I found interesting that OJB takes near to 3739ms running method ...ClassHelper.getClass(String,boolean), in 4367 calls...

It's considered standard profiling practice to first warm up the ClassLoader and caches a bit and then start timing _after_ this.


If the JVM is loading your classes you will in general not see the times in the profiled data [*] but if a class loading call in eg OJB loads the classes you will. Thus you won't get really fair timings for the code if you start the clock before you have done some OJB operations first.

What will happen when class helper loads a class (which is the same as when the JVM loads a class) is:
* all static fields in the class are assigned
* all static initializer code in the class is executed
* if the second argument is true, the standard contructor of the class will be executed


The static init will only happen once per JRE. Once the class is loaded the time for initializing an instance by reflection will be significantly lower.


But if you are specifically interested in lowering the "boot time", then this is of course of high importance!


Any reports about findings you make of performance bottlenecks are highly appreciated.

Regards,
 Martin


[*] This is true for JRE < 5.0, I have not tried the new instrumentation in Java 1.5 much so this might differ.


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



Reply via email to