[issue21790] Change blocksize in http.client to the value of resource.getpagesize

Demian Brecht report at bugs.python.org
Fri Jun 20 21:56:49 CEST 2014


Demian Brecht added the comment:

I very well could be missing something here (and, admittedly, my OS knowledge is rusty at best), but for the most part, page sizes are 4096, except for SPARC, which is 8192.

> So your page double the number of calls to read(), right?

No. read() is called until EOF. I'm assuming that 8192 may have been used to accommodate worst case architecture?

I'd have to dig through the C side of things (which I haven't done yet) to see what's going on down at that level, but my assumption is that it's allocating 8192 bytes for each read. Should EOF be reached with <= 1 page filled, it'd result in a wasted page.

Far from the end of the world, but just something I noticed in passing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21790>
_______________________________________


More information about the Python-bugs-list mailing list