Related to Performace of URLConnection.getOutputStream

L

Lucky

Hi Folks,

In my Java application, the application is sending HTTP + SOAP request
to JBoss server. My observation is that for the very first request for
obtaining OutputStream object, application takes much time. And the
subsequent requests from the application does not take time for
obtaining the OutputStream object.

###########################################################
HttpURLConnection httpConn = (HttpURLConnection) serviceURL
.openConnection();
-------
-------
-------
OutputStream out = httpConn.getOutputStream();

#####################################################

Is there any reason behind this? Please let me know.


Regards,
Deepak
 
M

Matt Humphrey

Lucky said:
Hi Folks,

In my Java application, the application is sending HTTP + SOAP request
to JBoss server. My observation is that for the very first request for
obtaining OutputStream object, application takes much time. And the
subsequent requests from the application does not take time for
obtaining the OutputStream object.

###########################################################
HttpURLConnection httpConn = (HttpURLConnection) serviceURL
.openConnection();
-------
-------
-------
OutputStream out = httpConn.getOutputStream();

#####################################################

Is there any reason behind this? Please let me know.

There are so many reasons for this that the standard advice for evaluating
performance is to be sure to ignore the first few requests. The first time
JBoss encounters the request it must load the servlet classes and initialize
the servlet. This only ever happens once. For JSP pages, the page must be
compiled and then loaded. There are usually lots of classes that have to be
brought in for the first request, so all this is normal. Focus instead on
the performance of later requests.

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top