Best buffer size

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
When doing buffered file I/O.

I see programming textbooks and code samples using random sizes. Some use 100 bytes, 512 bytes, 1k, 4k, 8k and some several megabytes.

What's the best for optimal performance? :s11:
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
When doing buffered file I/O.

I see programming textbooks and code samples using random sizes. Some use 100 bytes, 512 bytes, 1k, 4k, 8k and some several megabytes.

What's the best for optimal performance? :s11:

benchmark it. there is no best size. it depends on your kernel, and I/O pattern of your software.
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top