New submission from Daniel Stutzbach <dan...@stutzbachenterprises.com>:

The readinto() method is intended to offer better performance than read() by 
allowing the caller to read into a preallocated buffer rather than constantly 
allocate and deallocate buffers.

However, bufferediobase_readinto() calls read(), so the extra allocations and 
deallocations happen anyway.  On a related note, buffered_readinto() has a 
comment reading "TODO: use raw.readinto() instead!" which should be explored.

I can write a patch for this, but it will probably be awhile before I get to 
it.  Anyone else who feels inspired should feel free to write one. :-)

----------
assignee: stutzbach
components: IO
messages: 117530
nosy: benjamin.peterson, pitrou, stutzbach
priority: normal
severity: normal
stage: needs patch
status: open
title: Optimize BufferedReader.readinto
type: performance
versions: Python 3.2

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

Reply via email to