<div dir="ltr"><div class="gmail_quote">On Thu, Nov 24, 2011 at 20:29, Antoine Pitrou <span dir="ltr">&lt;<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Thu, 24 Nov 2011 20:15:25 +0200<br>
Eli Bendersky &lt;<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Oops, readinto takes the same time as copying. This is a real shame,<br>
&gt; because readinto in conjunction with the buffer interface was supposed to<br>
&gt; avoid the redundant copy.<br>
&gt;<br>
&gt; Is there a real performance regression here, is this a well-known issue, or<br>
&gt; am I just missing something obvious?<br>
<br>
</div>Can you try with latest 3.3 (from the default branch)?<br></blockquote></div><br>Sure. Updated the default branch just now and built:<br><br>$1 -m timeit -s&#39;import fileread_bytearray&#39; &#39;fileread_bytearray.justread()&#39;<br>

1000 loops, best of 3: 1.14 msec per loop<br>$1 -m timeit -s&#39;import fileread_bytearray&#39; &#39;fileread_bytearray.readandcopy()&#39;<br>100 loops, best of 3: 2.78 msec per loop<br>$1 -m timeit -s&#39;import fileread_bytearray&#39; &#39;fileread_bytearray.readinto()&#39;<br>

1000 loops, best of 3: 1.6 msec per loop<br><br>Strange. Although here, like in python 2, the performance of readinto is close to justread and much faster than readandcopy, but justread itself is much slower than in 2.7 and 3.2!<br>

<br>Eli<br><br></div>