473,666 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Improving first access to a web service

I'm programming a site that displays info from AWS Commerce Service
4.0. At each change of the asp.net application the first load of a
page that uses the web service takes 30 seconds. Subsequent calls are
snappy. From what I've learned this overhead is for processing the
wsdl file (which has of course not changed). The file is large, 2200
lines.

Is there a way to use this file locally on the web server or cache the
result of the read? It would really speed my development iterations.

Sorry if I'm missing something basic or am asking the question with the
wrong terms. I suspect that's why I'm not finding the answer quickly
in the newsgroups.

Thanks!

Nov 16 '05 #1
8 2490
hmmm...
from what I heard the problem with the first call regards not only the
WSDL but also the serialization/deserialization of the
parameters/objects passed between your web service and consumer app.
The XMlSerializer, in fact, uses reflection (slow) on the first call to
figure out how to serialize/deserialize stuff as needed.

I've heard .NET Framework 2.0 + Visual Studio 2005 should let you
deploy your app with a pre-compiled (or pre-something) version of the
code needed to do this serialization/deserialization and should
therefore get around the slowness of the first calls.

Hope this will help you, assuming you can wait for .NET Fwork 2.0 to
come out.

F.O.R.

Nov 16 '05 #2

Hi,

Above your web service you can put a cache duration(in
seconds). Not sure if this can help

[WebService(Name space="http://abc/webservices/",
Description="AB C Web Service",
CacheDuration = 30)]
Joey
-----Original Message-----
I'm programming a site that displays info from AWS Commerce Service4.0. At each change of the asp.net application the first load of apage that uses the web service takes 30 seconds. Subsequent calls aresnappy. From what I've learned this overhead is for processing thewsdl file (which has of course not changed). The file is large, 2200lines.

Is there a way to use this file locally on the web server or cache theresult of the read? It would really speed my development iterations.
Sorry if I'm missing something basic or am asking the question with thewrong terms. I suspect that's why I'm not finding the answer quicklyin the newsgroups.

Thanks!

.

Nov 16 '05 #3
cache duration has nothing to do with initial access.

About the best you can do with the current technology is to encourage your
users to sit and wait :-). If you are anal like me, you can write a little
utility that simply fires a webrequest periodically to keep the application
warm and toasty. That will change for ASP.NET 2.0 so sit tight.

I'd say that 30 seconds is unusually long for startup but I'm not all that
familiar with your implementation.

From what I've learned this overhead is for
processing the
wsdl file
Not really, the startup cost is a feature (or fault) of .NET
--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------
"Joey" <an*******@disc ussions.microso ft.com> wrote in message
news:26******** *************** *****@phx.gbl.. .
Hi,

Above your web service you can put a cache duration(in
seconds). Not sure if this can help

[WebService(Name space="http://abc/webservices/",
Description="AB C Web Service",
CacheDuration = 30)]
Joey
-----Original Message-----
I'm programming a site that displays info from AWS

Commerce Service
4.0. At each change of the asp.net application the first

load of a
page that uses the web service takes 30 seconds.

Subsequent calls are
snappy. From what I've learned this overhead is for

processing the
wsdl file (which has of course not changed). The file is

large, 2200
lines.

Is there a way to use this file locally on the web server

or cache the
result of the read? It would really speed my development

iterations.

Sorry if I'm missing something basic or am asking the

question with the
wrong terms. I suspect that's why I'm not finding the

answer quickly
in the newsgroups.

Thanks!

.

Nov 16 '05 #4
Thank you all.

So its the serialization/deserialization of the objects and parameters
that is the issue I guess. This must be done each time the application
is loaded at the invocation of the first method. Amazon's interface
spans 2200 lines and so is larger perhaps than most web services. My
actual timing shows the first call is more like 70 seconds long. Can
anyone point me to documentation that describes what is actually
happening during this operation? Serialization/deserialization sounds
like changing something from one format to another. The processor on
the web server is idle during this time. Where is the wait occurring?
On the web server waiting for a response from Amazon? Downloading the
wsdl itself is near instant. At this point, I'm just trying to get
educated about how this is working.

Thanks again for the info about asp.net 2.0. It looks like it has lots
of good stuff to look forward to.

-Mark

Nov 16 '05 #5
This may help.
About middle of the page down.
http://msdn.microsoft.com/library/de...tperftechs.asp
I swear i learn something new everytime i read that article!

--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------
<mu****@murphys w.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Thank you all.

So its the serialization/deserialization of the objects and parameters
that is the issue I guess. This must be done each time the application
is loaded at the invocation of the first method. Amazon's interface
spans 2200 lines and so is larger perhaps than most web services. My
actual timing shows the first call is more like 70 seconds long. Can
anyone point me to documentation that describes what is actually
happening during this operation? Serialization/deserialization sounds
like changing something from one format to another. The processor on
the web server is idle during this time. Where is the wait occurring?
On the web server waiting for a response from Amazon? Downloading the
wsdl itself is near instant. At this point, I'm just trying to get
educated about how this is working.

Thanks again for the info about asp.net 2.0. It looks like it has lots
of good stuff to look forward to.

-Mark

Nov 16 '05 #6

Thanks for the pointer on the article. I'm not sure if I see the web
service answer, but there are definitely some other juicy morsels!

Mark

Nov 16 '05 #7
Here's my current understanding of this 'first-invokation' problem.
Please correct me if I'm wrong.

in .NET apps we have compilation on-demand. We commonly say we're
'compiling' our projects in Visual Studio (or through the command line
equivalents), but truly we are just *building* the app. That means the
app is converted to MSILanguage.
When the app is first called, the Just-In-Time (JIT) compiler takes the
MSIL and actually compiles it.
On subsequent invokations to the same code, the JIT compiler recognizes
the compilec code is already available and does not re-do it all.

This happens for all .NET apps, but we notice it more in Web APps
becaise, as the JIT compiler compiles a web app or a web service, it
must compile the code needed to serialize/deserialize all the data
types exposed by the web app or web service public API.

So, if your web service has a
[WebMethod]
public DataSet GetCustomers()

API, the JIT compiler recognizes it will have to compile the code to
serialize a DataSet. That means it calls the CoapSerializer or
HttpSerializer or XmlSerializer in action.
The serializers, as far as I know, use Reflection to figure out how
they should serialize/deserialize something.
Reflection is admittedly a bit on the slow side, since it deals with a
lot of meta-data.

That is where, I think, we get the performance hit.

As I said, if anyone here has a better understanding of the situation,
please enlighten me.

BTW, I've been running performance comparisons on this stuff. I don't
have a definitive bottom-line yet ('cause I gathered too much
data...about 24 000 trials), but so far this 'first invokation' hit
seems the biggest performance hit in the whole system.

Which leads me to say:
while we wait for .NET 2.0 (where apparently this will be alleviated or
resolved), one should include a round of automated unit tests
exercising the whole code as part of one's .NET web-apps deployment (or
update) process.
Ah, yes, we already knew we should do that as a good practice, but now
we have another good reason, right?

Cheers,
F.O.R.

Nov 16 '05 #8
"Olorin" <fr************ *@gmail.com> wrote in message news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Here's my current understanding of this 'first-invokation' problem.
Please correct me if I'm wrong. : : This happens for all .NET apps, but we notice it more in Web APps
becaise, as the JIT compiler compiles a web app or a web service, it
must compile the code needed to serialize/deserialize all the data
types exposed by the web app or web service public API.


For a WebMethod, the Framework:
1.) Reflects against the types appearing in the signature of the method using
reflection to get all their properties (and reflects against those properties'
types if necessary, i.e. if the property had a compound type).
2.) Writes C# source code to serialize and deserialize them and saves
this into a file in your temp directory (cleans it up too, unless you set a
certain diagnostic switch instructing it to leave it there).
3.) Launches the C# compiler to compile that source code.
4.) Loads the dynamically generated assembly into memory and starts using
its serialization/deserialization class to handle the XML.

For an ASP.NET application it's a little different:
1.) Reads and parses the .ASPX file, which is a 'template' describing the
hierarchy of controls on the page and their initial settings.
2.) Writes C# source code to create the control hierarchy that fills the Page
and saves this into a file deep beneath your Temporary ASP.NET Files
directory.
3.) Launches the C# compiler to compile that source code.
4.) Saves the dynamically generated assembly alongside the source file.

It's machines writing programs for themselves and then loading systems
software like you or I would do that's the slow part.

These processes aren't known to the JIT compiler. The Serialization
process affecting WebMethods happens after code has been JIT into
machine code, only as it executes to the point where an XmlSerializer
object gets constructed for a given Type the first time. Conversely,
the ASP.NET process happens before the JIT even sees the IL in
an assembly (because the ASP.NET process is responsible for
producing the assembly the JIT receives when it doesn't already
exist or is out-of-date).
Derek Harmon
Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1961
by: Liza | last post by:
Hello, can you guys help me out here....? this is part of my masters degree and hence is very important to me..... my supervisor doesn't seem to be too interested in helping me and infact is on holiday as we speak. ok here's my question.....
0
949
by: james | last post by:
I have created a web service that returns a very large dataset. The performance of the web service is fine. The web service generates the dataset in about 3 seconds. However when I call the web service from a MFC C++ app, it takes about 80 seconds to receive the dataset. My code is something like CComBSTR bstrSelectResults(10000000); try
6
3537
by: cameron | last post by:
I have always been under the impression that LDAP was optimized for speed. Fast queries, fast access, slower writes. I have a block of data in LDAP and in SQL. Exact same data. The query is fast but the first access to the result set takes longer that to do the query in SQL and process the sql results. From my trace.axd LDAP Test Starting Search 0.000112 0.000043 LDAP Test Done Search 0.003821 0.003374 <--- fast query at .003 sec LDAP...
11
2355
by: Jason | last post by:
Hi I have a "problem" i have got a ASP.NET application. in this application i have included logging. in the logging i have logged how many seconds it takes for this application to fully load. i have placed these timing loggings in the Load and Init events on a typical aspx page. i.e. first line of code in Page_Load is DateTime dtStart = DateTime.Now; and the last lines of code are
0
2257
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
9
2158
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service) Hide.dll methods and data I want to remain hidden I have a DLL, Hide.dll, that contains methods that I want to handle for
4
39324
by: perryclisbee via AccessMonster.com | last post by:
I have dates of service for several people that range all over each month. ie: patient had dates of service of: 7/3/2006, 7/24/2006 and 7/25/2006. I need to create a new field via a query that will convert each of the records of these service dates to the first date of that month, with results showing: 7/1/2006, 7/1/2006, 7/1/2006. How would you place an expression on a query that will convert any given date to the first day of the month...
10
1773
by: Jo | last post by:
Hi there: I m wondering what can I do to improve my code, everytime I am coding I feel like it could be done better. I started on c# a good months ago and feel conformtable but sometimes I Need to look up stuff. maybe someone can suggest a good book on good practices for c#? Cheers Jo
2
5556
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi John, Hopefully this post will find its way back to you - or perhaps be answered by someone else. As I mentioned in my last post on the earlier portion of this thread, changing the serialization settings for the build handled the initial slows we encountered when invoking the web service. Since that time, we ported the original VB.net code over to C# - this was done to make it cleaner easier to include the project in the rest of...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8780
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7378
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6189
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.