473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

== Why there is a huge jump in the time used? ==

Hi,

I've a quetion which has bugged me for quite a while.

I wrote a C#/.NET Web service which is hosted by IIS 5.1 on a Windows XP SP2
machine. This Web service just get the content of the specified txt file and
send the content back to the client. The processing time on the server side
was logged by IIS.
The file sizes and results are listed below (in millisecond):

FileSize: 1K 2K 4K 8K 16K 32K 64K 128K
256K
TimeUsed: 10.0 10.5 10.5 12.0 14.5 116.0 140.5 141
151

As you can seen, the weird thing is, when the file size changes from 16K to
32K, there is big jump in the processing time on the server side. Actually
the jump is between 30K and 31K: when file size is 30K, the time used on the
server side is about 15ms, when file size is 31K, it jumps to about 150ms
(this is the average value. In one of ten, the value is still very small,
like 10-20ms, but most of them are about 150-200ms).

And here is the code I used to implement the Web service:

public string GetLocalFile(string fileName)
{
string returnString = "";

string filePath = @"C:\Inetpub\wwwroot\Files\";

string fullName = filePath + fileName;

StreamReader fs = File.OpenText(fullName);

returnString = fs.ReadToEnd();

fs.Close();

return returnString;
}

I am using the following code on the client side to get files:

private void SendWsFileRequestOut()
{

long startTime, endTime, elapseTime;

startTime = DateTime.Now.Ticks;

//Call Web service for the specified file
fileFetcher.GetLocalFile(fileName);

endTime = DateTime.Now.Ticks;

elapseTime = endTime - startTime;

}
Can anyone help me figure out what the reason could be? Thanks a lot!

J.J.

Dec 14 '05 #1
1 995
J.J,
As you can seen, the weird thing is, when the file size changes from 16K
to
32K, there is big jump in the processing time on the server side. Actually
the jump is between 30K and 31K: when file size is 30K, the time used on
the
server side is about 15ms, when file size is 31K, it jumps to about 150ms
(this is the average value. In one of ten, the value is still very small,
like 10-20ms, but most of them are about 150-200ms).


This is probably a result of "automatic growth" (a.k.a. object
creation/allocation) in the stream reading the file. You can confirm this
by using a good allocation profiling tool.

Regards,

Randy
Dec 14 '05 #2

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

Similar topics

10
by: Margaret MacDonald | last post by:
I'm seeing a problem that has me flummoxed. The only thing I can think of is that I'm violating some rule I don't know about. I have some code that does some processing and then does a...
4
by: Sleepless on the Web | last post by:
Is there a limit to how many items can be in a jump list? My script worked fine with 126 items, but at 152 items it just doesn't work. When I select a page from the drop down menu it will only...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
7
by: Peter Hansen | last post by:
Is in any way possible to define a variable as a integer-value which contain about 300 numbers in a row? I have thought about an Override-function for Data-types but I dunno how - but if it is...
4
by: robert d via AccessMonster.com | last post by:
When my app starts up, it creates a temporary database. This temp database is created from a 'model' database that is in the same folder as the application. Because there is a model, the creation...
6
by: Todd A. Anderson | last post by:
I have a function foo of which I need to get the address. The problem is that when you say "&foo" (or just foo for that matter), you get the address of this function's entry in a jump table and...
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
8
by: blaine | last post by:
Hey guys, For my Network Security class we are designing a project that will, among other things, implement a Diffie Hellman secret key exchange. The rest of the class is doing Java, while myself...
3
by: clintonG | last post by:
Microsoft Charging $90 for .NET Undermines Huge Market Compelling The Use of Linux! Anybody with eyes sight can see "digital signage" emerging as a "display device platform" and a HUGE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.