First request takes a long time

Discussion in 'ASP .Net Web Services' started by Norbert Pürringer, Mar 26, 2008.

  1. What are the different reasons, that the very first webservice request
    last a long time? In my case the first request last about 8 seconds,
    the second request is processed in a few milliseconds. Is there a way
    to advance the performance of the first webservice request? Calling my
    webservice in IE takes a long time too, but then, every request is
    processed immediately (even then, if the IE is closed and opened in
    the meantime, IE is able to receive the first request very fast),
    whereas my client is always a lame duck while requesting the first
    request after closing and opening the client.

    My webservice is written in C# (.NET 2.0)

    Thank you,
    Norbert
     
    Norbert Pürringer, Mar 26, 2008
    #1
    1. Advertising

  2. "Norbert Pürringer" <> wrote in message
    news:...
    > What are the different reasons, that the very first webservice request
    > last a long time?


    It is doing JIT compilation (turning IL into in-memory code).

    > In my case the first request last about 8 seconds,
    > the second request is processed in a few milliseconds.


    Sounds about right.

    > Is there a way
    > to advance the performance of the first webservice request?


    There is a precompile.axd with web applications, but I am not sure if it
    will walk a service. You can set up a console application that makes calls
    on all of the methods and force compilation.

    The best way, overall, is move your code to a separate library and then
    consider ngening that assembly. There is still a JIT hit on the service
    itself, but with all of the code in the library, you will find it is faster.
    Of course, this makes it a bit more time consuming to switch out assemblies,
    although you do have the option, if properly versioning, of sticking the
    second version in the GAC before deploying the service and reducing
    interruption.

    > Calling my
    > webservice in IE takes a long time too, but then, every request is
    > processed immediately (even then, if the IE is closed and opened in
    > the meantime, IE is able to receive the first request very fast),
    > whereas my client is always a lame duck while requesting the first
    > request after closing and opening the client.


    This is a just an appearance thing, as IE is multi-threaded and your app
    probably is not. You can fake this appearance by putting service calls on
    another thread and leaving the client app responsive (repaint, etc.)

    > My webservice is written in C# (.NET 2.0)


    Language not important here. :)

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://gregorybeamer.spaces.live.com/lists/feed.rss

    or just read it:
    http://gregorybeamer.spaces.live.com/

    *************************************************
    | Think outside the box!
    |
    *************************************************
     
    Cowboy \(Gregory A. Beamer\), Mar 26, 2008
    #2
    1. Advertising

  3. Norbert Pürringer

    nenzax Guest

    try Sgen.exe
     
    nenzax, Mar 30, 2008
    #3
    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. Brent
    Replies:
    2
    Views:
    838
    Brent
    Oct 24, 2005
  2. Delete takes a long time

    , Dec 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,593
    Peter Rilling
    Dec 28, 2005
  3. =?Utf-8?B?cHJhc2hhbnRo?=
    Replies:
    4
    Views:
    520
    Lau Lei Cheong
    Jan 20, 2006
  4. Son KwonNam
    Replies:
    3
    Views:
    2,364
    Steve Horsley
    May 12, 2004
  5. ptouch
    Replies:
    0
    Views:
    273
    ptouch
    Jul 20, 2004
Loading...

Share This Page