Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > First request takes a long time

Reply
Thread Tools

First request takes a long time

 
 
Norbert Pürringer
Guest
Posts: n/a
 
      03-26-2008
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
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      03-26-2008

"Norbert Pürringer" <> wrote in message
news:3faa8507-54b1-43a2-89f7-...
> 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!
|
*************************************************


 
Reply With Quote
 
 
 
 
nenzax
Guest
Posts: n/a
 
      03-30-2008
try Sgen.exe
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’ veryhotsausage C++ 1 07-04-2008 05:41 PM
Vista: "Calculating time remaining" takes long time on any fileaction. Even with all suggested KB patches installed Peter Computer Support 2 12-15-2007 12:57 AM
Delete takes a long time prabhupr@hotmail.com ASP .Net 1 12-28-2005 06:05 PM
Showing "Template" + feedback for a page that takes a long time toprocess. Brent ASP .Net 2 10-24-2005 06:36 PM
First conecton to the network takes very long =?Utf-8?B?YnJpYW5maWU=?= Wireless Networking 0 11-01-2004 05:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57