STINNER Victor <vstin...@python.org> added the comment:

Hi, the io module doesn't use the block size of the filesystem. 
io.BufferedReader uses a default buffer size of 8 * 1024 bytes. I don't think 
that it's really important to respect the block size in Python. There are 
buffers at many levels. io.BufferedReader is a buffer in user space, but there 
is also a buffer in the kernel. I'm not sure how relevant is to use know that a 
"disk sector" is 4096 bytes, when most people use SSDs which use way larger SSD 
blocks (ex: 512 KB). It's hard to say what's real block size. The disk firmware 
can lie (pretend it's 4 KiB) or the kernel can lie. The disk firmware can 
emulate different "block sizes".

If you write a database, maybe you would like to start caring about that, but 
you may want to use direct I/O (O_DIRECT) flag for that.

In short, Python works as expect, it's efficient and you should not worry about 
that ;-)

----------
nosy: +vstinner

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue24666>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to