You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br> on 2005/03/22 19:51:51 UTC

Too slow for startup

Hi!

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...

I think I have not too many beans at my app...

Someone else tried OJB with profiling tools?

Thanks for any tips,

-- 
Edson Carlos Ericksson Richter
MGR Informática Ltda.
Fones: 3347-0446 / 9259-2993



Re: Too slow for startup

Posted by Martin Kalén <mk...@apache.org>.
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org