<div dir="ltr"><div class="gmail_quote">On Thu, Nov 24, 2011 at 20:29, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>></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 <<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>> wrote:<br>
><br>
> Oops, readinto takes the same time as copying. This is a real shame,<br>
> because readinto in conjunction with the buffer interface was supposed to<br>
> avoid the redundant copy.<br>
><br>
> Is there a real performance regression here, is this a well-known issue, or<br>
> 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'import fileread_bytearray' 'fileread_bytearray.justread()'<br>
1000 loops, best of 3: 1.14 msec per loop<br>$1 -m timeit -s'import fileread_bytearray' 'fileread_bytearray.readandcopy()'<br>100 loops, best of 3: 2.78 msec per loop<br>$1 -m timeit -s'import fileread_bytearray' 'fileread_bytearray.readinto()'<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>