Related to Performace of URLConnection.getOutputStream

Discussion in 'Java' started by Lucky, May 31, 2006.

  1. Lucky

    Lucky Guest

    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
    Lucky, May 31, 2006
    #1
    1. Advertising

  2. "Lucky" <> wrote in message
    news:...
    > 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 http://www.iviz.com/
    Matt Humphrey, Jun 1, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. thisyr4leafs

    ASP.NET Page Performace Problem

    thisyr4leafs, Aug 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,088
    John Rivers
    Aug 27, 2005
  2. David Purton
    Replies:
    0
    Views:
    2,717
    David Purton
    Jan 27, 2006
  3. Stephan Br?nnimann
    Replies:
    2
    Views:
    299
    P.J. Plauger
    Nov 10, 2003
  4. TPJ
    Replies:
    3
    Views:
    282
    Justin Azoff
    Aug 7, 2005
  5. Replies:
    2
    Views:
    3,597
Loading...

Share This Page