> why is that my servlet when the first time is invoked, it 
> takes about 30
> seconds or more to start when the servlets that came in tomcat are
> instantaneous? After the servlet container instantiated and 
> initialized my
> servlet, all the following requests are very fast. Is there 
> any advice for
> what we should do and don't do in init() method? 

Well, one option for a solution is set your servlet to load on startup
and have all your initialization done at startup so that these
elements are already initialized before the first request even comes.

> How can I benchmark the time of instantiation of my servlet 
> and the time of
> my init method?

I would just put in some logging code and find out where exactly
the time is being taken up in your servlet(if indeed this is where
it is actually munching clock cycles).

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

Reply via email to