On 30-aug-2006, at 7:26, Talin wrote:

> Guido van Rossum wrote:
>>
>> Regarding optimal buffer size, I've never seen a program for which 8K
>> wasn't optimal. Larger buffers simply don't pay off.

Larger buffers can be useful when doing binary I/O through stdio (at  
least on linux). I've recently had a program that had significant  
speedup when I used a 128K buffer.

>
> Well, as far as readline goes: In order to split the text into lines,
> you have to decode the text first anyway, which is a layer 3  
> operation.


And buffering is a layer 2 operation. Function calls are signficantly  
cheaper than system calls. You don't want to do a system call for  
every character read, but might get away with doing a function call  
per character.

Ronald

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to