PDA

Click to See Complete Forum and Search --> : BufferedInputstream performance


CyberCarsten
Nov 29th, 2005, 06:05 AM
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

ComputerJy
Nov 29th, 2005, 11:37 AM
The buffer is the temporary storage used in the copy iteration. When you increase the size of the buffer, you decrease the big O

CyberCarsten
Nov 29th, 2005, 01:49 PM
how is that, and by how much? Don't you mean increase big O?

ComputerJy
Nov 29th, 2005, 11:17 PM
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?

CyberCarsten
Nov 30th, 2005, 01:14 AM
Enlarging the buffer increases the copy time. Thats what is frustating me

ComputerJy
Nov 30th, 2005, 03:14 PM
"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