|
-
Nov 29th, 2005, 07:05 AM
#1
Thread Starter
Frenzied Member
BufferedInputstream performance
Hi
I am using BufferedInputStream to load in a file. Apparently i, get slightly lesser performance the higher i set my buffer. Why is that? There is approx. a 50 sec difference on 632 Mb file when I change the buffer from 2 Kb to 10 Mb....This seems very strange
-
Nov 29th, 2005, 12:37 PM
#2
Re: BufferedInputstream performance
The buffer is the temporary storage used in the copy iteration. When you increase the size of the buffer, you decrease the big O
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 29th, 2005, 02:49 PM
#3
Thread Starter
Frenzied Member
Re: BufferedInputstream performance
how is that, and by how much? Don't you mean increase big O?
-
Nov 30th, 2005, 12:17 AM
#4
Re: BufferedInputstream performance
calculate how many buffers does it take to copy the entire file,.. the resulting number is the number of loops used in the copy process. Therefore, the larger the temporary storage (buffer) is the less loops you'll need to have. That's why enlarging buffer decreases the time
Any Questions?
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 30th, 2005, 02:14 AM
#5
Thread Starter
Frenzied Member
Re: BufferedInputstream performance
Enlarging the buffer increases the copy time. Thats what is frustating me
-
Nov 30th, 2005, 04:14 PM
#6
Re: BufferedInputstream performance
"The buffer size specified should be a reasonable size so that your process will not run out of nonpaged pool, but it should also be large enough to accommodate typical requests." from MSDN Knowledge Base
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
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
|