|
-
Oct 4th, 2006, 02:06 PM
#1
Thread Starter
Addicted Member
StreamReader to slow?!?
Hi,
I get some web page in this way:
VB Code:
Dim txt as string
Dim startD As Date, endD As Date
Dim rS As Stream
rS = HttpWebResponse.GetResponseStream()
startD = DateTime.Now
Dim sR As New StreamReader(rS)
txt = strReader.ReadToEnd()
endD = Now
This web page has about 350kb and difference from startD and endD is 8sec. I think that is to much time for loading 350kb file. Can I do it faster?
thanks j
-
Oct 4th, 2006, 02:19 PM
#2
Re: StreamReader to slow?!?
I don't think it's the StreamReader but rather the tranfer rate/bandwidth/speed of the connection.
-
Oct 4th, 2006, 02:44 PM
#3
Re: StreamReader to slow?!?
You don't want to read documents that way, use BufferedStream instead because the ReadToEnd loads the entire stream in memory at once ( which might not work for larger WebStream, especially on client computer )
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Oct 4th, 2006, 03:14 PM
#4
Thread Starter
Addicted Member
Re: StreamReader to slow?!?
Thanks 'ComputerJy', I'll try with BufferedStream and post results here.
stanav said:
I don't think it's the StreamReader but rather the tranfer rate/bandwidth/speed of the connection.
I don't think so, I write some stuff in vb6 using xmlHttp and I get web page text in 2-3sec.
thanks j
-
Oct 4th, 2006, 03:49 PM
#5
Re: StreamReader to slow?!?
Why dont you put start and end times before and after the httpwebresponse, and then another set before and after the streamreader part, and compare the two to see what is the larger bottleneck. Is that all the code? Or are you doing more that you didn't post? Something with analyzing that data? Or are you merely displaying it...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|