Message 183670 - Python tracker (original) (raw)

As for your "blocksize = filesize" argument I changed my opinion: despite being less CPU consuming we might incur into problems if that number is too big. 'count' parameter on Linux, for example, is expected to be an unsigned int. Other plarforms will also use different data types so we better stick with a fixed blocksize value (currently 8192).

If you really think a blocksize is necessary, you could choose a much larger one for sendfile() (such as 16 MB). Then the overhead of system calls would be much smaller.